how should I configure my buuild for i386-*linux*

Nick Alcock nick.alcock@oracle.com
Mon May 9 12:01:37 GMT 2022


On 7 May 2022, Andreas Schwab told this:

> On Mai 07 2022, Nick Alcock via Binutils wrote:
>
>> Thankfully the answer is pretty simple. Try configuring like this:
>>
>> configure CC="gcc -m32" ...
>
> That would would conflict with the value of the --host option.

Well, you'd use --host if you want to trigger a cross-compilation: but
most uses in this case are not cross-compilations at all but different
compiler configurations on a multiarch system capable of executing
x86-32 and x86-64 programs. Just flipping the CC flags is enough in this
case. Obviously before this can work you need a 32-bit libc etc etc
but almost everyone who's even thinking of doing this will either
already have one or will have one trivially available to install.

(It's also enough if you have qemu and binfmt_misc set up to "natively"
execute non-native programs through emulation, though that will almost
always require building a suitable libc etc via conventional
cross-compilation first.)

(aplogies, I know I'm probably teaching my grandfather to suck eggs, but
ti was recently borne in on me how many people don't know this stuff! So
I thought it might be worth reiterating anyway.)

-- 
NULL && (void)


More information about the Binutils mailing list