This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
3.4 PATCH: Fully support GNU linker in libtool on IRIX 5/6
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 6 Aug 2003 21:27:40 +0200 (MEST)
- Subject: 3.4 PATCH: Fully support GNU linker in libtool on IRIX 5/6
I recently tried to bootstrap mainline on IRIX 6.5 with GNU as and ld
2.14.90 (i.e. binutils mainline). The compiler bootstrapped ok, but
building libstdc++ originally failed:
xgcc: libstdc++.so.7: No such file or directory
xgcc: sgi7.0: No such file or directory
xgcc: unrecognized option `-soname'
xgcc: unrecognized option `-set_version'
make[4]: *** [libstdc++.la] Error 1
This error happened for a couple of reasons: the gcc and g++ drivers don't
recognize the -soname and -set_version options, unlike SGI's cc. They need
to be prefixed with -Wl, to work. Even after that change, GNU ld doesn't
recognize -set_version or -update_registry.
The following patch (created with -b so the indentation differences don't
obscure the proper content) fixes this and allowed a bootstrap to finish.
Testsuite results are still terrible, though: many tests (primarily c++ and
objc) time out or abort in __deregister_frame_info_bases. I'll have to
investigate what's going on there (but with a low priority; I was just
trying to find out if/how well GNU ld works for the N32 and N64 ABIs before
trying to determine why it cannot link shared libraries for O32).
Ok for mainline?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Wed Aug 6 21:22:43 2003 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* ltcf-c.sh (irix5*, irix6*): Handle GNU ld: prefix -soname and
its arg with ${wl}, omit -set_version, -update_registry.
* ltcf-gcj.sh (irix5*, irix6*): Likewise.
* ltcf-cxx.sh (irix5*, irix6*): Prefix -soname and its arg with
${wl}, omit -set_version with GNU ld.
Index: ltcf-c.sh
===================================================================
RCS file: /cvs/gcc/gcc/ltcf-c.sh,v
retrieving revision 1.18
diff -u -p -b -r1.18 ltcf-c.sh
--- ltcf-c.sh 16 Dec 2002 18:18:42 -0000 1.18
+++ ltcf-c.sh 6 Aug 2003 19:15:57 -0000
@@ -447,7 +447,11 @@ else
irix5* | irix6*)
if test "$with_gcc" = yes; then
+ if test "$with_gnu_ld" = no; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ fi
else
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
fi
Index: ltcf-cxx.sh
===================================================================
RCS file: /cvs/gcc/gcc/ltcf-cxx.sh,v
retrieving revision 1.25
diff -u -p -b -r1.25 ltcf-cxx.sh
--- ltcf-cxx.sh 20 Feb 2003 01:11:51 -0000 1.25
+++ ltcf-cxx.sh 6 Aug 2003 19:15:57 -0000
@@ -326,7 +326,7 @@ case $host_os in
if test "$with_gnu_ld" = no; then
archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
else
- archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
+ archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
fi
fi
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
Index: ltcf-gcj.sh
===================================================================
RCS file: /cvs/gcc/gcc/ltcf-gcj.sh,v
retrieving revision 1.12
diff -u -p -b -r1.12 ltcf-gcj.sh
--- ltcf-gcj.sh 19 Feb 2003 23:50:23 -0000 1.12
+++ ltcf-gcj.sh 6 Aug 2003 19:15:57 -0000
@@ -424,7 +424,11 @@ else
irix5* | irix6*)
if test "$with_gcc" = yes; then
+ if test "$with_gnu_ld" = no; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ fi
else
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
fi