This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [3.1] More regressions on S/390 - revert lib64 patch



Richard Henderson wrote:

>/usr/lib/rpm/rpmrc can set optflags to include -m32 and -m64, then
>you use --target to force building for the non-default variant.
>
>OTOH, some makefiles are badly written and lose track of the options
>that were passed down from the top-level make.  At which point you
>get link errors mixing 32/64 objs.
>
>OTOH, some makefiles are to poorly written that they lose track of
>CC too, so at some point you have to just start fixing build losage.

Yes.  This is why I was wondering whether we could use the personality
setting to avoid the need to change anything in the build process:

Setting the personality to LINUX_32BIT causes uname to return the
31-bit string (s390) on a 64-bit system (s390x).  This setting is
recursively inherited by child processes, so you could just run the
whole build process as children of a process that had its personality
changed.

You'll want to do this anyway, if the build process uses uname to try
to figure out the host architecture (like most configure scripts do).
So, I was thinking that if the regular 'gcc' driver would check uname
at runtime, and automatically add a -m31/-m64 flag (unless overridden
on the command line, of course) if the returned architecture differs
from the default one, everything should just work ...


Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand
  Linux for S/390 Design & Development
  IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
  Phone: +49-7031/16-3727   ---   Email: Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]