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

Nick Alcock nick.alcock@oracle.com
Tue May 17 12:33:41 GMT 2022


On 9 May 2022, Christian Groessler stated:

> On 5/9/22 14:01, Nick Alcock via Binutils wrote:
>> 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.
>
> If you're on a Debian system (maybe others), run "linux32" and configure in this subshell.
>
> It lets the programs think they are running on a 32bit machine.

This is only enough if you've replaced /usr/bin/gcc etc with wrappers
that detect this and introduce "-m32" etc into the invocations passed to
the real gcc. Debian uses such a wrapper, but it's not guaranteed on all
systems. (But if you are on such a system, it is terribly convenient.)

-- 
NULL && (void)


More information about the Binutils mailing list