On 28 Feb 2018, at 10:16, Thorsten Glaser <t.gla...@tarent.de> wrote:
> 
> On Wed, 28 Feb 2018, root wrote:
> 
>> autotools-dev (20180224.1) unstable; urgency=medium
>> 
>>  * Sync to upstream git 2018-02-24
>>    [commit bd9626458c30d7faec17d7dfbd85a80617b10007]
>>    + Add detection of x32 ABI for x86_64-*-linux-gnu (closes: #891281)
> 
> Thanks to klibc lacking x32 support, /bin/sh is an amd64
> binary on x32 machines with mksh’s lksh as /bin/sh, when
> lksh is built with klibc (which is the default in Debian),
> because klibc:x32 actually builds amd64 binaries.
> 
> I’d suggest this instead, which is actually dependent on
> the compiler used¹:
> 
>    x86_64:Linux:*:*)
>        eval "$set_cc_for_build"
>        if echo __ILP32__ | $CC_FOR_BUILD -E - 2>/dev/null \
>            | grep -q __ILP32__
>        then
>            echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
>        else
>            echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32
>        fi
>        exit ;;

Hi Thorsten,
This is what I proposed to upstream initially[0], but I was told that
CC_FOR_BUILD was deprecated and being phased out, and that I should be relying
on standard system utilities instead. I chose objdump /bin/sh as another
architecture was already doing that (though with different flags). I agree,
CC_FOR_BUILD is the only real way of determining whether the build architecture
is x32, but the upstream rules are the rules. Do you have a suggestion for
something better that doesn't rely on CC_FOR_BUILD?

James

[0] http://lists.gnu.org/archive/html/config-patches/2018-02/msg00014.html

Reply via email to