Bug 32154 - sim-crt0.o/crt0.o isn't found during configure due to missing -L or -B
Summary: sim-crt0.o/crt0.o isn't found during configure due to missing -L or -B
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-30 13:19 UTC by Rask Ingemann Lambertsen
Modified: 2008-05-23 09:33 UTC (History)
3 users (show)

See Also:
Host: *-*-*
Target: *-*-* except m32c-*-*
Build: *-*-*
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Patch to add -L and -B as necessary (897 bytes, patch)
2007-05-31 21:01 UTC, Rask Ingemann Lambertsen
Details | Diff
Patch v2 to add -L and -B as necessary (956 bytes, patch)
2007-05-31 22:37 UTC, Rask Ingemann Lambertsen
Details | Diff
Patch v3 to add -L and -B as necessary (888 bytes, patch)
2007-06-08 17:35 UTC, Rask Ingemann Lambertsen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rask Ingemann Lambertsen 2007-05-30 13:19:49 UTC
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.
Comment 1 Rask Ingemann Lambertsen 2007-05-31 10:02:41 UTC
The same thing happens when configuring with --target==mcore-unknown-elf, only the startup file is crt0.c instead of sim-crt0.o.
Comment 2 Rask Ingemann Lambertsen 2007-05-31 21:01:15 UTC
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.
Comment 3 DJ Delorie 2007-05-31 21:09:32 UTC
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.
Comment 4 Rask Ingemann Lambertsen 2007-05-31 22:37:37 UTC
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.
Comment 5 DJ Delorie 2007-06-01 01:08:58 UTC
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.
Comment 6 Rask Ingemann Lambertsen 2007-06-01 19:56:26 UTC
According to the documentation, -B passes -L to the linker, so there is no need to pass both. It seems to work as documented.

Comment 7 Rask Ingemann Lambertsen 2007-06-08 17:35:08 UTC
Created attachment 13669 [details]
Patch v3 to add -L and -B as necessary

This patch should fix the mep* case that I accidentally deleted.
Comment 8 Rask Ingemann Lambertsen 2007-06-11 22:05:38 UTC
Bug bootstrap/12019 looks similiar to this one.
Comment 9 Rask Ingemann Lambertsen 2007-06-15 14:24:30 UTC
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.
Comment 10 Paolo Bonzini 2007-06-20 11:13:20 UTC
DJ, do you think this patch is ok?
Comment 11 patchapp@dberlin.org 2007-09-10 02:43:22 UTC
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
Comment 12 Rask Ingemann Lambertsen 2007-09-10 14:20:25 UTC
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

Comment 13 Rask Ingemann Lambertsen 2007-09-10 14:27:58 UTC
Fixed as of revision 128344.