<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Check the latest version of m3-sys/cminstall/src/config/LINUXLIBC6. Notice that it now always uses -m32, --32 flags to the various compiler components (cm3cg, SYSTEM_CC, SYSTEM_AS). This forces use of the x86 variants. An AMD64_LINUX port will have an almost identical configuration file that forces use of the x86_64 toolchain.<div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><font class="Apple-style-span" color="#0000FF"><font class="Apple-style-span" face="Gill Sans"><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: Gill Sans; "><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: Gill Sans; ">Antony Hosking</span></span></font></font><font class="Apple-style-span" face="Gill Sans"><span class="Apple-style-span" style="font-family: Gill Sans; "><span class="Apple-style-span" style="font-family: Gill Sans; "> | </span></span><span class="Apple-style-span" style="font-family: Gill Sans; "><span class="Apple-style-span" style="font-family: Gill Sans; ">Associate Professor</span></span><span class="Apple-style-span" style="font-family: Gill Sans; "><span class="Apple-style-span" style="font-family: Gill Sans; "> | Computer Science | Purdue University</span></span></font></div><div><font class="Apple-style-span" face="GillSans-Light"><span class="Apple-style-span" style="font-family: GillSans-Light; ">305 N. University Street | West Lafayette | IN 47907 | USA</span></font></div><div><font class="Apple-style-span" color="#0000FF" face="Gill Sans"><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: Gill Sans; "><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: Gill Sans; ">Office</span></span></font><font class="Apple-style-span" face="GillSans-Light"><span class="Apple-style-span" style="font-family: GillSans-Light; "><span class="Apple-style-span" style="font-family: GillSans-Light; "> +1 765 494 6001 | </span></span></font><font class="Apple-style-span" color="#0000FF" face="Gill Sans"><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: Gill Sans; "><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: Gill Sans; ">Mobile</span></span></font><font class="Apple-style-span" face="GillSans-Light"><span class="Apple-style-span" style="font-family: GillSans-Light; "><span class="Apple-style-span" style="font-family: GillSans-Light; "> +1 765 427 5484</span></span></font></div><div><font class="Apple-style-span" face="GillSans-Light"><br class="khtml-block-placeholder"></font></div></span></span></span></span></span></span></span><br class="Apple-interchange-newline"></span></div></span> </div><br><div><html>On Apr 17, 2008, at 8:03 AM, Jay wrote:</html><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>Can anyone explain how Linux and gcc are managing that AMD64 systems can run<br> and presumably build x86 code?<br><br><br>I know there is /lib32 and /lib64.<br>I know there is gcc -m32 and gcc -m64.<br>I know that gcc itself delegates out to target specific executables, so one gcc plus flags suffices,<br> it's those other executables that multiply out. That ld has the -m flag. That as has --32 and --64.<br> I don't know how much stuff goes through gcc, vs. needs the get the as/ld flags correct.<br> I'm not talking about Modula-3 here, but, like of building gcc and its dependencies.<br> I can deal with the smaller Modula-3 system contained in far more readable Quake code than all the "sh"<br> and layers upon layers of makefiles and autoconf and sh and m4 etc..<br><br><br>./configure on various things tend to build just AMD64.<br><br><br>It appears in general that for any<br> apt-get install foo<br>you can often but not always<br> apt-get install foo-i386<br><br><br>This is on KUbuntu 8.4 Hardy Heron KDE4 beta AMD64 (mouthful!)<br><br><br>It looks like in general:<br>CC="gcc -m32" .../configure --prefix=/usr --libdir=/usr/lib32 --build=i686-pc-linux-gnu<br><br><br>is what you want, but that many packages are only native.<br>in particular gmp and mpfr:<br>apt-get install mpfr-i386<br>=> no luck<br><br><br>Maybe these are not considered "mainstream"?<br><br><br>I'll build them myself, something like:<br><br>cd /usr/src<br>apt-get source mpfr<br>mkdir -p obj/mpfr<br>cd obj/mpfr<br>CC="gcc -m32" /usr/src/mpfr-2.3.1.dfsg.1/configure --prefix=/usr --libdir=/usr/lib32 --build=i686-pc-linux-gnu<br>make<br>sudo make install<br><br><br>cd /usr/src<br>apt-get source libgmp3-dev<br>mkdir -p /usr/src/obj/gmp<br>cd /usr/src/obj/obj<br>CC="gcc -m32" /usr/src/gmp-4.2.2+dfsg/configure --prefix=/usr --libdir=/usr/lib32 --build=i686-pc-linux-gnu<br>make<br>sudo make install<br><br>You know, I just want building the Modula-3 system on AMD64_LINUX to at first merely build<br> an x86 hosted, x86 targeted binary. And then start changing things.<br><br><br>And between host, target, and build, I find the names confusing.<br>I understand why there are three -- the current system to build the compiler, a system to run the<br>compiler, a system to run the compiler's output, but these names host, target, build, aren't very<br>mnemonic with me yet. Is it build=now, host=runs the compier, target=runs the compiler's output?<br>I'll dig around.<br><br>I know, I can figure it all out, there's the www to search, but this biarch/multilib is hard<br>to find the docs for..and I can't read the masses of m4/sh/gmake..<br><br>ps: it's easy to get the ld to crash when doing this stuff wrong..<br><br>(I can explain how Windows does it, fyi.<br>1) The system is "doubled up", generally .dlls and .exes, but not kernel and drivers<br>c:\windows\system32 is native<br>c:\windows\syswow64 is 32bit<br>Yeah it's wierd/backwards, but it is source compatible.<br>There is runtime magic to redirect from "system32" in 32 bit processes to syswow64.<br>Though if folks used the very long standing APIs, this wouldn't have been needed. Oh well.<br>There is also c:\program files and c:\program files (x86). I guess people are better about using the APIs here.<br>"Introspection" is "broken" but this -- link -dump against c:\windows\system32 can get "redirected" but devtools aren't the priority and it does all generally work out, despite the hokiness.<br>The registry is similarly doubled up and redirected, in some places at least, since it tends to give paths to .dlls -- a process is either 32bit or 64bit -- can't load one type .dll in other type process.<br><br>On the devtools side, well, you know, NT always had ppc/mips/alpha/x86, so .libs are generally already in a directory named "i386" or "x86".<br>In any case, folks don't hardcode paths as much, because they are already so variable.<br>So you set up your environment or such using the %LIB% variable and it works easily.<br><br>For running devtools, there is a separate set of .exes for each target.<br>And sometimes for host.<br>The matrix is filled out as necessary.<br>AMD64 runs x86 fast so not always useful to fill out the matrix.<br>Sometimes a slash is used, sometimes an underscore, sometimes "win64" inserted, but again, it's generally reasonable hidden behind a .bat file to set the environment and set $PATH and set the console's title (console == xterm, not the one special console).<br><br>If you have more than one cl.exe or link.exe on your path, not good.<br>cl.exe does more work than the gcc driver, it doesn't delegate out as much.<br><br>There are no "fat" files like Apple does, well, not mechanized/systematic.<br>Something like sysinternals handle.exe that has an embedded driver has a toplevel x86 file that runs on everything and then on demand extracts the AMD64 or IA64 executable and driver, runs the other version of itself, installs the driver on demand and voila..<br>)<br><br> - Jay<br></div></blockquote></div><br></div></body></html>