1 Dec 2005 13:21
Re: Can you help with gcc build GCC_NO_EXECUTABLES problem?
Kai Ruottu <karuottu <at> mbnet.fi>
2005-12-01 12:21:27 GMT
2005-12-01 12:21:27 GMT
Kai Ruottu wrote: > Jonathan Beit-Aharon wrote: > >> Hi, >> I am trying to build gcc 3.4.2 on Linux, and am running into *exactly* >> the same problem (also with library libstdc++v3). >> >> Subject: help building x86_64->i686 cross-compiler >> >> I'm running a debian amd64 (pure, not biarch/multiarch), and I'm >> trying to build gcc that is able to compile regular x86 binaries (as >> in): >> checking host system type... i686-pc-linux-gnu >> checking build system type... x86_64-unknown-linux-gnu >> >> but it fails with the following: >> checking for main in -lm... configure: error: Link tests are not >> allowed after GCC_NO_EXECUTABLES. Sorry, I'm starting to be converted being just as "one-eyed" as the majority, expecting everyone to build only native-GCCs If producing a cross-GCC, one of course MUST have the target headers and libraries below the chosen $(tooldir) or '$prefix/$target', preinstalled BEFORE starting to build the GCC !!! If the '$target' is the Debian/i386 (with for i686 optimized libs etc.), then the target C library should be from that. If the $target is Red Hat Linux 9, then the C library should be taken from that. And so on, it is not at all sure that the 32-bit Linux/x86's are totally binary-compatible... How and where one puts the target C library, is up to the GCC builder, no accepted 'standard' for this... My habit is to put the (Linux) target C library below a (common) $sysroot, almost in 1:1 arrangement with the natively installed glibc, each $target having its own 'host-$target' subdir there, like '/opt/host-i586-suse-linux-10.0' for the SuSE 10.0/i386 target, the $sysroot being the '/opt'... Unpacking the $target RPMS or '.deb' packages below the '$sysroot/host-$target' and fixing some things is everything one needs to do with the pre-made glibc for the $target. Then one needs to add two (or more if adding X11 etc. libs) symlinks into the $(tooldir) for the cross-GCC : include -> $sysroot/host-$target/usr/include lib -> $sysroot/host-$target/usr/lib and make a work-around for the eternal 'sys-include' bug there : sys-include -> include because the GCC build really tries to find the target headers from the '$(tooldir)/sys-include' despite of whatever the GCC manuals will tell about this and whatever the de-facto standards for cross-GCCs are... So maybe the main problem here is not understanding that a GCC has no C library, so it must be taken from somewhere and be preinstalled before starting to build GCC. Just as is the case with the binutils, neither they belong to GCC... Currently there is some kind of new bolshevism idea which states that people shouldn't use any 'original' libraries for a Linux target, but one should replace them with self-built glibc, termcap, ncurses, X11, Gnome, KDE etc. libraries... If one really feels this idea about starting everything from absolute scratch as one's own, then there are people who will support that idea. The things below then come from my Scandinavian 'social democracy', "evolutionary socialism", which states that bettering the world can be based on what we already have, no "starting everything from scratch" is needed...