This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Only define add_lto_object in collect2.c on ELF targets
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 5 Oct 2009 19:02:43 +0200 (MEST)
- Subject: PATCH: Only define add_lto_object in collect2.c on ELF targets
Current mainline (as of 20091005, rev 152443) fails to bootstrap on non-ELF
(and thus non-LTO) targets like Tru64 UNIX V5.1B:
cc1: warnings being treated as errors
/vol/gcc/src/gcc-dist/gcc/collect2.c:861:1: error: 'add_lto_object' defined but
not used
make[3]: *** [collect2.o] Error 1
The following trivial patch fixes this and allows bootstrap to continue.
Ok for mainline?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2009-10-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* collect2.c (add_lto_object): Only define if OBJECT_FORMAT_NONE.
Index: gcc/collect2.c
===================================================================
--- gcc/collect2.c (revision 152443)
+++ gcc/collect2.c (working copy)
@@ -853,6 +853,8 @@
free (nstore);
}
+#ifdef OBJECT_FORMAT_NONE
+
/* Add an entry for the object file NAME to object file list LIST.
New entries are added at the end of the list. The original pointer
value of NAME is preserved, i.e., no string copy is performed. */
@@ -871,6 +873,7 @@
list->last = n;
}
+#endif /* OBJECT_FORMAT_NONE */
/* Perform a link-time recompilation and relink if any of the object