I configured GCC like this: /n/08/rask/src/gcc/configure --target=powerpc-unknown-eabisim --disable-nls --with-newlib --enable-sim --disable-shared --enable-languages=c,c++,objc When make runs configure in the target subdirectories, sim-crt0.o from libgloss isn't found: configure:2362: checking for C compiler version [...] configure:2397: /home/rask/build/gcc-powerpc-unknown-eabisim/./gcc/xgcc -B/home/rask/build/gcc-powerpc-unknown-eabisim/./gcc/ -nostdinc -B/home/rask/build/gcc-powerpc-unknown-eabisim/powerpc-unknown-eabisim/newlib/ -isystem /home/rask/build/gcc-powerpc-unknown-eabisim/powerpc-unknown-eabisim/newlib/targ-include -isystem /n/08/rask/src/gcc/newlib/libc/include -B/usr/local/powerpc-unknown-eabisim/bin/ -B/usr/local/powerpc-unknown-eabisim/lib/ -isystem /usr/local/powerpc-unknown-eabisim/include -isystem /usr/local/powerpc-unknown-eabisim/sys-include -L/home/rask/build/gcc-powerpc-unknown-eabisim/./ld -o conftest -O2 -g -O2 conftest.c >&5 /home/rask/build/gcc-powerpc-unknown-eabisim/gcc/../ld/ld-new: sim-crt0.o: No such file: No such file or directory collect2: ld returned 1 exit status configure:2400: $? = 1 I see this in several target subdirs' config.log: boehm-gc/config.log libgcc/config.log libiberty/config.log libssp/config.log libstdc++-v3/config.log The cause of the problem is that the necessary -L or -B option pointing to the libgloss/rs6000 directory is missing. The result is that link tests fail.
The same thing happens when configuring with --target==mcore-unknown-elf, only the startup file is crt0.c instead of sim-crt0.o.
Created attachment 13641 [details] Patch to add -L and -B as necessary This happens on all targets except m32c-*-*. I'm testing the attached patch.
Subject: Re: sim-crt0.o/crt0.o isn't found during configure due to missing -L or -B Note that m32c puts *.ld files in the *build* directory, not the *source* directory, unlike most targets. The m32c source directory only has templates. Also, please keep the comments around. You're deleting them from the m32c case, but not adding equivalent ones in the generic case.
Created attachment 13642 [details] Patch v2 to add -L and -B as necessary I believe I have covered boths cases of linker script placement. The comments ended up a lot farther away from the lines they were supposed to comment than intended. The attached patch fixes a few things that I didn't get right in my first attempt.
m32c still needs -L$$r/$(TARGET_SUBDIR)/libgloss/m32c to find r8c.ld in the build directory. Your patch would only search in the source directory. Be careful with -B vs -L, and $$r vs $$s. You've also removed the special flags needed for a mep build.
According to the documentation, -B passes -L to the linker, so there is no need to pass both. It seems to work as documented.
Created attachment 13669 [details] Patch v3 to add -L and -B as necessary This patch should fix the mep* case that I accidentally deleted.
Bug bootstrap/12019 looks similiar to this one.
Bug bootstrap/28949 is also similiar to this one. Btw, this bug is the root cause of the error message 'Link tests are not allowed after GCC_NO_EXECUTABLES' for newlib targets, so it should show up in searches for that message, which it will now.
DJ, do you think this patch is ok?
Subject: Bug number PR 32154 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-09/msg00815.html
Subject: Bug 32154 Author: rask Date: Mon Sep 10 14:20:10 2007 New Revision: 128344 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128344 Log: PR other/32154 * configure.ac: For libgloss targets, point the linker to the linker script, startup code and simulator library. * configure: Regenerate. Modified: trunk/ChangeLog trunk/configure trunk/configure.ac
Fixed as of revision 128344.