This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fix for messed-up shlib.lds


Dan Kegel wrote:

Kumba wrote:

I have been testing my script by attempting to compile an i686-pc-linux-gnu -> mips-unknown-linux-gnu cross-compiler. About halfway, maybe more through glibc, I get the following error:

ld:/usr/obj/portage/crossdevbuild/glibc-2.3.2/buildhere/shlib.lds:220: syntax error

Line #220 of shlib.lds reads the following:
ld: cannot open crti.o: No such file or directory


Hmm. Other people have occasionally run into problems like this, see http://www.x86-64.org/lists/discuss/msg03853.html
http://mail.gnu.org/archive/html/bug-glibc/2003-07/msg00076.html


Paydirt! A fix was just posted on libc-alpha by Daniel Jacobowitz:

I've reported this a number of times.  James just hit it on m68k, too.
I thought I'd posted my latest patch for this but I can't find it now
in the archives so I guess I didn't.  Here it is:


2003-09-26 Daniel Jacobowitz <drow@mvista.com>

    * Makerules (shlib.lds): Make sure that ld doesn't try to link
    anything while generating the linker script.

--- glibc-2.3.2/Makerules.orig    2003-09-26 12:50:18.000000000 -0400
+++ glibc-2.3.2/Makerules    2003-09-26 12:50:46.000000000 -0400
@@ -479,6 +479,7 @@ ifeq (yes,$(elf))
 # not for shared objects
 $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
     $(LINK.o) -shared -Wl,-O1 \
+          -nostdlib -nostartfiles \
           $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS.so) \
           -Wl,--verbose 2>&1 | \
       sed > $@T \

Guess I'll add that to the next release of crosstool, though
I'm mystified as to when it would help, since I've never run
into the error myself (I think... actually, I do use sed to
clean out some linker scripts, maybe this'll get rid of the need for sed...)
- Dan




Interesting to know, I'll have to try this. I got around my issue finally by setting --disable-shared --enable-static on glibc, and using a sed command to hack the Makeconfig file to strip -lgcc_eh out (since the bootstrap gcc compiler only creates libgcc.a and not libgcc_eh.a). Maybe thiss will allow me to try that glibc install-headers trick your cross-tool script does that I was unsuccessful in emulating. Getting that to work may allow me to try a proper sparc-i686 cross-compile.


--Kumba


--
"Such is oft the course of deeds that move the wheels of the world: small hands do them because they must, while the eyes of the great are elsewhere." --Elrond



------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]