<div class="gmail_quote">On Tue, Jan 24, 2012 at 8:23 AM, Joerg Sonnenberger <span dir="ltr"><<a href="mailto:joerg@britannica.bec.de">joerg@britannica.bec.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":d78">I disagree with this. I don't the host OS is involved in any of the<br>
decisions. Let me summarize how NetBSD handles this case, I think the<br>
same applies to other platforms and can be moved into the upper layers.<br></div></blockquote><div><br></div><div>Not really... I would look at the other platforms to understand why....</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":d78">When clang is invoked, it derives the base target either from program<br>
name, command line or configuration. During the NetBSD build, it is<br>
always the program name (e.g. x86_64--netbsd-clang). This base target is<br>
memorised and used for finding the tool chain, so that e.g.<br>
x86_64--netbsd-ld is used as linker. If the driver finds -m32 on the<br>
command line, three things change. The triple for the compiler invocation<br>
is changed to i386--netbsd. This changes the code generation only.<br>
Second, the library search path is changed from =/usr/lib to =/usr/lib/i386.<br>
That's where crt0.o and friends can be found. This differs from a<br>
"native" i386--netbsd compiler, since that expects the path correctly in<br>
=/usr/lib to match the native environment. Third, -m elf_i386 is passed<br>
to ld.<br></div></blockquote><div><br></div><div>There are lots of other issues on non-netbsd systems such as where the GCC toolchain is installed. For some Linux distros there is a nice predictable location, but for others there isn't. For still others, there is a nice predictable location, but it isn't as strictly related to the target as I would like.</div>
<div><br></div><div><br></div><div>Anyways, see my response to James... this isn't enough even if I wanted it to be, so I'm going to try a different approach anyways.</div></div>