diff options
author | Paul Pluzhnikov <ppluzhnikov@google.com> | 2009-04-30 17:19:24 -0700 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2009-05-01 00:19:24 +0000 |
commit | cd5336897ef7e5c7ec137838308ccdcac458b8c3 (patch) | |
tree | bc6a0299750d5af207ceb8cfc2dd5ed3e2f0d9dc /gcc/gcc.c | |
parent | 76547252330a60b9a97c1afa84effc701a0ec6db (diff) | |
download | gcc-cd5336897ef7e5c7ec137838308ccdcac458b8c3.zip gcc-cd5336897ef7e5c7ec137838308ccdcac458b8c3.tar.gz gcc-cd5336897ef7e5c7ec137838308ccdcac458b8c3.tar.bz2 |
configure.ac (HAVE_LD_BUILDID): New check for ld --build-id support.
* configure.ac (HAVE_LD_BUILDID): New check for ld --build-id
support.
(ENABLE_LD_BUILDID): New configuration option.
* gcc.c [HAVE_LD_BUILDID and ENABLE_LD_BUILDID]
(LINK_BUILDID_SPEC): New macro.
(init_spec): If defined, prepend it between LINK_EH_SPEC and
link_spec.
* doc/install.texi: Document --enable-linker-build-id option.
* configure: Rebuild.
* config.in: Rebuild.
Co-Authored-By: Roland McGrath <roland@redhat.com>
From-SVN: r147029
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -730,6 +730,13 @@ 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. */ @@ -1844,9 +1851,16 @@ 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 |