From: Henry N. <hen...@ar...> - 2008-01-26 13:30:08
|
Michael Gerdau wrote: > Hi list, > > I'm currently trying to adopt our set of scripts to create a Linux hosted > MinGW xcompiler based on the gcc 4.2.1 TP as of the MinGW download area > at sourceforge. > > As it stands my current version of the scripts works as expected in that > all configure/make statements dynamically created are the way I think they > should be. Creation of the initial C-only xgcc seems to work as well. > > My problems start when I use this xgcc to compile mingw-runtime. That > always ends with the following error: > ... > i686-pc-mingw32-ranlib libmingwex.a > make[1]: Leaving directory `/home/mgd/tmp/mingw/mingw-runtime-3.14/build/mingwex' > i686-pc-mingw32-dlltool --as i686-pc-mingw32-as --output-def mingwthrd.def mthr.o mthr_init.o > i686-pc-mingw32-gcc -Wl,--base-file=mingwthrd.base -B./ -mdll -Wl,--image-base,0x6FBC0000 -Wl,--entry,_DllMainCRTStartup@12 mthr.o mthr_init.o -Lmingwex \ > -o mingwthrd_dummy.exe > /home/mgd/mingw421.SJLJ-EH.ld-2.18.50-20071123/bin/../lib/gcc/i686-pc-mingw32/4.2.1-sjlj/../../../../i686-pc-mingw32/bin/ld: this linker was not configured to use sysroots > collect2: ld gab 1 als Ende-Status zurück > make: *** [mingwthrd.def] Fehler 1 > ./x86-mingw32-build.sh: unrecoverable error building mingw-runtime > > > I've tried with the following versions of binutils: > binutils-2.16.91-20060119-1-src.tar.gz > binutils-2.17.50-20060824-1-src.tar.gz (before Keith's recent change) > binutils-2.17.50-20070129-1-src.tar.gz > binutils-2.18.50-20071123-src.tar.gz The version of binutils does no matter. Have tryed 2.17.50-20060716-1, 2.17.50-20070129-1 and 2.18.50-20080109. > I also took the gcc-4.2.2 sources from gcc.gnu.org and ported Danny's > changes to 4.2.1 to them and retried -- to no avail. > > I tried mingw-runtime 3.13 and 3.14, w32api was 3.11. > > > Need I say that all combinations failing with gcc 4.2.1 do work nicely > when using gcc 3.4.5 sources ?! > > > Whenever gcc 4.2.x is involved the stmt > i686-pc-mingw32-gcc -Wl,--base-file=mingwthrd.base -B./ -mdll -Wl,--image-base,0x6FBC0000 -Wl,--entry,_DllMainCRTStartup@12 mthr.o mthr_init.o -Lmingwex \ > -o mingwthrd_dummy.exe > > yields an error: > ...i686-pc-mingw32/bin/ld: this linker was not configured to use sysroots Have exactly the same errors. > At this point in time I guess I need advice from someone more knowledgeable > w/r to binutils and/or xbuilding mingw-runtime to point me towards the right > direction for further investigation. Have tried different --with-sysrooot=... and --sysroot=... All they ends with different errors, for example: ../../../gcc-4.2.2/libssp/gets-chk.c: In function '__gets_chk': ../../../gcc-4.2.2/libssp/gets-chk.c:66: warning: implicit declaration of function 'alloca' ../../../gcc-4.2.2/libssp/gets-chk.c:66: warning: incompatible implicit declaration of built-in function 'alloca' libtool: link: warning: undefined symbols not allowed in i686-pc-mingw32 shared libraries My best result have with: --- x86-mingw32-build.sh +++ x86-mingw32-build.sh @@ -80,6 +80,7 @@ $script: stage $STAGE: build $COMPONENT $RUN prepare binutils-$BINUTILS_VERSION $RUN setbuilddir binutils* $RUN ../configure --prefix="$INSTALL_DIR" --target="$TARGET" \ + --with-sysroot="$INSTALL_DIR" \ $GLOBAL_BASE_OPTIONS $BINUTILS_BASE_OPTIONS || die $? \ "$unrecoverable configuring binutils" fi ========= I have also this file gcc-core-4.2.2-patch-1 in directory patches: --- gcc-4.2.2/gcc/config/i386/t-mingw32 +++ gcc-4.2.2/gcc/config/i386/t-mingw32 @@ -1,2 +1,2 @@ # Match SYSTEM_INCLUDE_DIR -NATIVE_SYSTEM_HEADER_DIR = /mingw/include +NATIVE_SYSTEM_HEADER_DIR = /include ========= Script was started as: TARGET_CPU=i686 ./x86-mingw32-build.sh --batch i686-pc-mingw32 The gcc exist. With a simple source "int main (void) { return(0); }", compiled with "i686-pc-mingw32-gcc main.c" got this error: /home/hn/mingw/lib/gcc/i686-mingw32/4.2.2/../../../../i686-mingw32/bin/ld: crt2.o: No such file: No such file or directory collect2: ld returned 1 exit status The file exist as /home/hn/mingw/lib/crt2.o, "/home/hn/mingw" is the INSTALL_DIR. 32bit or 64bit host does no difference. I feel, it has something to do with the sysroot parameter. Changelog for gcc 4.x.x give some hints about changes on that parameter and a new parameter --with-build-sysroot. Have anybody finish the script x86-mingw32-build.sh with gcc 4.2.x ? I have other scripts managed in www.colinux.org ready with gcc 4.2.2 and binutils 2.17.50-20070129-1. The difference is, that we using mingw-runtime as binary, and additional parameter --with-headers. http://colinux.svn.sourceforge.net/svnroot/colinux/branches/devel/bin/build-cross.sh -- Henry N. |