public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: Yang Yujie <yangyujie@loongson.cn>
Cc: gcc-patches@gcc.gnu.org,  xry111@xry111.site,
	 xuchenghua@loongson.cn,  panchenghui@loongson.cn,
	 chenglulu@loongson.cn
Subject: Re: [PATCH v1 2/6] LoongArch: improved target configuration interface
Date: Wed, 06 Sep 2023 07:43:26 +0100	[thread overview]
Message-ID: <mpty1hjrecx.fsf@arm.com> (raw)
In-Reply-To: <20230814035707.11272-2-yangyujie@loongson.cn> (Yang Yujie's message of "Mon, 14 Aug 2023 11:57:03 +0800")

Yang Yujie <yangyujie@loongson.cn> writes:
> @@ -5171,25 +5213,21 @@ case "${target}" in
>  		# ${with_multilib_list} should not contain whitespaces,
>  		# consecutive commas or slashes.
>  		if echo "${with_multilib_list}" \
> -		| grep -E -e "[[:space:]]" -e '[,/][,/]' -e '[,/]$' -e '^[,/]' > /dev/null; then
> +		| grep -E -e "[[:space:]]" -e '[,/][,/]' -e '[,/]$' -e '^[,/]' > /dev/null 2>&1; then
>  			echo "Invalid argument to --with-multilib-list." 1>&2
>  			exit 1
>  		fi
>  
> -		unset component idx elem_abi_base elem_abi_ext elem_tmp
> +		unset component elem_abi_base elem_abi_ext elem_tmp parse_state all_abis
>  		for elem in $(echo "${with_multilib_list}" | tr ',' ' '); do
> -			idx=0
> -			while true; do
> -				idx=$((idx + 1))
> -				component=$(echo "${elem}" | awk -F'/' '{print $'"${idx}"'}')
> -
> -				case ${idx} in
> -				1)
> -					# Component 1: Base ABI type
> +			unset elem_abi_base elem_abi_ext
> +			parse_state="abi-base"
> +
> +			for component in $(echo "${elem}" | tr '/' ' '); do
> +				if test x${parse_state} = x"abi-base"; then
> +					# Base ABI type
>  					case ${component} in
> -					lp64d) elem_tmp="ABI_BASE_LP64D,";;
> -					lp64f) elem_tmp="ABI_BASE_LP64F,";;
> -					lp64s) elem_tmp="ABI_BASE_LP64S,";;
> +					lp64d | lp64f | lp64s) elem_tmp="ABI_BASE_$(tr a-z A-Z <<< ${component}),";;

"<<<" isn't portable shell.  Could you try with:

  echo ${component} | tr ...

instead?

As it stands, this causes a bootstrap failure with non-bash shells
such as dash, even on non-Loongson targets.

(Part of me wishes that we'd just standardise on bash.  But since that
isn't the policy, I sometimes use dash to pick up my own lapses.)

Thanks,
Richard

  parent reply	other threads:[~2023-09-06  6:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-14  3:57 [PATCH v1 1/6] LoongArch: a symmetric multilib subdir layout Yang Yujie
2023-08-14  3:57 ` [PATCH v1 2/6] LoongArch: improved target configuration interface Yang Yujie
2023-08-14  5:22   ` Xi Ruoyao
2023-08-15  1:12     ` Yujie Yang
2023-08-14  5:29   ` Xi Ruoyao
2023-08-14  5:58   ` Xi Ruoyao
2023-08-14  6:01     ` Xi Ruoyao
2023-08-14  8:44     ` Yujie Yang
2023-08-14  8:49       ` Xi Ruoyao
2023-08-14  8:57         ` Yujie Yang
2023-08-14  8:58           ` Xi Ruoyao
2023-09-06  6:43   ` Richard Sandiford [this message]
2023-09-06  6:54     ` Yang Yujie
2023-08-14  3:57 ` [PATCH v1 3/6] LoongArch: define preprocessing macros "__loongarch_{arch,tune}" Yang Yujie
2023-08-14  5:24   ` Xi Ruoyao
2023-08-14  3:57 ` [PATCH v1 4/6] LoongArch: use -mstrict-align by default when building libraries Yang Yujie
2023-08-14  5:18   ` Xi Ruoyao
2023-08-14  3:57 ` [PATCH v1 5/6] LoongArch: export headers for building GCC plugins Yang Yujie
2023-08-14  3:57 ` [PATCH v1 6/6] LoongArch: support loongarch*-elf target Yang Yujie
2023-08-14  5:38 ` [PATCH v1 1/6] LoongArch: a symmetric multilib subdir layout Xi Ruoyao
2023-08-14  5:40   ` Xi Ruoyao
2023-08-14  7:37   ` Yujie Yang
2023-08-14  7:48     ` Xi Ruoyao
2023-08-14 10:18       ` Yujie Yang
2023-08-14 11:16         ` Xi Ruoyao
2023-08-15  1:29           ` Xi Ruoyao
2023-08-15  2:32             ` Yujie Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mpty1hjrecx.fsf@arm.com \
    --to=richard.sandiford@arm.com \
    --cc=chenglulu@loongson.cn \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=panchenghui@loongson.cn \
    --cc=xry111@xry111.site \
    --cc=xuchenghua@loongson.cn \
    --cc=yangyujie@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).