> From: [EMAIL PROTECTED] > To: gcc@gcc.gnu.org > Subject: "random" "Link tests are not allowed after GCC_NO_EXECUTABLES" > Date: Wed, 27 Aug 2008 08:30:29 +0000 > > > gcc 4.3.1 with small patches... (merged tree with binutils 2.18/gmp/mpfr, > also slightly patched) > build=i686-pc-cygwin > host=i686-pc-cygwin > target=i686-pc-mingw32 > > checking for ld that supports -Wl,--gc-sections... configure: error: Link > tests > are not allowed after GCC_NO_EXECUTABLES. > make[1]: *** [configure-target-libstdc++-v3] Error 1 > make[1]: Leaving directory `/obj/gcc.1/i686-pc-cygwin/i686-pc-mingw32' > make: *** [all] Error 2 > ... > Anyway, this is just a random report, like "cross building is a little too > difficult".
This was, for me a problem I have hit multiple times, lack of a sys-root, or lack of a correct sys-root. I'm wrapping everything up in Python...and I rather think toplevel configure should do some of the checks my Python does, to catch errors earlier and to tell people what to do about them. SOMETHING LIKE SO: def DoBuild(Host = None, Target = None, ExtraConfig = " "): if Host == None: Host = Build if Target == None: Target = Build DefaultSysroot = (Prefix + "/" + Target + "/sys-root") [snip] # # cross builds have extra requirements that are not automated, # in particular setting up "sys-root" or headers/libs ahead of time. # This is a very tricky area -- since it isn't automated and errors # doing this are often not caught till late, which is extra # frustrating. # Try to catch these errors early here. # # NOTE that if you are doing an "integrated" build with glibc or newlib, # then this is likely less of an issue, you are building the sysroot. # glibc is typical for Linux. # newlib is typical for embedded systems. # That still leaves many other systems such as Cygwin, MinGWin, and # commercial Unices with their native libc such as Solaris, HP-UX, AIX. # # NOTE that Cygwin does use newlib, but I don't have that setup to work here yet. # I build Cygwin separately. # if Build != Target: if Target.find("msdosdjgpp") != -1: # # I don't remember why I put this in, but it makes some sense -- no dynamic linking on djgpp. # ExtraConfig += " -disable-shared -enable-static " # # djgpp "favors" the pre-sysroot method, via the djgpp cross package # for a in [ #"lib", "include"]: b = Prefix + "/" + Target + "/" + a if not os.path.isdir(b): print("ERROR: Please create " + b + ", such as by extracting djcrx.zip in /usr/local/i586-pc-msdosdjgpp") exit(1) ExtraConfig += " -with-headers=" + Prefix + "/" + Target + "/include " #ExtraConfig += " -with-libs=" + Prefix + "/" + Target + "/lib " else: # # mingw sys-root is unusual; help the user # if Target == 'i686-pc-mingw32': for a in ["lib", "include"]: b = DefaultSysroot + "/mingw/" + a if not os.path.isdir(b): print("ERROR: Please create " + b + ", such as by a link (or NTFS junction) to /mingw/" + a) exit(1) # # normal sys-root # if not os.path.isdir(DefaultSysroot): print("ERROR: Please put appropriate subset of " + Target + " file system at " + DefaultSysroot + " (such as /lib, /usr/lib, /usr/include)") exit(1) ExtraConfig += " -with-sysroot " # # try workaround Canadian fixincludes not understanding sysroot of the cross compiler used to build it # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37036 # if (Host == Target) and (Host != Build): ExtraConfig += " -with-sysroot=/" ExtraConfig += " -with-build-sysroot=" + DefaultSysroot I've used this for native cygwin, sparc-solaris, sparc64-solaris, mingwin. Not yet djgpp (despite some code). Not yet Linux, BSD, ARM, embedded, AIX, HPUX, IRIX, etc. That is: It maybe isn't yet as general or specific as it should be. In particular, I think for a merged tree with newlib/glibc, it can just notice the existance of certain directories and know everything is ok. It is probably correct for all the "commercial Unices" and *BSD. As well, if user specified -with-sysroot and/or -with-build-sysroot, help them less -- skip all this approx. But still some sanity checking like for mingwin I think. Or maybe sanity check them all -- check for limits.h and/or stdio.h. You know, like how cc/cpp are checked for, check for those files up front, unless detected that you are going to build them (again, the glibc/newlib case, I think). See here, I'm at least an intermediate user, maybe an advanced user, slowly working through these issues by searching the web, reading the docs, reading the code, and I'm "donating my experience" (aka complaining but trying to be helpful. :) ), so maybe the next guy can have it a little easier (albeit less educational? :) ) Actually, the above doesn't say enough. In particular, setting up a mingw sysroot, on a Windows system, can go easily like: install mingw, such as to c:\mingw mkdir c:\cygwin\usr\local\i686-pc-mingw32\sys-root\mingw \\live.sysinternals.com\tools\junction c:\cygwin\usr\local\i686-pc-mingw32\sys-root\mingw\include c:\mingw\include \\live.sysinternals.com\tools\junction c:\cygwin\usr\local\i686-pc-mingw32\sys-root\mingw\lib c:\mingw\lib I suppose to be more useful I should reform this into sh and path configure.ac. The reason I haven't done it that way is for my own ease of maintenence -- easier to maintain patches on the side than get them upstream probably. If folks are actually interested, I can do that. As long as bugs like http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37036 exist (or explained to me why it isn't a bug), I kinda think people are not interested. - Jay