http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48512
Summary: [4.6] gcj spec files references incorrectly crtmt.o on i686-w64-mingw32 target Product: gcc Version: 4.6.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: java AssignedTo: unassig...@gcc.gnu.org ReportedBy: blak...@gentooist.com When cross compiling GCJ with host platform i386-redhat-linux and target platform i686-w64-mingw32, the GCJ spec file is generated adding crtmt.o to startfile. The path to this file is not a full path, so it is looked up in the current directory, resulting in No such file or directory error when compiling a .exe with GCJ. Versions used are the following: # i686-w64-mingw32-gcj -v Using built-in specs. Reading specs from /home/users_csee/parizet/mingw32/root/bin/../lib/gcc/i686-w64-mingw32/4.6.1/../../../../i686-w64-mingw32/lib/libgcj.spec rename spec startfile to startfileorig rename spec lib to liborig COLLECT_GCC=i686-w64-mingw32-gcj COLLECT_LTO_WRAPPER=/home/users_csee/parizet/mingw32/root/bin/../libexec/gcc/i686-w64-mingw32/4.6.1/lto-wrapper Target: i686-w64-mingw32 Configured with: ../../sources/gcc-4.6-20110401/configure --prefix=/users_csee/parizet/mingw32/root --with-sysroot=/users_csee/parizet/mingw32/root --disable-multilib --with-mpfr=/users_csee/parizet/mingw32/root --with-mpc=/users_csee/parizet/mingw32/root --with-gmp=/users_csee/parizet/mingw32/root --with-cloog=/users_csee/parizet/mingw32/root --with-ppl=/users_csee/parizet/mingw32/root --enable-cloog-backend=isl --disable-shared --enable-threads=win32 --disable-tls --disable-__cxa_atexit --enable-languages=c,c++,java --enable-libssp --disable-win32-registry --disable-nls --disable-lto --enable-libgcj --enable-sjlj-exceptions --target=i686-w64-mingw32 --build=i386-redhat-linux Thread model: win32 gcc version 4.6.1 20110401 (prerelease) (GCC) and mingw32 revision 4105 from the trunk. When removing the crtmt.o from startfile in libgcj.spec file, it works fine.