[llvm-commits] [patch] Don't bake build info into the host

Joerg Sonnenberger joerg at britannica.bec.de
Mon May 9 12:34:02 PDT 2011


On Mon, May 09, 2011 at 01:52:09PM -0400, Rafael Avila de Espindola wrote:
> While working with 32 bit build of llvm on a 64 bit host I noticed
> that the 32 bit clang was unable to link any program.
> 
> The problem was that the basic 32 bit files (like crtbegin.o) are in
> different different paths on i386 and x86_64 hosts. The 32 bit clang
> was assuming it was running on a 32 bit host and failing to find
> them.

I think this is related by my earlier patch to cfe-dev about -m32 and
the target toolchain. A solution should address both, so let's look at
this problem in detail?

The problems I have are two fold:

The -m32 option changes the target triple, which changes the tools
called in a cross-compiling setup here. Worse, the --32 option for as is
not necessarily understood.

Targetting a 32bit environment on a 64bit host environment needs
different builtin paths than a native 32bit environment. With --sysroot,
this also applies to the cross-compiling environment.

As such, I would like to see the toolchain triple separated from the
target triple. The question of running 32bit clang vs 64bit clang on
x86_64 systems would boil down to whether -m32 or -m64 is the default,
it shouldn't change the toolchain triple and the various checks for "are
we building for i386 or i386-on-x86_64" can be adjusted based whether
the two triple matchr. This would replace explicit checks for -m32 /
-m64.

Joerg



More information about the llvm-commits mailing list