config-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: config.guess returns bogus triple on Linux/x86_64 bi-arch system


From: Dmitry V. Levin
Subject: Re: config.guess returns bogus triple on Linux/x86_64 bi-arch system
Date: Sun, 8 May 2022 23:25:06 +0300

On Sun, May 08, 2022 at 09:55:09PM +0200, Bruno Haible wrote:
> Dmitry V. Levin wrote:
> > Thanks, I agree with this approach in general, but could you rewrite the
> > test to invoke the compiler just once, please?  You can use cc_set_libc
> > and cc_set_vars cases as examples.
> 
> Sure. Find it attached. Tested with various GCC versions, clang, and tcc:
[...]
> +         sed 's/^        //' << EOF > "$dummy.c"
> +         #ifdef __i386__
> +         ABI=x86
> +         #else
> +         #ifdef __ILP32__
> +         ABI=x32
> +         #else
> +         ABI=64

I'd prefer to be on the safe side and have ABI=64 assigned by default
somewhere before the eval.  This would also save one line of code.

> +         #endif
> +         #endif
> +EOF
> +         cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | 
> sed 's, ,,g'`
> +         eval "$cc_set_abi"
> +         case "$ABI" in

commit 9a37c126ce64403b83e9cfe72e29c26ab3a209b3 claims that quotes
in case commands are redundant.



-- 
ldv



reply via email to

[Prev in Thread] Current Thread [Next in Thread]