[PATCH] --enable-linker-build-id by default

Roland McGrath roland@redhat.com
Tue Oct 5 05:10:00 GMT 2010


It benefits all of us to have as many user binaries as possible built
with build IDs.  Any time a user has a binary or a core file and one
of us is asked to help figure out some problem, we can take advantage
of the possibilities to match up build IDs with known binaries.  Many
system builders for GNU/Linux are enabling them now, but there will
always be some system builders who don't know to do so, and people and
organizations that build their own compilers with mostly-default
configure settings, and we still wind up having to help these people.
There is nothing inherently specific to GNU/Linux about the benefits
of build IDs, so this applies to any other target just as well when
the target's linker supports it.

Let's make it the default for everyone who doesn't ask especially not
to have it at configure time, when the configure-time linker supports it.

Some unusual programs (usually those with custom linker scripts) might
have problems with the build ID note, but the common examples of those
in free software have been fixed already.  Any system builder or
anyone else concerned with compatibility for those situations can
always use --disable-linker-build-id (or -Wl,--build-id=none in a
particular compilation).

I've tested that 'make bootstrap; make check' has no regressions from
this change, but I only tested on x86-64 on a GNU/Linux system where
the system's compiler already uses build IDs by default (Fedora 13).

(Remember, I'm not a GCC committer, so someone approving this will
have to commit it for me too.)


Thanks,
Roland


2010-10-04  Roland McGrath  <roland@redhat.com>

	* configure.ac (--enable-linker-build-id): Default to yes if
	the linker supports it.
	* configure: Regenerated.
	* doc/install.texi (Configuration): Document new default.

diff --git a/gcc/configure b/gcc/configure
index e2c0a13..dc3601f 100755  
--- a/gcc/configure
+++ b/gcc/configure
@@ -25104,7 +25104,7 @@ fi
 if test "${enable_linker_build_id+set}" = set; then :
   enableval=$enable_linker_build_id;
 else
-  enable_linker_build_id=no
+  enable_linker_build_id=$gcc_cv_ld_buildid
 fi
 
 
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 14690d3..dfcac06 100644  
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4115,7 +4115,7 @@ AC_ARG_ENABLE(linker-build-id,
 [  --enable-linker-build-id
                           compiler will always pass --build-id to linker],
 [],
-enable_linker_build_id=no)
+[enable_linker_build_id=$gcc_cv_ld_buildid])
 
 if test x"$enable_linker_build_id" = xyes; then
   if test x"$gcc_cv_ld_buildid" = xyes; then
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index ce6b5cf..ab5bf3b 100644  
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1635,12 +1635,14 @@ building runtime libraries.  @samp{@var{
 list of maps of the form @samp{@var{old}=@var{new}}.
 
 @item --enable-linker-build-id
-Tells GCC to pass @option{--build-id} option to the linker for all final
+@itemx --disable-linker-build-id
+Tells GCC to pass the @option{--build-id} option to the linker for all final
 links (links performed without the @option{-r} or @option{--relocatable}
 option), if the linker supports it.  If you specify
 @option{--enable-linker-build-id}, but your linker does not
-support @option{--build-id} option, a warning is issued and the
-@option{--enable-linker-build-id} option is ignored.  The default is off.
+support the @option{--build-id} option, a warning is issued and the
+@option{--enable-linker-build-id} option is ignored.
+The default is on if the linker supports it.
 
 @item --enable-gnu-unique-object
 @itemx --disable-gnu-unique-object



More information about the Gcc-patches mailing list