On Mon, Mar 12, 2018 at 06:42:15PM +0100, Andreas Krebbel wrote: > On 03/12/2018 06:31 PM, Jakub Jelinek wrote: > > On Mon, Mar 12, 2018 at 06:28:09PM +0100, Andreas Krebbel wrote: > >> Currently the default ABI option for a GCC built on a 64 bit system is > >> always -m64. This is inconvenient when e.g. building 32 bit libraries > >> on a 64 bit system. The usual way to do this is to set the personality > >> to s390 (32 bit) and let the configure script do the right thing. > >> Having a GCC which defaults to -m64 also requires to get a -m31 somehow > >> into the option list. > >> > >> With that patch the GCC driver checks the current personality setting in > >> order to figure out at runtime what the default is supposed to be. > >> > >> Bootstrapped and regtested on s390x. > >> > >> I will commit the patch after waiting a few days for comments. > > > > I don't like this, it is inconsistent with how it is handled on all other > > targets and how it worked for years. Having setarch magically change the > > default is dangerous. > > Wow, that was quick ;) > > I didn't expect this to break things. Could you please elaborate where this > might cause trouble?
It is an unexpected major behavior change for environments that are this way used for 1-2 decades. When people want -m32 they just specify it, or if they want a compiler that defaults to -m32 they configure it that way; when gcc 7.x works one way and 8.x works differently, it will just mean people will need to use -m32 or -m64 all the time, otherwise they won't be sure what will happen. Plus as I said, it is about consistency, why should s390x work in this regard any differently in this regard from x86_64, powerpc64, sparc64, mips64, which don't change the default even when setarch changes uname. Jakub