-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ranjit Mathew wrote: > > So now I only need to figure out why the cross-compiler > is not picking up headers from $PREFIX/$TARGET while > building a crossed-native compiler, even though it used > to do so in earlier releases.
This is misleading, so I think I should clarify. The problem is that I am building a crossed-native compiler for MinGW from Linux (i.e. build = i686-pc-linux-gnu, host == target = i686-pc-mingw32) using a just-built cross-compiler and the build fails on the stmp-fixinc Makefile target as it cannot find $SYSTEM_HEADER_DIR. After this patch: http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00122.html $SYSTEM_HEADER_DIR is supposed to be "/mingw/include" for a native MinGW target (and since host == target, the build is being considered native). However, in a crossed- native build, I cannot have MinGW headers in this path, so the way I work around this problem is to additionally specify "--with-sysroot=$PREFIX" and extract MinGW headers into "$PREFIX/mingw". This lets the build and installation complete successfully, but when I tar this installation and install it on a Windows machine, GCC fails to find the system headers. The workaround *then* is to rename the "mingw" folder to "$TARGET" (i.e. i686-pc-mingw32) again. Needless to say, this is painful. In earlier releases, I used to be able to just extract the headers to $PREFIX/$TARGET, do the crossed-native build, install the compiler and then bundle this installation up to create a relocatable toolchain. This was the whole point of the article: http://rmathew.com/articles/gcj/bldgcj.html I had written documenting this process. Note that in the follow-up message: http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00142.html to the patch mentioned above, Danny Smith mentions that this patch causes no problems if MinGW is actually installed in /mingw. This seems to imply that the only $PREFIX that is properly supported is /mingw and the headers from mingw-runtime should be extracted into /mingw/include. Thanks, Ranjit. - -- Ranjit Mathew Email: rmathew AT gmail DOT com Bangalore, INDIA. Web: http://rmathew.com/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFET27CYb1hx2wRS48RAna+AJ9NV06yXMi2tZSCppB1er3SXSrbYQCdEgV/ SBX3qobpH4eL3E+LF+ondX4= =XmbU -----END PGP SIGNATURE-----