This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Don't pass -init, -fini with -r on IRIX 6
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 07 May 2010 14:39:24 +0200
- Subject: Don't pass -init, -fini with -r on IRIX 6
Several LTO test cases fail on IRIX 6:
PASS: gcc.dg/lto/20081120-1 c_lto_20081120-1_1.o assemble, -flto -r -nostdlib
Executing on host: /vol/gcc/obj/regression/trunk/6.5-gcc/build/gcc/xgcc -B/vol/gcc/obj/regression/trunk/6.5-gcc/build/gcc/ c_lto_20081120-1_0.o c_lto_20081120-1_1.o -flto -r -nostdlib -o gcc-dg-lto-20081120-1-01 (timeout = 300)
ld32: FATAL 52 : __gcc_init specified for -init is not defined in the current object.
collect2: ld returned 4 exit status
With -v, you see that ld is invoked like this:
/vol/gcc/obj/regression/trunk/6.5-gcc/build/gcc/collect-ld -init __gcc_init -fini __gcc_fini -_SYSTYPE_SVR4 -woff 131 -n32 -o gcc-dg-lto-20081120-1-01 -r -L/vol/gcc/obj/regression/trunk/6.5-gcc/build/gcc -L/lib/../lib32 -L/usr/lib/../lib32 c_lto_20081120-1_0.o c_lto_20081120-1_1.o
I.e. -init/-fini is passed, but irix-crti.o which defines __gcc_init and
__gcc_fini isn't liked. It obviously doesn't make sense to pass
-init/-fini with -r, so the following patch fixes this and allows the
tests to pass.
Installed on mainline and 4.5 branch.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2010-04-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config/mips/iris6.h (LINK_SPEC): Don't pass -init, -fini with -r.
diff -r 5c35c9a61757 gcc/config/mips/iris6.h
--- a/gcc/config/mips/iris6.h Fri Apr 09 19:44:31 2010 +0200
+++ b/gcc/config/mips/iris6.h Fri May 07 10:53:20 2010 +0200
@@ -276,7 +276,7 @@
%{call_shared} %{no_archive} %{exact_version} \
%{!shared: \
%{!non_shared: %{!call_shared:%{!r: -call_shared " IRIX_NO_UNRESOLVED "}}}} \
-%{rpath} -init __gcc_init -fini __gcc_fini " IRIX_SUBTARGET_LINK_SPEC
+%{rpath} %{!r: -init __gcc_init -fini __gcc_fini} " IRIX_SUBTARGET_LINK_SPEC
#ifdef IRIX_USING_GNU_LD
#define IRIX_SUBTARGET_LINK_SPEC \