Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(481)

Unified Diff: gcc/gcc.c

Issue 14859004: Backport GCC 4.5+ --enable-linker-build-id option. (Closed) Base URL: http://git.chromium.org/native_client/nacl-gcc.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcc/doc/install.texi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/gcc.c
diff --git a/gcc/gcc.c b/gcc/gcc.c
index ecb671f31b70d4a7b70892e490a66c7f246e9a73..6c7f47c2ba0fec2d76a85b573affdc00deb2ca57 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -717,6 +717,12 @@ proper position among the other output files. */
#endif
#endif
+#ifndef LINK_BUILDID_SPEC
+# if defined(HAVE_LD_BUILDID) && defined(ENABLE_LD_BUILDID)
+# define LINK_BUILDID_SPEC "%{!r:--build-id} "
+# endif
+#endif
+
/* -u* was put back because both BSD and SysV seem to support it. */
/* %{static:} simply prevents an error message if the target machine
doesn't handle -static. */
@@ -1832,9 +1838,15 @@ init_spec (void)
asm_spec = XOBFINISH (&obstack, const char *);
}
#endif
-#ifdef LINK_EH_SPEC
+#if defined LINK_EH_SPEC || defined LINK_BUILDID_SPEC
+# ifdef LINK_BUILDID_SPEC
+ /* Prepend LINK_BUILDID_SPEC to whatever link_spec we had before. */
+ obstack_grow (&obstack, LINK_BUILDID_SPEC, sizeof(LINK_BUILDID_SPEC) - 1);
+# endif
+# ifdef LINK_EH_SPEC
/* Prepend LINK_EH_SPEC to whatever link_spec we had before. */
obstack_grow (&obstack, LINK_EH_SPEC, sizeof(LINK_EH_SPEC) - 1);
+# endif
obstack_grow0 (&obstack, link_spec, strlen (link_spec));
link_spec = XOBFINISH (&obstack, const char *);
#endif
« no previous file with comments | « gcc/doc/install.texi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698