config-patches
[Top][All Lists]
Advanced

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

Re: DO NOT use file format of /bin/sh for x32 detection!


From: Earnie
Subject: Re: DO NOT use file format of /bin/sh for x32 detection!
Date: Sun, 4 Mar 2018 11:59:29 -0500
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 3/3/2018 10:13 PM, Thorsten Glaser wrote:
> On Thu, 1 Mar 2018, James Clarke wrote:
> 
>> x32, so it's not a *pure* system, but build=host=target=x32.
> 
> Well, “pure” x32 systems don’t exist, as it’s a userland-only
> architecture, the kernel is simply amd64 for example. Same for
> arm64ilp32 and arm64/aarch64 and perhaps(?) MIPS n32/n64.
> 
> Worse, x32 users are expected to run mixed (Multi-Arch)
> systems, usually with amd64, though mine uses i386 for
> those binaries not working with x32 yet.
> 

Having re-read the thread in the online archive, I don't see any
indication of what the uname parts are but that doesn't matter.  The
only purpose for config.guess is as a convenience when no --build is
supplied.  As you say "it's a userland-only architecture" then it is up
to userland to specify and not rely on the conveniences.  Allowing the
precedent here will open up a maintenance nightmare.

> But this is not even the case here: the x32 binary of any
> utility built with klibc is indistinguishable from the
> amd64 binary of the same utility built with klibc because
> klibc treats x32 as amd64.
> 

Same comment as above.

> 
> For --build= I agree checking the compiler isn’t usually
> necessary, and the build system should be similar enough
> to amd64, so checking a binary is a somewhat(!) sensible
> approach. I’d suggest checking the uname binary, since
> it’s unlikely to be built into the shell and called from
> config.guess anyway, or perhaps $CC, although that could
> have arguments so only its first word.
> 

When specifying --build config.guess doesn't execute.  However
config.sub does to try to normalize the triplet.  And config.sub can be
used to supply what you're looking to do.

According the the GNU Coding Standard, I should be able to do the
following and get a corresponding triplet for the build:
$ configure linux-amd64ilp32

This doesn't give you the convenience of config.guess but does allow for
specifying to configure what you're trying to accomplish.

> 
> For --host= checking the compiler is an absolute must,
> though. --target= must be manually passed, so that’s
> indeed not needing consideration.
> 

The --host is used to specify the unique build system set to use for a
cross build environment.  In other words the executable being built will
be hosted on the specified --host.  If the compiler doesn't exist to
create those binaries then you need to create the build system.  The
--target is used to build the build systems that create binaries for
specified --host systems.

-- 
Earnie



reply via email to

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