This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch hjl/pr14995 created. glibc-2.21-181-g42dbd40


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr14995 has been created
        at  42dbd401c7c5c6498c5f67c1519ee4a2ffe867d9 (commit)

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=42dbd401c7c5c6498c5f67c1519ee4a2ffe867d9

commit 42dbd401c7c5c6498c5f67c1519ee4a2ffe867d9
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Mar 9 09:55:24 2015 -0700

    Use BFD linker to get linker script

diff --git a/Makerules b/Makerules
index c79915f..01590f7 100644
--- a/Makerules
+++ b/Makerules
@@ -524,11 +524,16 @@ shlib-lds-flags =
 else
 # binutils only position loadable notes into the first page for binaries,
 # not for shared objects
+ifeq (yes,$(enable-gold))
+# Use BFD linker to get linker script since gold doesn't have builtin
+# linker scripts.
+bfd-LDFLAGS = -fuse-ld=bfd
+endif
 $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
 	$(LINK.o) -shared -Wl,-O1 \
 		  -nostdlib -nostartfiles \
 		  $(sysdep-LDFLAGS) $(rtld-LDFLAGS) $(LDFLAGS.so) \
-		  -Wl,--verbose 2>&1 | \
+		  $(bfd-LDFLAGS) -Wl,--verbose 2>&1 | \
 	  sed > $@T \
 	      -e '/^=========/,/^=========/!d;/^=========/d' \
 	      $(if $(filter yes,$(have-hash-style)), \

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bc15500d3f2fa55fdbda16fc5f8c5043469a1426

commit bc15500d3f2fa55fdbda16fc5f8c5043469a1426
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Mar 9 09:16:26 2015 -0700

    Add --enable-gold

diff --git a/Makeconfig b/Makeconfig
index 4e336a4..f81a178 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -368,6 +368,10 @@ ifndef static-start-installed-name
 static-start-installed-name = $(start-installed-name)
 endif
 
+ifeq (yes,$(enable-gold))
+sysdep-LDFLAGS += -fuse-ld=gold
+endif
+
 ifeq (yesyes,$(build-shared)$(have-z-combreloc))
 combreloc-LDFLAGS = -Wl,-z,combreloc
 LDFLAGS.so += $(combreloc-LDFLAGS)
diff --git a/config.make.in b/config.make.in
index ad4dd30..8f2edcb 100644
--- a/config.make.in
+++ b/config.make.in
@@ -94,6 +94,7 @@ use-nscd = @use_nscd@
 build-hardcoded-path-in-tests= @hardcoded_path_in_tests@
 build-pt-chown = @build_pt_chown@
 enable-lock-elision = @enable_lock_elision@
+enable-gold = @libc_cv_cc_use_gold@
 
 # Build tools.
 CC = @CC@
diff --git a/configure b/configure
index 71cc6bb..d1950a6 100755
--- a/configure
+++ b/configure
@@ -666,6 +666,7 @@ add_on_subdirs
 add_ons
 build_pt_chown
 build_nscd
+libc_cv_cc_use_gold
 link_obsolete_rpc
 libc_cv_nss_crypt
 enable_werror
@@ -773,6 +774,7 @@ enable_multi_arch
 enable_nss_crypt
 enable_obsolete_rpc
 enable_systemtap
+enable_gold
 enable_build_nscd
 enable_nscd
 enable_pt_chown
@@ -1437,6 +1439,7 @@ Optional Features:
   --enable-obsolete-rpc   build and install the obsolete RPC code for
                           link-time usage
   --enable-systemtap      enable systemtap static probe points [default=no]
+  --enable-gold           used gold to build glibc [default=no]
   --disable-build-nscd    disable building and installing the nscd daemon
   --disable-nscd          library functions will not contact the nscd daemon
   --enable-pt_chown       Enable building and installing pt_chown
@@ -3801,6 +3804,51 @@ See \`config.log' for more details" "$LINENO" 5; }
   fi
 fi
 
+# Check whether --enable-gold was given.
+if test "${enable_gold+set}" = set; then :
+  enableval=$enable_gold; enable_gold=$enableval
+else
+  enable_gold=no
+fi
+
+if test "x$enable_gold" = xyes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -fuse-ld=gold and -fuse-ld=bfd" >&5
+$as_echo_n "checking if $CC accepts -fuse-ld=gold and -fuse-ld=bfd... " >&6; }
+if ${libc_cv_cc_use_gold+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+    cat > conftest.c <<EOF
+int main (void) { return 0; }
+EOF
+  if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fuse-ld=gold -nostdlib -nostartfiles -o conftest conftest.c'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+  then
+    if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fuse-ld=bfd -nostdlib -nostartfiles -o conftest conftest.c'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+    then
+      libc_cv_cc_use_gold=yes
+    fi
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_use_gold" >&5
+$as_echo "$libc_cv_cc_use_gold" >&6; }
+  if test "x$libc_cv_cc_use_gold" != xyes; then
+    as_fn_error $? "${CC-cc} does not support -fuse-ld=gold -fuse-ld=bfd" "$LINENO" 5
+  fi
+else
+  libc_cv_cc_use_gold=no
+fi
+
+
 # Check whether --enable-build-nscd was given.
 if test "${enable_build_nscd+set}" = set; then :
   enableval=$enable_build_nscd; build_nscd=$enableval
diff --git a/configure.ac b/configure.ac
index 678c739..89b07b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -345,6 +345,35 @@ void foo (int i, void *p)
   fi
 fi
 
+dnl Enable gold build only if both -fuse-ld=gold and -fuse-ld=bfd work.
+dnl Need -fuse-ld=bfd to dump linker script to build shared libraries.
+AC_ARG_ENABLE(gold,
+              [AS_HELP_STRING([--enable-gold],
+	       [used gold to build glibc @<:@default=no@:>@])],
+              [enable_gold=$enableval],
+	      [enable_gold=no])
+if test "x$enable_gold" = xyes; then
+  AC_CACHE_CHECK(if $CC accepts -fuse-ld=gold and -fuse-ld=bfd,
+	         libc_cv_cc_use_gold, [dnl
+  cat > conftest.c <<EOF
+int main (void) { return 0; }
+EOF
+  if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -fuse-ld=gold -nostdlib -nostartfiles -o conftest conftest.c])
+  then
+    if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -fuse-ld=bfd -nostdlib -nostartfiles -o conftest conftest.c])
+    then
+      libc_cv_cc_use_gold=yes
+    fi
+  fi
+  rm -f conftest*])
+  if test "x$libc_cv_cc_use_gold" != xyes; then
+    AC_MSG_ERROR([${CC-cc} does not support -fuse-ld=gold -fuse-ld=bfd])
+  fi
+else
+  libc_cv_cc_use_gold=no
+fi
+AC_SUBST(libc_cv_cc_use_gold)
+
 AC_ARG_ENABLE([build-nscd],
 	      [AS_HELP_STRING([--disable-build-nscd],
 	       [disable building and installing the nscd daemon])],

-----------------------------------------------------------------------


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]