hardcoding -m32/-m64 is more harmful than using the toolchain defaults

David Holmes david.holmes at oracle.com
Tue Oct 20 07:36:35 UTC 2015


> On 20/10/2015 6:50 AM, Matthias Klose wrote:
>> I'm working around some build failures for zero targets, which fail to
>> build because the configury in openjdk tries to set -m32/-m64 on it's
>> own.  I assume this behaviour was added for sun/oracle product builds to
>> build x86 and x86_64 targets on a x86_64 platform.  The issue is that
>> the current configury checks if -m32/-m64 works with the current
>> compiler, and then enables it without losses. This breaks at least on
>> the x86_64-linux-gnux32 target.  I assume it will break on other targets
>> as well, which don't recognize -m32/-m64, but usually use other options
>> like -mabi=<name>.  Instead of hard-coding these flags for every
>> architecture, is there any chance for not passing these flags at all for
>> the default mode?

Part of the problem is that the default mode is not known ahead of time, 
your gcc on your x64 system might be configured to build 32-bit by default.

If there is a better way to select this than -m32/-m64 then I'm happy to 
hear it, but not sure if -march/-mabi gives us anything better on x86. 
What exactly would you propose?

Thanks,
David

>>
>> Thanks, Matthias



More information about the build-dev mailing list