public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH: Build shared libraries with -Bsymbolic-functions
       [not found]                 ` <m3tzyzqaha.fsf@localhost.localdomain>
@ 2007-01-10 19:03                   ` H. J. Lu
  2007-01-10 22:49                     ` H. J. Lu
  2007-01-11  8:04                     ` Paolo Bonzini
  0 siblings, 2 replies; 24+ messages in thread
From: H. J. Lu @ 2007-01-10 19:03 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gcc, gcc-patches

On Wed, Jan 10, 2007 at 06:26:09AM -0700, Tom Tromey wrote:
> >>>>> "H.J." == H J Lu <hjl@lucon.org> writes:
> 
> H.J.> With the new linker switches, -Bsymbolic-functions and
> H.J.> --dynamic-list-cpp-new, we can improve shared library
> H.J.> performance in gcc. This change will build libstdc++.so with
> H.J.> -Bsymbolic-functions and --dynamic-list-cpp-new. I can expand it
> H.J.> to other libraries.
> 
> I prefer to see semi-generic helper code like this in a new .m4 file
> in config.  That makes it somewhat simpler for other target libraries
> to reuse it.
> 

Here it is. If it is OK, I will extend it to Java and Fortran.


H.J.
---
config/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* lib-ld.m4 (AC_LIB_PROG_LD_GNU_SYMBOLIC): New.
	(AC_LIB_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW): Likewise.

libstdc++-v3/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* aclocal.m4: Include ../config/lib-ld.m4.
	* configure.ac: Use AC_LIB_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW.
	* configure: Regenerated.
	* Makefile.in: Likewise.

	* src/Makefile.am (CXXLINK): Add $(DYNAMIC_LIST_CPP_NEW_LDFLAGS).
	* src/Makefile.in: Regenerated.

--- gcc/config/lib-ld.m4.symbolic	2005-11-01 13:56:29.000000000 -0800
+++ gcc/config/lib-ld.m4	2007-01-10 10:49:49.000000000 -0800
@@ -108,3 +108,43 @@ fi
 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 AC_LIB_PROG_LD_GNU
 ])
+
+dnl Substitute SYMBOLIC_LDFLAGS with -Bsymbolic-functions for GNU linker
+dnl if it is supported.
+AC_DEFUN([AC_LIB_PROG_LD_GNU_SYMBOLIC],
+[AC_CACHE_CHECK([if the GNU linker ($LD) supports -Bsymbolic-functions],
+acl_cv_prog_gnu_ld_symbolic, [
+acl_cv_prog_gnu_ld_symbolic=no
+if test x"$with_gnu_ld" = x"yes"; then
+  if $LD --help 2>&1 </dev/null | grep Bsymbolic-functions 1>&5; then
+    acl_cv_prog_gnu_ld_symbolic=yes
+  fi
+fi])
+if test x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then
+  SYMBOLIC_LDFLAGS="-Wl,-Bsymbolic-functions"
+else
+  SYMBOLIC_LDFLAGS=''
+fi
+AC_SUBST(SYMBOLIC_LDFLAGS)
+])
+
+dnl Substitute DYNAMIC_LIST_CPP_NEW_LDFLAGS with --dynamic-list-cpp-new
+dnl for GNU linker if it is supported.
+AC_DEFUN([AC_LIB_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW],
+[AC_CACHE_CHECK([if the GNU linker ($LD) supports --dynamic-list-cpp-new],
+acl_cv_prog_gnu_ld_dynamic_list_cpp_new, [
+acl_cv_prog_gnu_ld_dynamic_list_cpp_new=no
+if test x"$with_gnu_ld" = x"yes"; then
+  if $LD --help 2>&1 </dev/null | grep dynamic-list-cpp-new 1>&5; then
+    acl_cv_prog_gnu_ld_dynamic_list_cpp_new=yes
+  fi
+fi])
+AC_LIB_PROG_LD_GNU_SYMBOLIC
+if test x"$acl_cv_prog_gnu_ld_symbolic" = x"yes" -a \
+	x"$acl_cv_prog_gnu_ld_dynamic_list_cpp_new" = x"yes"; then
+   DYNAMIC_LIST_CPP_NEW_LDFLAGS="$SYMBOLIC_LDFLAGS -Wl,--dynamic-list-cpp-new"
+else
+   DYNAMIC_LIST_CPP_NEW_LDFLAGS=''
+fi
+AC_SUBST(DYNAMIC_LIST_CPP_NEW_LDFLAGS)
+])
--- gcc/libstdc++-v3/Makefile.in.symbolic	2006-10-17 07:33:04.000000000 -0700
+++ gcc/libstdc++-v3/Makefile.in	2007-01-10 10:33:04.000000000 -0800
@@ -50,9 +50,10 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
-	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
-	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
-	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/../config/lib-ld.m4 $(top_srcdir)/../libtool.m4 \
+	$(top_srcdir)/crossconfig.m4 $(top_srcdir)/linkage.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/tls.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -129,6 +130,7 @@ CYGPATH_W = @CYGPATH_W@
 C_INCLUDE_DIR = @C_INCLUDE_DIR@
 DEBUG_FLAGS = @DEBUG_FLAGS@
 DEFS = @DEFS@
+DYNAMIC_LIST_CPP_NEW_LDFLAGS = @DYNAMIC_LIST_CPP_NEW_LDFLAGS@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
@@ -193,6 +195,7 @@ SECTION_LDFLAGS = @SECTION_LDFLAGS@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+SYMBOLIC_LDFLAGS = @SYMBOLIC_LDFLAGS@
 SYMVER_FILE = @SYMVER_FILE@
 TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
 USE_NLS = @USE_NLS@
--- gcc/libstdc++-v3/aclocal.m4.symbolic	2006-10-17 07:33:04.000000000 -0700
+++ gcc/libstdc++-v3/aclocal.m4	2007-01-10 10:19:35.000000000 -0800
@@ -585,6 +585,7 @@ m4_include([../config/lead-dot.m4])
 m4_include([../config/multi.m4])
 m4_include([../config/no-executables.m4])
 m4_include([../config/unwind_ipinfo.m4])
+m4_include([../config/lib-ld.m4])
 m4_include([../libtool.m4])
 m4_include([crossconfig.m4])
 m4_include([linkage.m4])
--- gcc/libstdc++-v3/configure.ac.symbolic	2006-11-16 09:57:24.000000000 -0800
+++ gcc/libstdc++-v3/configure.ac	2007-01-10 10:20:44.000000000 -0800
@@ -403,5 +403,7 @@ _EOF
 SUBDIRS="$SUBDIRS"
 ])
 
+AC_LIB_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW
+
 dnl And this actually makes things happen:
 AC_OUTPUT
--- gcc/libstdc++-v3/src/Makefile.am.symbolic	2006-07-30 22:39:24.000000000 -0700
+++ gcc/libstdc++-v3/src/Makefile.am	2007-01-10 10:31:21.000000000 -0800
@@ -254,7 +254,9 @@ LTLDFLAGS = $(shell $(SHELL) $(top_srcdi
 # directory to configure libstdc++-v3 to use gcc as the C++
 # compilation driver.
 CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
-	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
+	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) \
+	  $(DYNAMIC_LIST_CPP_NEW_LDFLAGS) \
+	  $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
 
 
 # Added bits to build debug library.
--- gcc/libstdc++-v3/src/Makefile.in.symbolic	2006-10-17 07:32:51.000000000 -0700
+++ gcc/libstdc++-v3/src/Makefile.in	2007-01-10 10:34:10.000000000 -0800
@@ -45,9 +45,10 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
-	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
-	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
-	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/../config/lib-ld.m4 $(top_srcdir)/../libtool.m4 \
+	$(top_srcdir)/crossconfig.m4 $(top_srcdir)/linkage.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/tls.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 CONFIG_HEADER = $(top_builddir)/config.h
@@ -147,6 +148,7 @@ CYGPATH_W = @CYGPATH_W@
 C_INCLUDE_DIR = @C_INCLUDE_DIR@
 DEBUG_FLAGS = @DEBUG_FLAGS@
 DEFS = @DEFS@
+DYNAMIC_LIST_CPP_NEW_LDFLAGS = @DYNAMIC_LIST_CPP_NEW_LDFLAGS@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
@@ -211,6 +213,7 @@ SECTION_LDFLAGS = @SECTION_LDFLAGS@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+SYMBOLIC_LDFLAGS = @SYMBOLIC_LDFLAGS@
 SYMVER_FILE = @SYMVER_FILE@
 TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
 USE_NLS = @USE_NLS@
@@ -437,7 +440,9 @@ LTLDFLAGS = $(shell $(SHELL) $(top_srcdi
 # directory to configure libstdc++-v3 to use gcc as the C++
 # compilation driver.
 CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
-	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
+	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) \
+	  $(DYNAMIC_LIST_CPP_NEW_LDFLAGS) \
+	  $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
 
 debugdir = debug
 all: all-am

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-10 19:03                   ` PATCH: Build shared libraries with -Bsymbolic-functions H. J. Lu
@ 2007-01-10 22:49                     ` H. J. Lu
  2007-01-11  8:04                     ` Paolo Bonzini
  1 sibling, 0 replies; 24+ messages in thread
From: H. J. Lu @ 2007-01-10 22:49 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gcc-patches

On Wed, Jan 10, 2007 at 11:03:38AM -0800, H. J. Lu wrote:
> On Wed, Jan 10, 2007 at 06:26:09AM -0700, Tom Tromey wrote:
> > >>>>> "H.J." == H J Lu <hjl@lucon.org> writes:
> > 
> > H.J.> With the new linker switches, -Bsymbolic-functions and
> > H.J.> --dynamic-list-cpp-new, we can improve shared library
> > H.J.> performance in gcc. This change will build libstdc++.so with
> > H.J.> -Bsymbolic-functions and --dynamic-list-cpp-new. I can expand it
> > H.J.> to other libraries.
> > 
> > I prefer to see semi-generic helper code like this in a new .m4 file
> > in config.  That makes it somewhat simpler for other target libraries
> > to reuse it.
> > 
> 
> Here it is. If it is OK, I will extend it to Java and Fortran.
> 
> 

I updated the patch to include Java, Fortran, C++ and ObjC. Since
libjava may use -Bsymbolic, I didn't change it to -Bsymbolic-fuctions
if -Bsymbolic is used already.


H.J.
---
config/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* lib-ld.m4 (AC_LIB_PROG_LD_GNU_SYMBOLIC): New.
	(AC_LIB_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW): Likewise.

libgfortran/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* aclocal.m4: Include ../config/lib-ld.m4.
	* configure.ac: Use AC_LIB_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libgfortran to $SYMBOLIC_LDFLAGS if it isn't set.
	* configure: Regenerated.

libgomp/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (AM_LDFLAGS): Add $(SYMBOLIC_LDFLAGS).
	* Makefile.in: Regenerated.

	* aclocal.m4: Include ../config/lib-ld.m4.

	* configure.ac: Use AC_LIB_PROG_LD_GNU_SYMBOLIC.
	* configure: Regenerated.

libjava/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use AC_LIB_PROG_LD_GNU_SYMBOLIC.  Set
	libgcj_ld_symbolic to $SYMBOLIC_LDFLAGS if it isn't set.
	* configure: Regenerated.

libobjc/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* aclocal.m4: Include ../config/lib-ld.m4.
	* configure.ac: Use AC_LIB_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libobjc to $SYMBOLIC_LDFLAGS if it isn't set.
	* configure: Regenerated.

libstdc++-v3/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* aclocal.m4: Include ../config/lib-ld.m4.
	* configure.ac: Use AC_LIB_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW.
	* configure: Regenerated.
	* Makefile.in: Likewise.

	* src/Makefile.am (CXXLINK): Add $(DYNAMIC_LIST_CPP_NEW_LDFLAGS).
	* src/Makefile.in: Regenerated.

--- gcc/config/lib-ld.m4.symbolic	2006-11-18 06:27:26.000000000 -0800
+++ gcc/config/lib-ld.m4	2007-01-10 13:27:52.000000000 -0800
@@ -108,3 +108,44 @@ fi
 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 AC_LIB_PROG_LD_GNU
 ])
+
+dnl Substitute SYMBOLIC_LDFLAGS with -Bsymbolic-functions for GNU linker
+dnl if it is supported.
+AC_DEFUN([AC_LIB_PROG_LD_GNU_SYMBOLIC],
+[AC_CACHE_CHECK([if the GNU linker ($LD) supports -Bsymbolic-functions],
+acl_cv_prog_gnu_ld_symbolic, [
+acl_cv_prog_gnu_ld_symbolic=no
+AC_LIB_PROG_LD_GNU
+if test x"$with_gnu_ld" = x"yes"; then
+  if $LD --help 2>&1 </dev/null | grep Bsymbolic-functions 1>&5; then
+    acl_cv_prog_gnu_ld_symbolic=yes
+  fi
+fi])
+if test x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then
+  SYMBOLIC_LDFLAGS="-Wl,-Bsymbolic-functions"
+else
+  SYMBOLIC_LDFLAGS=''
+fi
+AC_SUBST(SYMBOLIC_LDFLAGS)
+])
+
+dnl Substitute DYNAMIC_LIST_CPP_NEW_LDFLAGS with --dynamic-list-cpp-new
+dnl for GNU linker if it is supported.
+AC_DEFUN([AC_LIB_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW],
+[AC_CACHE_CHECK([if the GNU linker ($LD) supports --dynamic-list-cpp-new],
+acl_cv_prog_gnu_ld_dynamic_list_cpp_new, [
+acl_cv_prog_gnu_ld_dynamic_list_cpp_new=no
+AC_LIB_PROG_LD_GNU_SYMBOLIC
+if test x"$with_gnu_ld" = x"yes" -a \
+	x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then
+  if $LD --help 2>&1 </dev/null | grep dynamic-list-cpp-new 1>&5; then
+    acl_cv_prog_gnu_ld_dynamic_list_cpp_new=yes
+  fi
+fi])
+if test x"$acl_cv_prog_gnu_ld_dynamic_list_cpp_new" = x"yes"; then
+   DYNAMIC_LIST_CPP_NEW_LDFLAGS="$SYMBOLIC_LDFLAGS -Wl,--dynamic-list-cpp-new"
+else
+   DYNAMIC_LIST_CPP_NEW_LDFLAGS=''
+fi
+AC_SUBST(DYNAMIC_LIST_CPP_NEW_LDFLAGS)
+])
--- gcc/libgfortran/aclocal.m4.symbolic	2006-12-14 09:02:44.000000000 -0800
+++ gcc/libgfortran/aclocal.m4	2007-01-10 13:27:52.000000000 -0800
@@ -583,4 +583,5 @@ AC_SUBST([am__untar])
 m4_include([../config/lead-dot.m4])
 m4_include([../config/multi.m4])
 m4_include([../config/stdint.m4])
+m4_include([../config/lib-ld.m4])
 m4_include([acinclude.m4])
--- gcc/libgfortran/configure.ac.symbolic	2006-12-07 17:07:06.000000000 -0800
+++ gcc/libgfortran/configure.ac	2007-01-10 13:27:52.000000000 -0800
@@ -143,12 +143,17 @@ AC_SUBST(enable_static)
 FC="$GFORTRAN"
 AC_PROG_FC(gfortran)
 
+AC_LIB_PROG_LD_GNU_SYMBOLIC
+
 # extra LD Flags which are required for targets
 case "${host}" in
   *-darwin*)
     # Darwin needs -single_module when linking libgfortran
     extra_ldflags_libgfortran=-Wl,-single_module
     ;;
+  *)
+    extra_ldflags_libgfortran=$SYMBOLIC_LDFLAGS
+    ;;
 esac
 AC_SUBST(extra_ldflags_libgfortran)
 
--- gcc/libgomp/Makefile.am.symbolic	2006-12-26 09:04:53.000000000 -0800
+++ gcc/libgomp/Makefile.am	2007-01-10 13:27:52.000000000 -0800
@@ -18,7 +18,8 @@ VPATH = $(subst $(space),:,$(strip $(sea
 
 AM_CPPFLAGS = $(addprefix -I, $(search_path))
 AM_CFLAGS = $(XCFLAGS)
-AM_LDFLAGS = $(XLDFLAGS) $(SECTION_LDFLAGS) $(OPT_LDFLAGS)
+AM_LDFLAGS = $(XLDFLAGS) $(SECTION_LDFLAGS) $(OPT_LDFLAGS) \
+	     $(SYMBOLIC_LDFLAGS)
 
 toolexeclib_LTLIBRARIES = libgomp.la
 nodist_toolexeclib_HEADERS = libgomp.spec
--- gcc/libgomp/Makefile.in.symbolic	2006-12-26 09:05:17.000000000 -0800
+++ gcc/libgomp/Makefile.in	2007-01-10 13:27:52.000000000 -0800
@@ -53,7 +53,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/lead-dot.m4 \
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/stdint.m4 \
-	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/../config/tls.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -163,7 +164,6 @@ FC = @FC@
 FCFLAGS = @FCFLAGS@
 GENINSRC_FALSE = @GENINSRC_FALSE@
 GENINSRC_TRUE = @GENINSRC_TRUE@
-GREP = @GREP@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -201,13 +201,17 @@ SECTION_LDFLAGS = @SECTION_LDFLAGS@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+SYMBOLIC_LDFLAGS = @SYMBOLIC_LDFLAGS@
 USE_FORTRAN_FALSE = @USE_FORTRAN_FALSE@
 USE_FORTRAN_TRUE = @USE_FORTRAN_TRUE@
 VERSION = @VERSION@
 XCFLAGS = @XCFLAGS@
 XLDFLAGS = @XLDFLAGS@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__include = @am__include@
@@ -223,9 +227,6 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 config_path = @config_path@
 datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
 enable_shared = @enable_shared@
 enable_static = @enable_static@
 exec_prefix = @exec_prefix@
@@ -234,7 +235,6 @@ host_alias = @host_alias@
 host_cpu = @host_cpu@
 host_os = @host_os@
 host_vendor = @host_vendor@
-htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
@@ -242,16 +242,13 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 libtool_VERSION = @libtool_VERSION@
 link_gomp = @link_gomp@
-localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 multi_basedir = @multi_basedir@
 oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
-psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
@@ -272,7 +269,9 @@ empty = 
 space = $(empty) $(empty)
 AM_CPPFLAGS = $(addprefix -I, $(search_path))
 AM_CFLAGS = $(XCFLAGS)
-AM_LDFLAGS = $(XLDFLAGS) $(SECTION_LDFLAGS) $(OPT_LDFLAGS)
+AM_LDFLAGS = $(XLDFLAGS) $(SECTION_LDFLAGS) $(OPT_LDFLAGS) \
+	     $(SYMBOLIC_LDFLAGS)
+
 toolexeclib_LTLIBRARIES = libgomp.la
 nodist_toolexeclib_HEADERS = libgomp.spec
 @LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE@libgomp_version_script = 
--- gcc/libgomp/aclocal.m4.symbolic	2006-12-26 09:05:17.000000000 -0800
+++ gcc/libgomp/aclocal.m4	2007-01-10 13:27:52.000000000 -0800
@@ -862,4 +862,5 @@ m4_include([../config/lead-dot.m4])
 m4_include([../config/multi.m4])
 m4_include([../config/stdint.m4])
 m4_include([../config/tls.m4])
+m4_include([../config/lib-ld.m4])
 m4_include([acinclude.m4])
--- gcc/libgomp/configure.ac.symbolic	2006-12-26 09:04:53.000000000 -0800
+++ gcc/libgomp/configure.ac	2007-01-10 13:27:52.000000000 -0800
@@ -331,6 +331,8 @@ AC_SUBST(OMP_LOCK_KIND)
 AC_SUBST(OMP_NEST_LOCK_KIND)
 CFLAGS="$save_CFLAGS"
 
+AC_LIB_PROG_LD_GNU_SYMBOLIC
+
 AC_CONFIG_FILES(omp.h omp_lib.h omp_lib.f90 libgomp_f.h)
 AC_CONFIG_FILES(Makefile testsuite/Makefile libgomp.spec)
 AC_OUTPUT
--- gcc/libjava/configure.ac.symbolic	2007-01-09 16:20:44.000000000 -0800
+++ gcc/libjava/configure.ac	2007-01-10 13:31:30.000000000 -0800
@@ -173,6 +173,11 @@ libgcj_javaflags=
 
 . ${srcdir}/configure.host
 
+if test -z "$libgcj_ld_symbolic"; then
+  AC_LIB_PROG_LD_GNU_SYMBOLIC
+  libgcj_ld_symbolic=$SYMBOLIC_LDFLAGS
+fi
+
 LIBGCJ_CFLAGS="${libgcj_cflags}"
 LIBGCJ_CXXFLAGS="${libgcj_cxxflags}"
 LIBGCJ_JAVAFLAGS="${libgcj_javaflags}"
--- gcc/libobjc/aclocal.m4.symbolic	2006-11-18 06:27:04.000000000 -0800
+++ gcc/libobjc/aclocal.m4	2007-01-10 13:27:52.000000000 -0800
@@ -155,4 +155,5 @@ fi
 ])
 
 m4_include([../config/multi.m4])
+m4_include([../config/lib-ld.m4])
 m4_include([acinclude.m4])
--- gcc/libobjc/configure.ac.symbolic	2006-11-18 06:27:04.000000000 -0800
+++ gcc/libobjc/configure.ac	2007-01-10 13:27:52.000000000 -0800
@@ -156,12 +156,17 @@ m4_define([_AC_ARG_VAR_PRECIOUS],[])
 AC_PROG_CC
 m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
+AC_LIB_PROG_LD_GNU_SYMBOLIC
+
 # extra LD Flags which are required for targets
 case "${host}" in
   *-darwin*)
     # Darwin needs -single_module when linking libobjc
     extra_ldflags_libobjc=-Wl,-single_module
     ;;
+  *)
+    extra_ldflags_libobjc=$SYMBOLIC_LDFLAGS
+    ;;
 esac
 AC_SUBST(extra_ldflags_libobjc)
 
--- gcc/libstdc++-v3/Makefile.in.symbolic	2006-11-18 06:27:00.000000000 -0800
+++ gcc/libstdc++-v3/Makefile.in	2007-01-10 13:27:52.000000000 -0800
@@ -50,9 +50,10 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
-	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
-	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
-	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/../config/lib-ld.m4 $(top_srcdir)/../libtool.m4 \
+	$(top_srcdir)/crossconfig.m4 $(top_srcdir)/linkage.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/tls.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -129,6 +130,7 @@ CYGPATH_W = @CYGPATH_W@
 C_INCLUDE_DIR = @C_INCLUDE_DIR@
 DEBUG_FLAGS = @DEBUG_FLAGS@
 DEFS = @DEFS@
+DYNAMIC_LIST_CPP_NEW_LDFLAGS = @DYNAMIC_LIST_CPP_NEW_LDFLAGS@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
@@ -193,6 +195,7 @@ SECTION_LDFLAGS = @SECTION_LDFLAGS@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+SYMBOLIC_LDFLAGS = @SYMBOLIC_LDFLAGS@
 SYMVER_FILE = @SYMVER_FILE@
 TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
 USE_NLS = @USE_NLS@
--- gcc/libstdc++-v3/aclocal.m4.symbolic	2006-11-18 06:27:00.000000000 -0800
+++ gcc/libstdc++-v3/aclocal.m4	2007-01-10 13:27:52.000000000 -0800
@@ -585,6 +585,7 @@ m4_include([../config/lead-dot.m4])
 m4_include([../config/multi.m4])
 m4_include([../config/no-executables.m4])
 m4_include([../config/unwind_ipinfo.m4])
+m4_include([../config/lib-ld.m4])
 m4_include([../libtool.m4])
 m4_include([crossconfig.m4])
 m4_include([linkage.m4])
--- gcc/libstdc++-v3/configure.ac.symbolic	2006-11-18 06:27:00.000000000 -0800
+++ gcc/libstdc++-v3/configure.ac	2007-01-10 13:27:52.000000000 -0800
@@ -403,5 +403,7 @@ _EOF
 SUBDIRS="$SUBDIRS"
 ])
 
+AC_LIB_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW
+
 dnl And this actually makes things happen:
 AC_OUTPUT
--- gcc/libstdc++-v3/src/Makefile.am.symbolic	2006-11-18 06:26:36.000000000 -0800
+++ gcc/libstdc++-v3/src/Makefile.am	2007-01-10 13:27:52.000000000 -0800
@@ -254,7 +254,9 @@ LTLDFLAGS = $(shell $(SHELL) $(top_srcdi
 # directory to configure libstdc++-v3 to use gcc as the C++
 # compilation driver.
 CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
-	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
+	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) \
+	  $(DYNAMIC_LIST_CPP_NEW_LDFLAGS) \
+	  $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
 
 
 # Added bits to build debug library.
--- gcc/libstdc++-v3/src/Makefile.in.symbolic	2006-11-18 06:26:36.000000000 -0800
+++ gcc/libstdc++-v3/src/Makefile.in	2007-01-10 13:27:52.000000000 -0800
@@ -45,9 +45,10 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
-	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
-	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
-	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/../config/lib-ld.m4 $(top_srcdir)/../libtool.m4 \
+	$(top_srcdir)/crossconfig.m4 $(top_srcdir)/linkage.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/tls.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 CONFIG_HEADER = $(top_builddir)/config.h
@@ -147,6 +148,7 @@ CYGPATH_W = @CYGPATH_W@
 C_INCLUDE_DIR = @C_INCLUDE_DIR@
 DEBUG_FLAGS = @DEBUG_FLAGS@
 DEFS = @DEFS@
+DYNAMIC_LIST_CPP_NEW_LDFLAGS = @DYNAMIC_LIST_CPP_NEW_LDFLAGS@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
@@ -211,6 +213,7 @@ SECTION_LDFLAGS = @SECTION_LDFLAGS@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+SYMBOLIC_LDFLAGS = @SYMBOLIC_LDFLAGS@
 SYMVER_FILE = @SYMVER_FILE@
 TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
 USE_NLS = @USE_NLS@
@@ -437,7 +440,9 @@ LTLDFLAGS = $(shell $(SHELL) $(top_srcdi
 # directory to configure libstdc++-v3 to use gcc as the C++
 # compilation driver.
 CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
-	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
+	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) \
+	  $(DYNAMIC_LIST_CPP_NEW_LDFLAGS) \
+	  $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
 
 debugdir = debug
 all: all-am

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-10 19:03                   ` PATCH: Build shared libraries with -Bsymbolic-functions H. J. Lu
  2007-01-10 22:49                     ` H. J. Lu
@ 2007-01-11  8:04                     ` Paolo Bonzini
  2007-01-11 18:15                       ` H. J. Lu
  1 sibling, 1 reply; 24+ messages in thread
From: Paolo Bonzini @ 2007-01-11  8:04 UTC (permalink / raw)
  To: H. J. Lu; +Cc: gcc, gcc-patches

H. J. Lu wrote:
> On Wed, Jan 10, 2007 at 06:26:09AM -0700, Tom Tromey wrote:
>>>>>>> "H.J." == H J Lu <hjl@lucon.org> writes:
>> H.J.> With the new linker switches, -Bsymbolic-functions and
>> H.J.> --dynamic-list-cpp-new, we can improve shared library
>> H.J.> performance in gcc. This change will build libstdc++.so with
>> H.J.> -Bsymbolic-functions and --dynamic-list-cpp-new. I can expand it
>> H.J.> to other libraries.
>>
>> I prefer to see semi-generic helper code like this in a new .m4 file
>> in config.  That makes it somewhat simpler for other target libraries
>> to reuse it.
>>
> 
> Here it is. If it is OK, I will extend it to Java and Fortran.

If the libstdc++ bits are ok, the config bits are ok but please put them 
in a new file.  lib-ld.m4 is imported from gettext.  (And commit the 
config part to both gcc and src).

Paolo

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-11  8:04                     ` Paolo Bonzini
@ 2007-01-11 18:15                       ` H. J. Lu
  2007-01-11 18:33                         ` Paolo Bonzini
  0 siblings, 1 reply; 24+ messages in thread
From: H. J. Lu @ 2007-01-11 18:15 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: gcc, gcc-patches

On Thu, Jan 11, 2007 at 09:03:42AM +0100, Paolo Bonzini wrote:
> H. J. Lu wrote:
> >On Wed, Jan 10, 2007 at 06:26:09AM -0700, Tom Tromey wrote:
> >>>>>>>"H.J." == H J Lu <hjl@lucon.org> writes:
> >>H.J.> With the new linker switches, -Bsymbolic-functions and
> >>H.J.> --dynamic-list-cpp-new, we can improve shared library
> >>H.J.> performance in gcc. This change will build libstdc++.so with
> >>H.J.> -Bsymbolic-functions and --dynamic-list-cpp-new. I can expand it
> >>H.J.> to other libraries.
> >>
> >>I prefer to see semi-generic helper code like this in a new .m4 file
> >>in config.  That makes it somewhat simpler for other target libraries
> >>to reuse it.
> >>
> >
> >Here it is. If it is OK, I will extend it to Java and Fortran.
> 
> If the libstdc++ bits are ok, the config bits are ok but please put them 
> in a new file.  lib-ld.m4 is imported from gettext.  (And commit the 
> config part to both gcc and src).
> 

Here is the updated patch. I tested it on Linux/ia32, Linux/x86-64
and Linux/ia64.


H.J.
----
config/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-symbolic.m4: New.

libgfortran/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* aclocal.m4: Include ../config/lib-ld.m4 and
	../config/ld-symbolic.m4.
	* configure.ac: Use PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libgfortran to $SYMBOLIC_LDFLAGS if it isn't set.
	* configure: Regenerated.
	* Makefile.in: Likewise.

libgomp/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* aclocal.m4: Include ../config/lib-ld.m4 and
	../config/ld-symbolic.m4.

	* configure.ac: Use PROG_LD_GNU_SYMBOLIC.  Add
	$SYMBOLIC_LDFLAGS to OPT_LDFLAGS.
	* configure: Regenerated.
	* Makefile.in: Likewise.

libjava/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* aclocal.m4: Include ../config/ld-symbolic.m4.

	* configure.ac: Use PROG_LD_GNU_SYMBOLIC.  Set
	libgcj_ld_symbolic to $SYMBOLIC_LDFLAGS if it isn't set.
	* configure: Regenerated.
	* Makefile.in: Likewise.
	* gcj/Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

libobjc/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* aclocal.m4: Include ../config/lib-ld.m4 and
	../config/ld-symbolic.m4.
	* configure.ac: Use PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libobjc to $SYMBOLIC_LDFLAGS if it isn't set.
	* configure: Regenerated.

libstdc++-v3/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* aclocal.m4: Include ../config/lib-ld.m4 and
	../config/ld-symbolic.m4.
	* configure.ac: Use PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW.  Add
	$DYNAMIC_LIST_CPP_NEW_LDFLAGS to OPT_LDFLAGS.
	* configure: Regenerated.
	* Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* libmath/Makefile.in: Likewise.
	* libsupc++/Makefile.in: Likewise.
	* po/Makefile.in: Likewise.
	* src/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

--- gcc/config/ld-symbolic.m4.symbolic	2007-01-11 08:59:04.000000000 -0800
+++ gcc/config/ld-symbolic.m4	2007-01-11 09:09:54.000000000 -0800
@@ -0,0 +1,45 @@
+dnl Copyright (C) 2007 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl Set SYMBOLIC_LDFLAGS to -Bsymbolic-functions for GNU linker if it
+dnl is supported.
+AC_DEFUN([PROG_LD_GNU_SYMBOLIC],
+[AC_CACHE_CHECK([if the GNU linker ($LD) supports -Bsymbolic-functions],
+acl_cv_prog_gnu_ld_symbolic, [
+acl_cv_prog_gnu_ld_symbolic=no
+AC_REQUIRE([AC_LIB_PROG_LD_GNU])
+if test x"$with_gnu_ld" = x"yes"; then
+  if $LD --help 2>&1 </dev/null | grep Bsymbolic-functions 1>&5; then
+    acl_cv_prog_gnu_ld_symbolic=yes
+  fi
+fi])
+if test x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then
+  SYMBOLIC_LDFLAGS="-Wl,-Bsymbolic-functions"
+else
+  SYMBOLIC_LDFLAGS=''
+fi
+])
+
+dnl Set DYNAMIC_LIST_CPP_NEW_LDFLAGS to --dynamic-list-cpp-new for GNU
+dnl linker if it is supported.
+AC_DEFUN([PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW],
+[AC_CACHE_CHECK([if the GNU linker ($LD) supports --dynamic-list-cpp-new],
+acl_cv_prog_gnu_ld_dynamic_list_cpp_new, [
+acl_cv_prog_gnu_ld_dynamic_list_cpp_new=no
+AC_REQUIRE([PROG_LD_GNU_SYMBOLIC])
+if test x"$with_gnu_ld" = x"yes" -a \
+	x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then
+  if $LD --help 2>&1 </dev/null | grep dynamic-list-cpp-new 1>&5; then
+    acl_cv_prog_gnu_ld_dynamic_list_cpp_new=yes
+  fi
+fi])
+if test x"$acl_cv_prog_gnu_ld_dynamic_list_cpp_new" = x"yes"; then
+   DYNAMIC_LIST_CPP_NEW_LDFLAGS="$SYMBOLIC_LDFLAGS -Wl,--dynamic-list-cpp-new"
+else
+   DYNAMIC_LIST_CPP_NEW_LDFLAGS=''
+fi
+])
--- gcc/libgfortran/Makefile.in.symbolic	2007-01-09 16:44:22.000000000 -0800
+++ gcc/libgfortran/Makefile.in	2007-01-11 09:18:37.000000000 -0800
@@ -47,8 +47,10 @@ subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/lead-dot.m4 \
 	$(top_srcdir)/../config/multi.m4 \
-	$(top_srcdir)/../config/stdint.m4 $(top_srcdir)/acinclude.m4 \
-	$(top_srcdir)/../config/acx.m4 \
+	$(top_srcdir)/../config/stdint.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/acx.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
--- gcc/libgfortran/aclocal.m4.symbolic	2007-01-09 16:44:22.000000000 -0800
+++ gcc/libgfortran/aclocal.m4	2007-01-11 08:59:04.000000000 -0800
@@ -583,4 +583,6 @@ AC_SUBST([am__untar])
 m4_include([../config/lead-dot.m4])
 m4_include([../config/multi.m4])
 m4_include([../config/stdint.m4])
+m4_include([../config/lib-ld.m4])
+m4_include([../config/ld-symbolic.m4])
 m4_include([acinclude.m4])
--- gcc/libgfortran/configure.ac.symbolic	2007-01-09 16:43:10.000000000 -0800
+++ gcc/libgfortran/configure.ac	2007-01-11 08:59:04.000000000 -0800
@@ -143,12 +143,17 @@ AC_SUBST(enable_static)
 FC="$GFORTRAN"
 AC_PROG_FC(gfortran)
 
+PROG_LD_GNU_SYMBOLIC
+
 # extra LD Flags which are required for targets
 case "${host}" in
   *-darwin*)
     # Darwin needs -single_module when linking libgfortran
     extra_ldflags_libgfortran=-Wl,-single_module
     ;;
+  *)
+    extra_ldflags_libgfortran=$SYMBOLIC_LDFLAGS
+    ;;
 esac
 AC_SUBST(extra_ldflags_libgfortran)
 
--- gcc/libgomp/Makefile.in.symbolic	2007-01-09 16:44:22.000000000 -0800
+++ gcc/libgomp/Makefile.in	2007-01-11 09:24:18.000000000 -0800
@@ -53,8 +53,11 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/lead-dot.m4 \
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/stdint.m4 \
-	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/acinclude.m4 \
-	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/../config/tls.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -163,7 +166,6 @@ FC = @FC@
 FCFLAGS = @FCFLAGS@
 GENINSRC_FALSE = @GENINSRC_FALSE@
 GENINSRC_TRUE = @GENINSRC_TRUE@
-GREP = @GREP@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -206,8 +208,11 @@ USE_FORTRAN_TRUE = @USE_FORTRAN_TRUE@
 VERSION = @VERSION@
 XCFLAGS = @XCFLAGS@
 XLDFLAGS = @XLDFLAGS@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__include = @am__include@
@@ -223,9 +228,6 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 config_path = @config_path@
 datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
 enable_shared = @enable_shared@
 enable_static = @enable_static@
 exec_prefix = @exec_prefix@
@@ -234,7 +236,6 @@ host_alias = @host_alias@
 host_cpu = @host_cpu@
 host_os = @host_os@
 host_vendor = @host_vendor@
-htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
@@ -242,16 +243,13 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 libtool_VERSION = @libtool_VERSION@
 link_gomp = @link_gomp@
-localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 multi_basedir = @multi_basedir@
 oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
-psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
--- gcc/libgomp/aclocal.m4.symbolic	2007-01-09 16:44:22.000000000 -0800
+++ gcc/libgomp/aclocal.m4	2007-01-11 08:59:04.000000000 -0800
@@ -862,4 +862,6 @@ m4_include([../config/lead-dot.m4])
 m4_include([../config/multi.m4])
 m4_include([../config/stdint.m4])
 m4_include([../config/tls.m4])
+m4_include([../config/lib-ld.m4])
+m4_include([../config/ld-symbolic.m4])
 m4_include([acinclude.m4])
--- gcc/libgomp/configure.ac.symbolic	2007-01-09 16:42:39.000000000 -0800
+++ gcc/libgomp/configure.ac	2007-01-11 09:15:50.000000000 -0800
@@ -331,6 +331,9 @@ AC_SUBST(OMP_LOCK_KIND)
 AC_SUBST(OMP_NEST_LOCK_KIND)
 CFLAGS="$save_CFLAGS"
 
+PROG_LD_GNU_SYMBOLIC
+OPT_LDFLAGS="$OPT_LDFLAGS $SYMBOLIC_LDFLAGS"
+
 AC_CONFIG_FILES(omp.h omp_lib.h omp_lib.f90 libgomp_f.h)
 AC_CONFIG_FILES(Makefile testsuite/Makefile libgomp.spec)
 AC_OUTPUT
--- gcc/libjava/Makefile.in.symbolic	2007-01-10 14:51:03.000000000 -0800
+++ gcc/libjava/Makefile.in	2007-01-11 09:21:21.000000000 -0800
@@ -90,6 +90,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/tls.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \
 	$(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \
 	$(top_srcdir)/configure.ac
--- gcc/libjava/aclocal.m4.symbolic	2007-01-09 16:44:22.000000000 -0800
+++ gcc/libjava/aclocal.m4	2007-01-11 08:59:04.000000000 -0800
@@ -916,6 +916,7 @@ m4_include([../config/lib-prefix.m4])
 m4_include([../config/no-executables.m4])
 m4_include([../config/tls.m4])
 m4_include([../config/unwind_ipinfo.m4])
+m4_include([../config/ld-symbolic.m4])
 m4_include([../libtool.m4])
 m4_include([mingwld.m4])
 m4_include([pkg.m4])
--- gcc/libjava/configure.ac.symbolic	2007-01-09 16:43:57.000000000 -0800
+++ gcc/libjava/configure.ac	2007-01-11 08:59:04.000000000 -0800
@@ -173,6 +173,11 @@ libgcj_javaflags=
 
 . ${srcdir}/configure.host
 
+if test -z "$libgcj_ld_symbolic"; then
+  PROG_LD_GNU_SYMBOLIC
+  libgcj_ld_symbolic=$SYMBOLIC_LDFLAGS
+fi
+
 LIBGCJ_CFLAGS="${libgcj_cflags}"
 LIBGCJ_CXXFLAGS="${libgcj_cxxflags}"
 LIBGCJ_JAVAFLAGS="${libgcj_javaflags}"
--- gcc/libjava/gcj/Makefile.in.symbolic	2007-01-09 16:43:55.000000000 -0800
+++ gcc/libjava/gcj/Makefile.in	2007-01-11 09:35:55.000000000 -0800
@@ -55,6 +55,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/tls.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \
 	$(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \
 	$(top_srcdir)/configure.ac
--- gcc/libjava/include/Makefile.in.symbolic	2007-01-09 16:43:46.000000000 -0800
+++ gcc/libjava/include/Makefile.in	2007-01-11 09:35:00.000000000 -0800
@@ -54,6 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/tls.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \
 	$(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \
 	$(top_srcdir)/configure.ac
--- gcc/libjava/testsuite/Makefile.in.symbolic	2007-01-09 16:43:46.000000000 -0800
+++ gcc/libjava/testsuite/Makefile.in	2007-01-11 09:37:32.000000000 -0800
@@ -52,6 +52,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/tls.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \
 	$(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \
 	$(top_srcdir)/configure.ac
--- gcc/libobjc/aclocal.m4.symbolic	2006-10-17 07:33:05.000000000 -0700
+++ gcc/libobjc/aclocal.m4	2007-01-11 08:59:04.000000000 -0800
@@ -155,4 +155,6 @@ fi
 ])
 
 m4_include([../config/multi.m4])
+m4_include([../config/lib-ld.m4])
+m4_include([../config/ld-symbolic.m4])
 m4_include([acinclude.m4])
--- gcc/libobjc/configure.ac.symbolic	2007-01-10 12:38:19.000000000 -0800
+++ gcc/libobjc/configure.ac	2007-01-11 08:59:04.000000000 -0800
@@ -156,12 +156,17 @@ m4_define([_AC_ARG_VAR_PRECIOUS],[])
 AC_PROG_CC
 m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
+PROG_LD_GNU_SYMBOLIC
+
 # extra LD Flags which are required for targets
 case "${host}" in
   *-darwin*)
     # Darwin needs -single_module when linking libobjc
     extra_ldflags_libobjc=-Wl,-single_module
     ;;
+  *)
+    extra_ldflags_libobjc=$SYMBOLIC_LDFLAGS
+    ;;
 esac
 AC_SUBST(extra_ldflags_libobjc)
 
--- gcc/libstdc++-v3/Makefile.in.symbolic	2006-10-17 07:33:04.000000000 -0700
+++ gcc/libstdc++-v3/Makefile.in	2007-01-11 09:22:03.000000000 -0800
@@ -50,6 +50,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/aclocal.m4.symbolic	2006-10-17 07:33:04.000000000 -0700
+++ gcc/libstdc++-v3/aclocal.m4	2007-01-11 08:59:04.000000000 -0800
@@ -585,6 +585,8 @@ m4_include([../config/lead-dot.m4])
 m4_include([../config/multi.m4])
 m4_include([../config/no-executables.m4])
 m4_include([../config/unwind_ipinfo.m4])
+m4_include([../config/lib-ld.m4])
+m4_include([../config/ld-symbolic.m4])
 m4_include([../libtool.m4])
 m4_include([crossconfig.m4])
 m4_include([linkage.m4])
--- gcc/libstdc++-v3/configure.ac.symbolic	2006-11-16 09:57:24.000000000 -0800
+++ gcc/libstdc++-v3/configure.ac	2007-01-11 09:06:30.000000000 -0800
@@ -403,5 +403,8 @@ _EOF
 SUBDIRS="$SUBDIRS"
 ])
 
+PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW
+OPT_LDFLAGS="$OPT_LDFLAGS $DYNAMIC_LIST_CPP_NEW_LDFLAGS"
+
 dnl And this actually makes things happen:
 AC_OUTPUT
--- gcc/libstdc++-v3/include/Makefile.in.symbolic	2007-01-09 16:43:08.000000000 -0800
+++ gcc/libstdc++-v3/include/Makefile.in	2007-01-11 09:27:34.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/libmath/Makefile.in.symbolic	2006-10-17 07:32:39.000000000 -0700
+++ gcc/libstdc++-v3/libmath/Makefile.in	2007-01-11 09:27:42.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/libsupc++/Makefile.in.symbolic	2006-10-17 07:32:50.000000000 -0700
+++ gcc/libstdc++-v3/libsupc++/Makefile.in	2007-01-11 09:28:06.000000000 -0800
@@ -47,6 +47,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/po/Makefile.in.symbolic	2006-10-17 07:33:04.000000000 -0700
+++ gcc/libstdc++-v3/po/Makefile.in	2007-01-11 09:27:48.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/src/Makefile.in.symbolic	2006-10-17 07:32:51.000000000 -0700
+++ gcc/libstdc++-v3/src/Makefile.in	2007-01-11 09:22:39.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/testsuite/Makefile.in.symbolic	2006-10-17 07:33:02.000000000 -0700
+++ gcc/libstdc++-v3/testsuite/Makefile.in	2007-01-11 09:27:57.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-11 18:15                       ` H. J. Lu
@ 2007-01-11 18:33                         ` Paolo Bonzini
  2007-01-11 20:09                           ` H. J. Lu
  0 siblings, 1 reply; 24+ messages in thread
From: Paolo Bonzini @ 2007-01-11 18:33 UTC (permalink / raw)
  To: H. J. Lu; +Cc: gcc, gcc-patches


> config/
> 
> 2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>
> 
> 	* ld-symbolic.m4: New.

Please name the macro AC_LIB_PROG_LD_GNU_SYMBOLIC, or 
ACX_PROG_LD_GNU_SYMBOLIC.

> libgfortran/
> 
> 2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>
> 
> 	* aclocal.m4: Include ../config/lib-ld.m4 and
> 	../config/ld-symbolic.m4.

Also, aclocal.m4 is automatically generated with "aclocal -I ../config" 
except in libjava.

> 	* configure.ac: Use PROG_LD_GNU_SYMBOLIC.  Set
> 	libgcj_ld_symbolic to $SYMBOLIC_LDFLAGS if it isn't set.

Please check if libgcj_ld_symbolic is now obsolete in 
libjava/configure.host.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-11 18:33                         ` Paolo Bonzini
@ 2007-01-11 20:09                           ` H. J. Lu
  2007-01-12  7:57                             ` Paolo Bonzini
  2007-01-12 12:13                             ` Andrew Haley
  0 siblings, 2 replies; 24+ messages in thread
From: H. J. Lu @ 2007-01-11 20:09 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: gcc, gcc-patches

On Thu, Jan 11, 2007 at 07:33:21PM +0100, Paolo Bonzini wrote:
> 
> >config/
> >
> >2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>
> >
> >	* ld-symbolic.m4: New.
> 
> Please name the macro AC_LIB_PROG_LD_GNU_SYMBOLIC, or 
> ACX_PROG_LD_GNU_SYMBOLIC.
> 
> >libgfortran/
> >
> >2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>
> >
> >	* aclocal.m4: Include ../config/lib-ld.m4 and
> >	../config/ld-symbolic.m4.
> 
> Also, aclocal.m4 is automatically generated with "aclocal -I ../config" 
> except in libjava.
> 
> >	* configure.ac: Use PROG_LD_GNU_SYMBOLIC.  Set
> >	libgcj_ld_symbolic to $SYMBOLIC_LDFLAGS if it isn't set.
> 
> Please check if libgcj_ld_symbolic is now obsolete in 
> libjava/configure.host.

libjava will use -Bsymbolic on Linux, which is more aggresive than
-Bsymbol-functions. It will bind global data references locally in
additon to global function references. My patch will keep -Bsymbolic
for libjava if it is set by libjava/configure.host.

Here is an updated patch.


H.J.
-----
config/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-symbolic.m4: New.

libgfortran/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libgfortran to $SYMBOLIC_LDFLAGS if it isn't set.
	* configure: Regenerated.
	* aclocal.m4: Likewise.
	* Makefile.in: Likewise.

libgomp/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Add
	$SYMBOLIC_LDFLAGS to OPT_LDFLAGS.
	* configure: Regenerated.
	* aclocal.m4: Likewise.
	* Makefile.in: Likewise.

libjava/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	libgcj_ld_symbolic to $SYMBOLIC_LDFLAGS if it isn't set.
	* configure: Regenerated.
	* aclocal.m4: Likewise.
	* Makefile.in: Likewise.
	* gcj/Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

libobjc/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libobjc to $SYMBOLIC_LDFLAGS if it isn't set.
	* configure: Regenerated.
	* aclocal.m4: Likewise.

libstdc++-v3/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW.  Add
	$DYNAMIC_LIST_CPP_NEW_LDFLAGS to OPT_LDFLAGS.
	* configure: Regenerated.
	* aclocal.m4: Likewise.
	* Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* libmath/Makefile.in: Likewise.
	* libsupc++/Makefile.in: Likewise.
	* po/Makefile.in: Likewise.
	* src/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

--- gcc/config/ld-symbolic.m4.symbolic	2007-01-11 08:59:04.000000000 -0800
+++ gcc/config/ld-symbolic.m4	2007-01-11 09:09:54.000000000 -0800
@@ -0,0 +1,45 @@
+dnl Copyright (C) 2007 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl Set SYMBOLIC_LDFLAGS to -Bsymbolic-functions for GNU linker if it
+dnl is supported.
+AC_DEFUN([ACX_PROG_LD_GNU_SYMBOLIC],
+[AC_CACHE_CHECK([if the GNU linker ($LD) supports -Bsymbolic-functions],
+acl_cv_prog_gnu_ld_symbolic, [
+acl_cv_prog_gnu_ld_symbolic=no
+AC_REQUIRE([AC_LIB_PROG_LD_GNU])
+if test x"$with_gnu_ld" = x"yes"; then
+  if $LD --help 2>&1 </dev/null | grep Bsymbolic-functions 1>&5; then
+    acl_cv_prog_gnu_ld_symbolic=yes
+  fi
+fi])
+if test x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then
+  SYMBOLIC_LDFLAGS="-Wl,-Bsymbolic-functions"
+else
+  SYMBOLIC_LDFLAGS=''
+fi
+])
+
+dnl Set DYNAMIC_LIST_CPP_NEW_LDFLAGS to --dynamic-list-cpp-new for GNU
+dnl linker if it is supported.
+AC_DEFUN([ACX_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW],
+[AC_CACHE_CHECK([if the GNU linker ($LD) supports --dynamic-list-cpp-new],
+acl_cv_prog_gnu_ld_dynamic_list_cpp_new, [
+acl_cv_prog_gnu_ld_dynamic_list_cpp_new=no
+AC_REQUIRE([ACX_PROG_LD_GNU_SYMBOLIC])
+if test x"$with_gnu_ld" = x"yes" -a \
+	x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then
+  if $LD --help 2>&1 </dev/null | grep dynamic-list-cpp-new 1>&5; then
+    acl_cv_prog_gnu_ld_dynamic_list_cpp_new=yes
+  fi
+fi])
+if test x"$acl_cv_prog_gnu_ld_dynamic_list_cpp_new" = x"yes"; then
+   DYNAMIC_LIST_CPP_NEW_LDFLAGS="$SYMBOLIC_LDFLAGS -Wl,--dynamic-list-cpp-new"
+else
+   DYNAMIC_LIST_CPP_NEW_LDFLAGS=''
+fi
+])
--- gcc/libgfortran/Makefile.in.symbolic	2007-01-09 16:44:22.000000000 -0800
+++ gcc/libgfortran/Makefile.in	2007-01-11 09:18:37.000000000 -0800
@@ -47,8 +47,10 @@ subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/lead-dot.m4 \
 	$(top_srcdir)/../config/multi.m4 \
-	$(top_srcdir)/../config/stdint.m4 $(top_srcdir)/acinclude.m4 \
-	$(top_srcdir)/../config/acx.m4 \
+	$(top_srcdir)/../config/stdint.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/acx.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
--- gcc/libgfortran/aclocal.m4.symbolic	2007-01-09 16:44:22.000000000 -0800
+++ gcc/libgfortran/aclocal.m4	2007-01-11 08:59:04.000000000 -0800
@@ -583,4 +583,6 @@ AC_SUBST([am__untar])
 m4_include([../config/lead-dot.m4])
 m4_include([../config/multi.m4])
 m4_include([../config/stdint.m4])
+m4_include([../config/lib-ld.m4])
+m4_include([../config/ld-symbolic.m4])
 m4_include([acinclude.m4])
--- gcc/libgfortran/configure.ac.symbolic	2007-01-09 16:43:10.000000000 -0800
+++ gcc/libgfortran/configure.ac	2007-01-11 08:59:04.000000000 -0800
@@ -143,12 +143,17 @@ AC_SUBST(enable_static)
 FC="$GFORTRAN"
 AC_PROG_FC(gfortran)
 
+ACX_PROG_LD_GNU_SYMBOLIC
+
 # extra LD Flags which are required for targets
 case "${host}" in
   *-darwin*)
     # Darwin needs -single_module when linking libgfortran
     extra_ldflags_libgfortran=-Wl,-single_module
     ;;
+  *)
+    extra_ldflags_libgfortran=$SYMBOLIC_LDFLAGS
+    ;;
 esac
 AC_SUBST(extra_ldflags_libgfortran)
 
--- gcc/libgomp/Makefile.in.symbolic	2007-01-09 16:44:22.000000000 -0800
+++ gcc/libgomp/Makefile.in	2007-01-11 09:24:18.000000000 -0800
@@ -53,8 +53,11 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/lead-dot.m4 \
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/stdint.m4 \
-	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/acinclude.m4 \
-	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/../config/tls.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -163,7 +166,6 @@ FC = @FC@
 FCFLAGS = @FCFLAGS@
 GENINSRC_FALSE = @GENINSRC_FALSE@
 GENINSRC_TRUE = @GENINSRC_TRUE@
-GREP = @GREP@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -206,8 +208,11 @@ USE_FORTRAN_TRUE = @USE_FORTRAN_TRUE@
 VERSION = @VERSION@
 XCFLAGS = @XCFLAGS@
 XLDFLAGS = @XLDFLAGS@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__include = @am__include@
@@ -223,9 +228,6 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 config_path = @config_path@
 datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
 enable_shared = @enable_shared@
 enable_static = @enable_static@
 exec_prefix = @exec_prefix@
@@ -234,7 +236,6 @@ host_alias = @host_alias@
 host_cpu = @host_cpu@
 host_os = @host_os@
 host_vendor = @host_vendor@
-htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
@@ -242,16 +243,13 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 libtool_VERSION = @libtool_VERSION@
 link_gomp = @link_gomp@
-localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 multi_basedir = @multi_basedir@
 oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
-psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
--- gcc/libgomp/aclocal.m4.symbolic	2007-01-09 16:44:22.000000000 -0800
+++ gcc/libgomp/aclocal.m4	2007-01-11 08:59:04.000000000 -0800
@@ -862,4 +862,6 @@ m4_include([../config/lead-dot.m4])
 m4_include([../config/multi.m4])
 m4_include([../config/stdint.m4])
 m4_include([../config/tls.m4])
+m4_include([../config/lib-ld.m4])
+m4_include([../config/ld-symbolic.m4])
 m4_include([acinclude.m4])
--- gcc/libgomp/configure.ac.symbolic	2007-01-09 16:42:39.000000000 -0800
+++ gcc/libgomp/configure.ac	2007-01-11 09:15:50.000000000 -0800
@@ -331,6 +331,9 @@ AC_SUBST(OMP_LOCK_KIND)
 AC_SUBST(OMP_NEST_LOCK_KIND)
 CFLAGS="$save_CFLAGS"
 
+ACX_PROG_LD_GNU_SYMBOLIC
+OPT_LDFLAGS="$OPT_LDFLAGS $SYMBOLIC_LDFLAGS"
+
 AC_CONFIG_FILES(omp.h omp_lib.h omp_lib.f90 libgomp_f.h)
 AC_CONFIG_FILES(Makefile testsuite/Makefile libgomp.spec)
 AC_OUTPUT
--- gcc/libjava/Makefile.in.symbolic	2007-01-10 14:51:03.000000000 -0800
+++ gcc/libjava/Makefile.in	2007-01-11 09:21:21.000000000 -0800
@@ -90,6 +90,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/tls.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \
 	$(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \
 	$(top_srcdir)/configure.ac
--- gcc/libjava/aclocal.m4.symbolic	2007-01-09 16:44:22.000000000 -0800
+++ gcc/libjava/aclocal.m4	2007-01-11 08:59:04.000000000 -0800
@@ -916,6 +916,7 @@ m4_include([../config/lib-prefix.m4])
 m4_include([../config/no-executables.m4])
 m4_include([../config/tls.m4])
 m4_include([../config/unwind_ipinfo.m4])
+m4_include([../config/ld-symbolic.m4])
 m4_include([../libtool.m4])
 m4_include([mingwld.m4])
 m4_include([pkg.m4])
--- gcc/libjava/configure.ac.symbolic	2007-01-09 16:43:57.000000000 -0800
+++ gcc/libjava/configure.ac	2007-01-11 08:59:04.000000000 -0800
@@ -173,6 +173,11 @@ libgcj_javaflags=
 
 . ${srcdir}/configure.host
 
+if test -z "$libgcj_ld_symbolic"; then
+  ACX_PROG_LD_GNU_SYMBOLIC
+  libgcj_ld_symbolic=$SYMBOLIC_LDFLAGS
+fi
+
 LIBGCJ_CFLAGS="${libgcj_cflags}"
 LIBGCJ_CXXFLAGS="${libgcj_cxxflags}"
 LIBGCJ_JAVAFLAGS="${libgcj_javaflags}"
--- gcc/libjava/gcj/Makefile.in.symbolic	2007-01-09 16:43:55.000000000 -0800
+++ gcc/libjava/gcj/Makefile.in	2007-01-11 09:35:55.000000000 -0800
@@ -55,6 +55,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/tls.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \
 	$(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \
 	$(top_srcdir)/configure.ac
--- gcc/libjava/include/Makefile.in.symbolic	2007-01-09 16:43:46.000000000 -0800
+++ gcc/libjava/include/Makefile.in	2007-01-11 09:35:00.000000000 -0800
@@ -54,6 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/tls.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \
 	$(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \
 	$(top_srcdir)/configure.ac
--- gcc/libjava/testsuite/Makefile.in.symbolic	2007-01-09 16:43:46.000000000 -0800
+++ gcc/libjava/testsuite/Makefile.in	2007-01-11 09:37:32.000000000 -0800
@@ -52,6 +52,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/tls.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \
 	$(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \
 	$(top_srcdir)/configure.ac
--- gcc/libobjc/aclocal.m4.symbolic	2006-10-17 07:33:05.000000000 -0700
+++ gcc/libobjc/aclocal.m4	2007-01-11 08:59:04.000000000 -0800
@@ -155,4 +155,6 @@ fi
 ])
 
 m4_include([../config/multi.m4])
+m4_include([../config/lib-ld.m4])
+m4_include([../config/ld-symbolic.m4])
 m4_include([acinclude.m4])
--- gcc/libobjc/configure.ac.symbolic	2007-01-10 12:38:19.000000000 -0800
+++ gcc/libobjc/configure.ac	2007-01-11 08:59:04.000000000 -0800
@@ -156,12 +156,17 @@ m4_define([_AC_ARG_VAR_PRECIOUS],[])
 AC_PROG_CC
 m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
+ACX_PROG_LD_GNU_SYMBOLIC
+
 # extra LD Flags which are required for targets
 case "${host}" in
   *-darwin*)
     # Darwin needs -single_module when linking libobjc
     extra_ldflags_libobjc=-Wl,-single_module
     ;;
+  *)
+    extra_ldflags_libobjc=$SYMBOLIC_LDFLAGS
+    ;;
 esac
 AC_SUBST(extra_ldflags_libobjc)
 
--- gcc/libstdc++-v3/Makefile.in.symbolic	2006-10-17 07:33:04.000000000 -0700
+++ gcc/libstdc++-v3/Makefile.in	2007-01-11 09:22:03.000000000 -0800
@@ -50,6 +50,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/aclocal.m4.symbolic	2006-10-17 07:33:04.000000000 -0700
+++ gcc/libstdc++-v3/aclocal.m4	2007-01-11 08:59:04.000000000 -0800
@@ -585,6 +585,8 @@ m4_include([../config/lead-dot.m4])
 m4_include([../config/multi.m4])
 m4_include([../config/no-executables.m4])
 m4_include([../config/unwind_ipinfo.m4])
+m4_include([../config/lib-ld.m4])
+m4_include([../config/ld-symbolic.m4])
 m4_include([../libtool.m4])
 m4_include([crossconfig.m4])
 m4_include([linkage.m4])
--- gcc/libstdc++-v3/configure.ac.symbolic	2006-11-16 09:57:24.000000000 -0800
+++ gcc/libstdc++-v3/configure.ac	2007-01-11 09:06:30.000000000 -0800
@@ -403,5 +403,8 @@ _EOF
 SUBDIRS="$SUBDIRS"
 ])
 
+ACX_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW
+OPT_LDFLAGS="$OPT_LDFLAGS $DYNAMIC_LIST_CPP_NEW_LDFLAGS"
+
 dnl And this actually makes things happen:
 AC_OUTPUT
--- gcc/libstdc++-v3/include/Makefile.in.symbolic	2007-01-09 16:43:08.000000000 -0800
+++ gcc/libstdc++-v3/include/Makefile.in	2007-01-11 09:27:34.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/libmath/Makefile.in.symbolic	2006-10-17 07:32:39.000000000 -0700
+++ gcc/libstdc++-v3/libmath/Makefile.in	2007-01-11 09:27:42.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/libsupc++/Makefile.in.symbolic	2006-10-17 07:32:50.000000000 -0700
+++ gcc/libstdc++-v3/libsupc++/Makefile.in	2007-01-11 09:28:06.000000000 -0800
@@ -47,6 +47,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/po/Makefile.in.symbolic	2006-10-17 07:33:04.000000000 -0700
+++ gcc/libstdc++-v3/po/Makefile.in	2007-01-11 09:27:48.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/src/Makefile.in.symbolic	2006-10-17 07:32:51.000000000 -0700
+++ gcc/libstdc++-v3/src/Makefile.in	2007-01-11 09:22:39.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/testsuite/Makefile.in.symbolic	2006-10-17 07:33:02.000000000 -0700
+++ gcc/libstdc++-v3/testsuite/Makefile.in	2007-01-11 09:27:57.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-11 20:09                           ` H. J. Lu
@ 2007-01-12  7:57                             ` Paolo Bonzini
  2007-01-12 14:39                               ` H. J. Lu
  2007-01-12 12:13                             ` Andrew Haley
  1 sibling, 1 reply; 24+ messages in thread
From: Paolo Bonzini @ 2007-01-12  7:57 UTC (permalink / raw)
  To: H. J. Lu; +Cc: gcc, gcc-patches


> libjava will use -Bsymbolic on Linux, which is more aggresive than
> -Bsymbol-functions. It will bind global data references locally in
> additon to global function references. My patch will keep -Bsymbolic
> for libjava if it is set by libjava/configure.host.
> 
> Here is an updated patch.

The configury logic is fine by me, but please wait for approval at least 
from the libjava and libstdc++ maintainers since I don't understand 
fully the consequences of the -Bsymbolic stuff.  Could it be considered 
an ABI change, in that programs previously overriding some symbols will 
break?  (Sorry if the question is dumb).

Paolo

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-11 20:09                           ` H. J. Lu
  2007-01-12  7:57                             ` Paolo Bonzini
@ 2007-01-12 12:13                             ` Andrew Haley
  2007-01-12 14:40                               ` H. J. Lu
  1 sibling, 1 reply; 24+ messages in thread
From: Andrew Haley @ 2007-01-12 12:13 UTC (permalink / raw)
  To: H. J. Lu; +Cc: Paolo Bonzini, gcc, gcc-patches

H. J. Lu writes:
 > On Thu, Jan 11, 2007 at 07:33:21PM +0100, Paolo Bonzini wrote:
 > > 
 > > >config/
 > > >
 > > >2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>
 > > >
 > > >	* ld-symbolic.m4: New.
 > > 
 > > Please name the macro AC_LIB_PROG_LD_GNU_SYMBOLIC, or 
 > > ACX_PROG_LD_GNU_SYMBOLIC.
 > > 
 > > >libgfortran/
 > > >
 > > >2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>
 > > >
 > > >	* aclocal.m4: Include ../config/lib-ld.m4 and
 > > >	../config/ld-symbolic.m4.
 > > 
 > > Also, aclocal.m4 is automatically generated with "aclocal -I ../config" 
 > > except in libjava.
 > > 
 > > >	* configure.ac: Use PROG_LD_GNU_SYMBOLIC.  Set
 > > >	libgcj_ld_symbolic to $SYMBOLIC_LDFLAGS if it isn't set.
 > > 
 > > Please check if libgcj_ld_symbolic is now obsolete in 
 > > libjava/configure.host.
 > 
 > libjava will use -Bsymbolic on Linux, which is more aggresive than
 > -Bsymbol-functions.

libjava doesn't use -Bsymbolic for all of its libraries, just for
libgij, libjvm, and libawt.  I'd use -Bsymbolic for libgcj as well,
but (because of copy relocs) we'd have to compile all gcj executables
-fpic.

I presume your patch doesn't change this behaviour.

Andrew.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-12  7:57                             ` Paolo Bonzini
@ 2007-01-12 14:39                               ` H. J. Lu
  2007-01-12 18:52                                 ` H. J. Lu
  0 siblings, 1 reply; 24+ messages in thread
From: H. J. Lu @ 2007-01-12 14:39 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: gcc, gcc-patches

On Fri, Jan 12, 2007 at 08:57:42AM +0100, Paolo Bonzini wrote:
> 
> >libjava will use -Bsymbolic on Linux, which is more aggresive than
> >-Bsymbol-functions. It will bind global data references locally in
> >additon to global function references. My patch will keep -Bsymbolic
> >for libjava if it is set by libjava/configure.host.
> >
> >Here is an updated patch.
> 
> The configury logic is fine by me, but please wait for approval at least 
> from the libjava and libstdc++ maintainers since I don't understand 
> fully the consequences of the -Bsymbolic stuff.  Could it be considered 
> an ABI change, in that programs previously overriding some symbols will 
> break?  (Sorry if the question is dumb).

My change should allow programs to override functions which are
overridable as specified in language standards. That is why I build
libstdc++.so with --dynamic-list-cpp-new so that programs can override
C++ operator new/delete.  Programs depending on overriding function
symbols, which aren't overridable in language standards, are broken.
In theory, you can have a huge .o file containing all library
functions which aren't overridable in language standard.  You
won't be able to override any of those functions when that .o file
is linked in statically.

Since I used -Bsymbolic-functions, it has no effect on data symbols.


H.J.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-12 12:13                             ` Andrew Haley
@ 2007-01-12 14:40                               ` H. J. Lu
  0 siblings, 0 replies; 24+ messages in thread
From: H. J. Lu @ 2007-01-12 14:40 UTC (permalink / raw)
  To: Andrew Haley; +Cc: Paolo Bonzini, gcc, gcc-patches

On Fri, Jan 12, 2007 at 12:13:11PM +0000, Andrew Haley wrote:
> H. J. Lu writes:
>  > On Thu, Jan 11, 2007 at 07:33:21PM +0100, Paolo Bonzini wrote:
>  > > 
>  > > >config/
>  > > >
>  > > >2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>
>  > > >
>  > > >	* ld-symbolic.m4: New.
>  > > 
>  > > Please name the macro AC_LIB_PROG_LD_GNU_SYMBOLIC, or 
>  > > ACX_PROG_LD_GNU_SYMBOLIC.
>  > > 
>  > > >libgfortran/
>  > > >
>  > > >2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>
>  > > >
>  > > >	* aclocal.m4: Include ../config/lib-ld.m4 and
>  > > >	../config/ld-symbolic.m4.
>  > > 
>  > > Also, aclocal.m4 is automatically generated with "aclocal -I ../config" 
>  > > except in libjava.
>  > > 
>  > > >	* configure.ac: Use PROG_LD_GNU_SYMBOLIC.  Set
>  > > >	libgcj_ld_symbolic to $SYMBOLIC_LDFLAGS if it isn't set.
>  > > 
>  > > Please check if libgcj_ld_symbolic is now obsolete in 
>  > > libjava/configure.host.
>  > 
>  > libjava will use -Bsymbolic on Linux, which is more aggresive than
>  > -Bsymbol-functions.
> 
> libjava doesn't use -Bsymbolic for all of its libraries, just for
> libgij, libjvm, and libawt.  I'd use -Bsymbolic for libgcj as well,
> but (because of copy relocs) we'd have to compile all gcj executables
> -fpic.
> 
> I presume your patch doesn't change this behaviour.

I didn't realized that. I will update my patch to build
libgcj with -Bsymbol-functions. You don't need to compile any
gcj executables with -fpic.


H.J.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-12 14:39                               ` H. J. Lu
@ 2007-01-12 18:52                                 ` H. J. Lu
  2007-01-13 13:48                                   ` Paolo Bonzini
  0 siblings, 1 reply; 24+ messages in thread
From: H. J. Lu @ 2007-01-12 18:52 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: gcc, gcc-patches

On Fri, Jan 12, 2007 at 06:38:56AM -0800, H. J. Lu wrote:
> On Fri, Jan 12, 2007 at 08:57:42AM +0100, Paolo Bonzini wrote:
> > 
> > >libjava will use -Bsymbolic on Linux, which is more aggresive than
> > >-Bsymbol-functions. It will bind global data references locally in
> > >additon to global function references. My patch will keep -Bsymbolic
> > >for libjava if it is set by libjava/configure.host.
> > >
> > >Here is an updated patch.
> > 
> > The configury logic is fine by me, but please wait for approval at least 
> > from the libjava and libstdc++ maintainers since I don't understand 
> > fully the consequences of the -Bsymbolic stuff.  Could it be considered 
> > an ABI change, in that programs previously overriding some symbols will 
> > break?  (Sorry if the question is dumb).
> 
> My change should allow programs to override functions which are
> overridable as specified in language standards. That is why I build
> libstdc++.so with --dynamic-list-cpp-new so that programs can override
> C++ operator new/delete.  Programs depending on overriding function
> symbols, which aren't overridable in language standards, are broken.
> In theory, you can have a huge .o file containing all library
> functions which aren't overridable in language standard.  You
> won't be able to override any of those functions when that .o file
> is linked in statically.
> 
> Since I used -Bsymbolic-functions, it has no effect on data symbols.
> 

I extended -Bsymbolic-functions to libffi, libjava, libmudflap,
libssp and libgcc. There are no regressions:

http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00511.html
http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00510.html
http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00509.html

If we apply -Bsymbolic-functions to all shared libraries on a system,
it will improve application startup time and overall runtime
performance.


H.J.
----
config/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-symbolic.m4: New.

libffi/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (ACLOCAL_AMFLAGS): Add -I ../config.
	(libffi_la_LDFLAGS): Add $(extra_ldflags_libffi)
	* Makefile.in: Regenerated.

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libffi to $SYMBOLIC_LDFLAGS.  Substitute
	extra_ldflags_libffi.
	* configure: Regenerated.
	* aclocal.m4: Likewise.

libgcc/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.in (extra_ldflags_libgcc): New.
	(SHLIB_LINK): Add $(extra_ldflags_libgcc).

	* configure.ac: Include ../config/lib-ld.m4 and
	../config/ld-symbolic.m4.  Usde ACX_PROG_LD_GNU_SYMBOLIC. Set
	extra_ldflags_libgcc to $SYMBOLIC_LDFLAGS.  Substitute
	extra_ldflags_libgcc.
	* configure: Regenerated.

libgfortran/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libgfortran to $SYMBOLIC_LDFLAGS if it isn't set.
	* configure: Regenerated.
	* aclocal.m4: Likewise.
	* Makefile.in: Likewise.

libgomp/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Add
	$SYMBOLIC_LDFLAGS to OPT_LDFLAGS.
	* configure: Regenerated.
	* aclocal.m4: Likewise.
	* Makefile.in: Likewise.

libjava/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (libgcj_la_LDFLAGS): Add
	$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS).
	(libgcj_tools_la_LDFLAGS): Likewise.
	(libgcj_bc_la_LDFLAGS): Likewise.
	* Makefile.in: Regenerated.

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	LIBGCJ_LD_SYMBOLIC_FUNCTIONS to $SYMBOLIC_LDFLAGS.  Set
	libgcj_ld_symbolic to $SYMBOLIC_LDFLAGS if it isn't set.
	Substitute LIBGCJ_LD_SYMBOLIC_FUNCTIONS.
	* configure: Regenerated.
	* aclocal.m4: Likewise.
	* gcj/Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

libmudflap/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (libmudflap_la_LDFLAGS): Add
	$(extra_ldflags_libmudflap).
	(libmudflapth_la_LDFLAGS): Likewise.
	* Makefile.in: Regenerated.

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libmudflap to $SYMBOLIC_LDFLAGS.  Substitute
	extra_ldflags_libmudflap.
	* configure: Regenerated.
	* aclocal.m4: Likewise.

libobjc/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libobjc to $SYMBOLIC_LDFLAGS if it isn't set.
	* configure: Regenerated.
	* aclocal.m4: Likewise.

libssp/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (libssp_la_LDFLAGS): Add $(extra_ldflags_libssp).
	* Makefile.in: Regenerated.

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libssp to $SYMBOLIC_LDFLAGS.  Substitute
	extra_ldflags_libssp.
	* configure: Regenerated.
	* aclocal.m4: Likewise.

libstdc++-v3/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW.  Add
	$DYNAMIC_LIST_CPP_NEW_LDFLAGS to OPT_LDFLAGS.
	* configure: Regenerated.
	* aclocal.m4: Likewise.
	* Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* libmath/Makefile.in: Likewise.
	* libsupc++/Makefile.in: Likewise.
	* po/Makefile.in: Likewise.
	* src/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

--- gcc/config/ld-symbolic.m4.symbolic	2007-01-12 07:45:01.000000000 -0800
+++ gcc/config/ld-symbolic.m4	2007-01-12 07:45:01.000000000 -0800
@@ -0,0 +1,45 @@
+dnl Copyright (C) 2007 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl Set SYMBOLIC_LDFLAGS to -Bsymbolic-functions for GNU linker if it
+dnl is supported.
+AC_DEFUN([ACX_PROG_LD_GNU_SYMBOLIC],
+[AC_CACHE_CHECK([if the GNU linker ($LD) supports -Bsymbolic-functions],
+acl_cv_prog_gnu_ld_symbolic, [
+acl_cv_prog_gnu_ld_symbolic=no
+AC_REQUIRE([AC_LIB_PROG_LD_GNU])
+if test x"$with_gnu_ld" = x"yes"; then
+  if $LD --help 2>&1 </dev/null | grep Bsymbolic-functions 1>&5; then
+    acl_cv_prog_gnu_ld_symbolic=yes
+  fi
+fi])
+if test x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then
+  SYMBOLIC_LDFLAGS="-Wl,-Bsymbolic-functions"
+else
+  SYMBOLIC_LDFLAGS=''
+fi
+])
+
+dnl Set DYNAMIC_LIST_CPP_NEW_LDFLAGS to --dynamic-list-cpp-new for GNU
+dnl linker if it is supported.
+AC_DEFUN([ACX_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW],
+[AC_CACHE_CHECK([if the GNU linker ($LD) supports --dynamic-list-cpp-new],
+acl_cv_prog_gnu_ld_dynamic_list_cpp_new, [
+acl_cv_prog_gnu_ld_dynamic_list_cpp_new=no
+AC_REQUIRE([ACX_PROG_LD_GNU_SYMBOLIC])
+if test x"$with_gnu_ld" = x"yes" -a \
+	x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then
+  if $LD --help 2>&1 </dev/null | grep dynamic-list-cpp-new 1>&5; then
+    acl_cv_prog_gnu_ld_dynamic_list_cpp_new=yes
+  fi
+fi])
+if test x"$acl_cv_prog_gnu_ld_dynamic_list_cpp_new" = x"yes"; then
+   DYNAMIC_LIST_CPP_NEW_LDFLAGS="$SYMBOLIC_LDFLAGS -Wl,--dynamic-list-cpp-new"
+else
+   DYNAMIC_LIST_CPP_NEW_LDFLAGS=''
+fi
+])
--- gcc/libffi/Makefile.am.symbolic	2006-12-14 09:01:37.000000000 -0800
+++ gcc/libffi/Makefile.am	2007-01-12 07:45:01.000000000 -0800
@@ -1,7 +1,7 @@
 ## Process this with automake to create Makefile.in
 
 AUTOMAKE_OPTIONS = foreign subdir-objects
-ACLOCAL_AMFLAGS = -I ..
+ACLOCAL_AMFLAGS = -I .. -I ../config
 
 SUBDIRS = include testsuite
 
@@ -157,7 +157,7 @@ nodist_libffi_convenience_la_SOURCES = $
 
 AM_CFLAGS = -Wall -g -fexceptions
 
-libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libffi)
 
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
 AM_CCASFLAGS = $(AM_CPPFLAGS)
--- gcc/libffi/Makefile.in.symbolic	2006-12-14 09:01:37.000000000 -0800
+++ gcc/libffi/Makefile.in	2007-01-12 07:45:01.000000000 -0800
@@ -69,7 +69,11 @@ DIST_COMMON = README $(am__configure_dep
 	$(top_srcdir)/configure ChangeLog
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
+	$(top_srcdir)/../config/lead-dot.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/multi.m4 $(top_srcdir)/../libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -318,6 +322,7 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+extra_ldflags_libffi = @extra_ldflags_libffi@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -346,7 +351,7 @@ target_vendor = @target_vendor@
 toolexecdir = @toolexecdir@
 toolexeclibdir = @toolexeclibdir@
 AUTOMAKE_OPTIONS = foreign subdir-objects
-ACLOCAL_AMFLAGS = -I ..
+ACLOCAL_AMFLAGS = -I .. -I ../config
 SUBDIRS = include testsuite
 EXTRA_DIST = LICENSE ChangeLog.v1 \
 	src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \
@@ -427,7 +432,7 @@ nodist_libffi_la_SOURCES = $(am__append_
 libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
 AM_CFLAGS = -Wall -g -fexceptions
-libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libffi)
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
 AM_CCASFLAGS = $(AM_CPPFLAGS)
 all: fficonfig.h
@@ -1059,7 +1064,7 @@ distclean-tags:
 distdir: $(DISTFILES)
 	$(am__remove_distdir)
 	mkdir $(distdir)
-	$(mkdir_p) $(distdir)/.. $(distdir)/include $(distdir)/src/alpha $(distdir)/src/arm $(distdir)/src/cris $(distdir)/src/frv $(distdir)/src/m32r $(distdir)/src/m68k $(distdir)/src/mips $(distdir)/src/pa $(distdir)/src/powerpc $(distdir)/src/s390 $(distdir)/src/sh $(distdir)/src/sh64 $(distdir)/src/sparc $(distdir)/src/x86
+	$(mkdir_p) $(distdir)/.. $(distdir)/../config $(distdir)/include $(distdir)/src/alpha $(distdir)/src/arm $(distdir)/src/cris $(distdir)/src/frv $(distdir)/src/m32r $(distdir)/src/m68k $(distdir)/src/mips $(distdir)/src/pa $(distdir)/src/powerpc $(distdir)/src/s390 $(distdir)/src/sh $(distdir)/src/sh64 $(distdir)/src/sparc $(distdir)/src/x86
 	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
 	list='$(DISTFILES)'; for file in $$list; do \
--- gcc/libffi/configure.ac.symbolic	2006-12-14 09:01:37.000000000 -0800
+++ gcc/libffi/configure.ac	2007-01-12 07:45:01.000000000 -0800
@@ -276,6 +276,10 @@ esac
 AC_SUBST(toolexecdir)
 AC_SUBST(toolexeclibdir)
 
+ACX_PROG_LD_GNU_SYMBOLIC
+extra_ldflags_libffi=$SYMBOLIC_LDFLAGS
+AC_SUBST(extra_ldflags_libffi)
+
 if test "${multilib}" = "yes"; then
   multilib_arg="--enable-multilib"
 else
--- gcc/libgcc/Makefile.in.symbolic	2007-01-06 07:57:28.000000000 -0800
+++ gcc/libgcc/Makefile.in	2007-01-12 09:08:29.000000000 -0800
@@ -38,6 +38,8 @@ SHELL = @SHELL@
 enable_shared = @enable_shared@
 decimal_float = @decimal_float@
 
+extra_ldflags_libgcc = @extra_ldflags_libgcc@
+
 host_noncanonical = @host_noncanonical@
 
 # List of extra object files that should be compiled for this target machine.
@@ -224,6 +226,8 @@ include $(srcdir)/empty.mk $(tmake_file)
 #   - we know how to build them
 ifeq ($(SHLIB_LINK),)
   enable_shared := no
+else
+  SHLIB_LINK := $(subst $(GCC_FOR_TARGET),$(GCC_FOR_TARGET) $(extra_ldflags_libgcc), $(SHLIB_LINK))
 endif
 
 ifeq ($(enable_shared),yes)
--- gcc/libgcc/configure.ac.symbolic	2007-01-06 07:57:28.000000000 -0800
+++ gcc/libgcc/configure.ac	2007-01-12 07:52:14.000000000 -0800
@@ -2,6 +2,8 @@ dnl Process this file with autoconf to p
 
 sinclude(../config/acx.m4)
 sinclude(../config/no-executables.m4)
+sinclude(../config/lib-ld.m4)
+sinclude(../config/ld-symbolic.m4)
 
 AC_PREREQ(2.59)
 AC_INIT([GNU C Runtime Library], 1.0,,[libgcc])
@@ -136,6 +138,11 @@ AC_SUBST(tmake_file)
 AC_SUBST(extra_parts)
 AC_SUBST(asm_hidden_op)
 
+# Substitute GNU linker -Bsymbolic-functions
+ACX_PROG_LD_GNU_SYMBOLIC
+extra_ldflags_libgcc=$SYMBOLIC_LDFLAGS
+AC_SUBST(extra_ldflags_libgcc)
+
 # We need multilib support.
 AC_CONFIG_FILES([Makefile])
 AC_CONFIG_COMMANDS([default],
--- gcc/libgfortran/Makefile.in.symbolic	2007-01-12 07:42:03.000000000 -0800
+++ gcc/libgfortran/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -47,8 +47,10 @@ subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/lead-dot.m4 \
 	$(top_srcdir)/../config/multi.m4 \
-	$(top_srcdir)/../config/stdint.m4 $(top_srcdir)/acinclude.m4 \
-	$(top_srcdir)/../config/acx.m4 \
+	$(top_srcdir)/../config/stdint.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/acx.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
--- gcc/libgfortran/configure.ac.symbolic	2006-12-07 17:07:06.000000000 -0800
+++ gcc/libgfortran/configure.ac	2007-01-12 07:45:02.000000000 -0800
@@ -143,12 +143,17 @@ AC_SUBST(enable_static)
 FC="$GFORTRAN"
 AC_PROG_FC(gfortran)
 
+ACX_PROG_LD_GNU_SYMBOLIC
+
 # extra LD Flags which are required for targets
 case "${host}" in
   *-darwin*)
     # Darwin needs -single_module when linking libgfortran
     extra_ldflags_libgfortran=-Wl,-single_module
     ;;
+  *)
+    extra_ldflags_libgfortran=$SYMBOLIC_LDFLAGS
+    ;;
 esac
 AC_SUBST(extra_ldflags_libgfortran)
 
--- gcc/libgomp/Makefile.in.symbolic	2007-01-12 07:42:03.000000000 -0800
+++ gcc/libgomp/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -53,8 +53,11 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/lead-dot.m4 \
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/stdint.m4 \
-	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/acinclude.m4 \
-	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/../config/tls.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -163,7 +166,6 @@ FC = @FC@
 FCFLAGS = @FCFLAGS@
 GENINSRC_FALSE = @GENINSRC_FALSE@
 GENINSRC_TRUE = @GENINSRC_TRUE@
-GREP = @GREP@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -206,8 +208,11 @@ USE_FORTRAN_TRUE = @USE_FORTRAN_TRUE@
 VERSION = @VERSION@
 XCFLAGS = @XCFLAGS@
 XLDFLAGS = @XLDFLAGS@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__include = @am__include@
@@ -223,9 +228,6 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 config_path = @config_path@
 datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
 enable_shared = @enable_shared@
 enable_static = @enable_static@
 exec_prefix = @exec_prefix@
@@ -234,7 +236,6 @@ host_alias = @host_alias@
 host_cpu = @host_cpu@
 host_os = @host_os@
 host_vendor = @host_vendor@
-htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
@@ -242,16 +243,13 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 libtool_VERSION = @libtool_VERSION@
 link_gomp = @link_gomp@
-localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 multi_basedir = @multi_basedir@
 oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
-psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
--- gcc/libgomp/configure.ac.symbolic	2006-12-26 09:04:53.000000000 -0800
+++ gcc/libgomp/configure.ac	2007-01-12 07:45:02.000000000 -0800
@@ -331,6 +331,9 @@ AC_SUBST(OMP_LOCK_KIND)
 AC_SUBST(OMP_NEST_LOCK_KIND)
 CFLAGS="$save_CFLAGS"
 
+ACX_PROG_LD_GNU_SYMBOLIC
+OPT_LDFLAGS="$OPT_LDFLAGS $SYMBOLIC_LDFLAGS"
+
 AC_CONFIG_FILES(omp.h omp_lib.h omp_lib.f90 libgomp_f.h)
 AC_CONFIG_FILES(Makefile testsuite/Makefile libgomp.spec)
 AC_OUTPUT
--- gcc/libjava/Makefile.am.symbolic	2007-01-11 09:29:13.000000000 -0800
+++ gcc/libjava/Makefile.am	2007-01-12 07:45:02.000000000 -0800
@@ -230,7 +230,8 @@ xlib_nat_files = $(xlib_nat_source_files
 ## The mysterious backslash in the grep pattern is consumed by make.
 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
 	$(LIBLTDL) $(SYS_ZLIBS) \
-	-version-info `grep -v '^\#' $(srcdir)/libtool-version`
+	-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
+	$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
 libgcj_la_LIBADD = \
 	classpath/native/fdlibm/libfdlibm.la \
 	java/lang/Object.lo \
@@ -256,7 +257,8 @@ EXTRA_libgcj_la_SOURCES = java/lang/Obje
 libgcj_tools_la_SOURCES = classpath/tools/tools.zip
 libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch -fno-indirect-classes  -fsource-filename=$(here)/classpath/tools/all-classes.lst
 libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
- -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+ -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
+ $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
 libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec
 libgcj_tools_la_LINK = $(LIBLINK)
 
@@ -299,7 +301,8 @@ lib_gnu_awt_xlib_la_LINK = $(LIBLINK)
 ##
 ## This lets us have one soname in BC objects and another in C++ ABI objects.
 libgcj_bc_la_SOURCES = libgcj_bc.c
-libgcj_bc_la_LDFLAGS = -rpath $(toolexeclibdir) -no-static -version-info 1:0:0
+libgcj_bc_la_LDFLAGS = -rpath $(toolexeclibdir) -no-static -version-info 1:0:0 \
+	$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
 libgcj_bc_la_LIBADD = libgcj.la
 libgcj_bc_la_DEPENDENCIES = libgcj.la
 libgcj_bc_la_LINK = $(LIBLINK)
--- gcc/libjava/Makefile.in.symbolic	2007-01-12 07:42:03.000000000 -0800
+++ gcc/libjava/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -83,6 +83,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/gxx-include-dir.m4 \
 	$(top_srcdir)/../config/iconv.m4 \
 	$(top_srcdir)/../config/lcmessage.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../config/lead-dot.m4 \
 	$(top_srcdir)/../config/lib-ld.m4 \
 	$(top_srcdir)/../config/lib-link.m4 \
@@ -619,6 +620,7 @@ LIBGCJ_CFLAGS = @LIBGCJ_CFLAGS@
 LIBGCJ_CXXFLAGS = @LIBGCJ_CXXFLAGS@
 LIBGCJ_JAVAFLAGS = @LIBGCJ_JAVAFLAGS@
 LIBGCJ_LD_SYMBOLIC = @LIBGCJ_LD_SYMBOLIC@
+LIBGCJ_LD_SYMBOLIC_FUNCTIONS = @LIBGCJ_LD_SYMBOLIC_FUNCTIONS@
 LIBGCJ_SPEC = @LIBGCJ_SPEC@
 LIBICONV = @LIBICONV@
 LIBLTDL = @LIBLTDL@
@@ -872,7 +874,8 @@ xlib_nat_files = $(xlib_nat_source_files
 # certain linuxthread functions get linked:
 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
 	$(LIBLTDL) $(SYS_ZLIBS) \
-	-version-info `grep -v '^\#' $(srcdir)/libtool-version`
+	-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
+	$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
 
 libgcj_la_LIBADD = \
 	classpath/native/fdlibm/libfdlibm.la \
@@ -896,7 +899,8 @@ EXTRA_libgcj_la_SOURCES = java/lang/Obje
 libgcj_tools_la_SOURCES = classpath/tools/tools.zip
 libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch -fno-indirect-classes  -fsource-filename=$(here)/classpath/tools/all-classes.lst
 libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
- -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+ -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
+ $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
 
 libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec
 libgcj_tools_la_LINK = $(LIBLINK)
@@ -923,7 +927,9 @@ lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc
 
 lib_gnu_awt_xlib_la_LINK = $(LIBLINK)
 libgcj_bc_la_SOURCES = libgcj_bc.c
-libgcj_bc_la_LDFLAGS = -rpath $(toolexeclibdir) -no-static -version-info 1:0:0
+libgcj_bc_la_LDFLAGS = -rpath $(toolexeclibdir) -no-static -version-info 1:0:0 \
+	$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
+
 libgcj_bc_la_LIBADD = libgcj.la
 libgcj_bc_la_DEPENDENCIES = libgcj.la
 libgcj_bc_la_LINK = $(LIBLINK)
--- gcc/libjava/configure.ac.symbolic	2007-01-09 16:20:44.000000000 -0800
+++ gcc/libjava/configure.ac	2007-01-12 07:45:02.000000000 -0800
@@ -173,14 +173,22 @@ libgcj_javaflags=
 
 . ${srcdir}/configure.host
 
+ACX_PROG_LD_GNU_SYMBOLIC
+libgcj_ld_symbolic_functions=$SYMBOLIC_LDFLAGS
+if test -z "$libgcj_ld_symbolic"; then
+  libgcj_ld_symbolic=$SYMBOLIC_LDFLAGS
+fi
+
 LIBGCJ_CFLAGS="${libgcj_cflags}"
 LIBGCJ_CXXFLAGS="${libgcj_cxxflags}"
 LIBGCJ_JAVAFLAGS="${libgcj_javaflags}"
 LIBGCJ_LD_SYMBOLIC="${libgcj_ld_symbolic}"
+LIBGCJ_LD_SYMBOLIC_FUNCTIONS="${libgcj_ld_symbolic_functions}"
 AC_SUBST(LIBGCJ_CFLAGS)
 AC_SUBST(LIBGCJ_CXXFLAGS)
 AC_SUBST(LIBGCJ_JAVAFLAGS)
 AC_SUBST(LIBGCJ_LD_SYMBOLIC)
+AC_SUBST(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
 
 # Only use libltdl for non-newlib builds.
 if test "x${with_newlib}" = "x" || test "x${with_newlib}" = "xno"; then
--- gcc/libjava/gcj/Makefile.in.symbolic	2007-01-09 16:20:35.000000000 -0800
+++ gcc/libjava/gcj/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -55,6 +55,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/tls.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \
 	$(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \
 	$(top_srcdir)/configure.ac
--- gcc/libjava/include/Makefile.in.symbolic	2007-01-09 16:20:20.000000000 -0800
+++ gcc/libjava/include/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -54,6 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/tls.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \
 	$(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \
 	$(top_srcdir)/configure.ac
--- gcc/libjava/testsuite/Makefile.in.symbolic	2007-01-09 16:20:23.000000000 -0800
+++ gcc/libjava/testsuite/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -52,6 +52,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/tls.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \
 	$(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \
 	$(top_srcdir)/configure.ac
--- gcc/libmudflap/Makefile.am.symbolic	2006-11-18 06:27:15.000000000 -0800
+++ gcc/libmudflap/Makefile.am	2007-01-12 07:45:02.000000000 -0800
@@ -34,7 +34,7 @@ libmudflap_la_SOURCES = \
 	mf-hooks2.c
 libmudflap_la_LIBADD = 
 libmudflap_la_DEPENDENCIES = $(libmudflap_la_LIBADD)
-libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libmudflap)
 
 clean-local:
 	rm -f pth/*.o pth/*.lo
@@ -59,7 +59,7 @@ libmudflapth_la_LIBADD = \
 	pth/mf-hooks2.lo \
 	pth/mf-hooks3.lo
 libmudflapth_la_DEPENDENCIES = $(libmudflapth_la_LIBADD)
-libmudflapth_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libmudflapth_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libmudflap)
 
 
 # XXX hack alert
--- gcc/libmudflap/Makefile.in.symbolic	2006-11-18 06:27:15.000000000 -0800
+++ gcc/libmudflap/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -50,7 +50,10 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
 	$(top_srcdir)/../config/depstand.m4 \
 	$(top_srcdir)/../config/enable.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../config/lead-dot.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -192,6 +195,7 @@ datadir = @datadir@
 enable_shared = @enable_shared@
 enable_static = @enable_static@
 exec_prefix = @exec_prefix@
+extra_ldflags_libmudflap = @extra_ldflags_libmudflap@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -241,7 +245,7 @@ libmudflap_la_SOURCES = \
 
 libmudflap_la_LIBADD = 
 libmudflap_la_DEPENDENCIES = $(libmudflap_la_LIBADD)
-libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libmudflap)
 libmudflapth_la_SOURCES = 
 libmudflapth_la_LIBADD = \
 	pth/mf-runtime.lo \
@@ -251,7 +255,7 @@ libmudflapth_la_LIBADD = \
 	pth/mf-hooks3.lo
 
 libmudflapth_la_DEPENDENCIES = $(libmudflapth_la_LIBADD)
-libmudflapth_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libmudflapth_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libmudflap)
 
 # XXX hack alert
 # From libffi/Makefile.am
--- gcc/libmudflap/configure.ac.symbolic	2006-11-18 06:27:15.000000000 -0800
+++ gcc/libmudflap/configure.ac	2007-01-12 07:45:02.000000000 -0800
@@ -256,6 +256,9 @@ fi
 AC_DEFINE_UNQUOTED([ENTRY_POINT], [$mudflap_cv_entry_point],
   [Define to the name of the symbol used for the entry point.])
 
+ACX_PROG_LD_GNU_SYMBOLIC
+extra_ldflags_libmudflap=$SYMBOLIC_LDFLAGS
+AC_SUBST(extra_ldflags_libmudflap)
 
 if test ${multilib} = yes; then
   multilib_arg="--enable-multilib"
--- gcc/libobjc/configure.ac.symbolic	2006-11-18 06:27:04.000000000 -0800
+++ gcc/libobjc/configure.ac	2007-01-12 07:45:02.000000000 -0800
@@ -156,12 +156,17 @@ m4_define([_AC_ARG_VAR_PRECIOUS],[])
 AC_PROG_CC
 m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
+ACX_PROG_LD_GNU_SYMBOLIC
+
 # extra LD Flags which are required for targets
 case "${host}" in
   *-darwin*)
     # Darwin needs -single_module when linking libobjc
     extra_ldflags_libobjc=-Wl,-single_module
     ;;
+  *)
+    extra_ldflags_libobjc=$SYMBOLIC_LDFLAGS
+    ;;
 esac
 AC_SUBST(extra_ldflags_libobjc)
 
--- gcc/libssp/Makefile.am.symbolic	2006-11-18 06:27:24.000000000 -0800
+++ gcc/libssp/Makefile.am	2007-01-12 07:45:02.000000000 -0800
@@ -35,7 +35,7 @@ libssp_la_SOURCES = \
 libssp_la_LIBADD = 
 libssp_la_DEPENDENCIES = $(version_dep) $(libssp_la_LIBADD)
 libssp_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
-		    $(version_arg)
+		    $(version_arg) $(extra_ldflags_libssp)
 
 libssp_nonshared_la_SOURCES = \
 	ssp-local.c
--- gcc/libssp/Makefile.in.symbolic	2006-11-18 06:27:24.000000000 -0800
+++ gcc/libssp/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -15,8 +15,6 @@
 @SET_MAKE@
 
 
-SOURCES = $(libssp_la_SOURCES) $(libssp_nonshared_la_SOURCES)
-
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 VPATH = @srcdir@
@@ -52,7 +50,10 @@ subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
 	$(top_srcdir)/../config/depstand.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../config/lead-dot.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -182,6 +183,7 @@ datadir = @datadir@
 enable_shared = @enable_shared@
 enable_static = @enable_static@
 exec_prefix = @exec_prefix@
+extra_ldflags_libssp = @extra_ldflags_libssp@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -234,7 +236,7 @@ libssp_la_SOURCES = \
 libssp_la_LIBADD = 
 libssp_la_DEPENDENCIES = $(version_dep) $(libssp_la_LIBADD)
 libssp_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
-		    $(version_arg)
+		    $(version_arg) $(extra_ldflags_libssp)
 
 libssp_nonshared_la_SOURCES = \
 	ssp-local.c
--- gcc/libssp/configure.ac.symbolic	2006-11-18 06:27:24.000000000 -0800
+++ gcc/libssp/configure.ac	2007-01-12 07:45:02.000000000 -0800
@@ -164,6 +164,10 @@ esac
 AC_SUBST(toolexecdir)
 AC_SUBST(toolexeclibdir)
 
+ACX_PROG_LD_GNU_SYMBOLIC
+extra_ldflags_libssp=$SYMBOLIC_LDFLAGS
+AC_SUBST(extra_ldflags_libssp)
+
 if test ${multilib} = yes; then
   multilib_arg="--enable-multilib"
 else
--- gcc/libstdc++-v3/Makefile.in.symbolic	2006-11-18 06:27:00.000000000 -0800
+++ gcc/libstdc++-v3/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -50,6 +50,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/configure.ac.symbolic	2006-11-18 06:27:00.000000000 -0800
+++ gcc/libstdc++-v3/configure.ac	2007-01-12 07:45:02.000000000 -0800
@@ -403,5 +403,8 @@ _EOF
 SUBDIRS="$SUBDIRS"
 ])
 
+ACX_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW
+OPT_LDFLAGS="$OPT_LDFLAGS $DYNAMIC_LIST_CPP_NEW_LDFLAGS"
+
 dnl And this actually makes things happen:
 AC_OUTPUT
--- gcc/libstdc++-v3/include/Makefile.in.symbolic	2006-12-07 17:07:03.000000000 -0800
+++ gcc/libstdc++-v3/include/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/libmath/Makefile.in.symbolic	2006-11-18 06:26:24.000000000 -0800
+++ gcc/libstdc++-v3/libmath/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/libsupc++/Makefile.in.symbolic	2006-11-18 06:26:35.000000000 -0800
+++ gcc/libstdc++-v3/libsupc++/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -47,6 +47,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/po/Makefile.in.symbolic	2006-11-18 06:27:00.000000000 -0800
+++ gcc/libstdc++-v3/po/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/src/Makefile.in.symbolic	2006-11-18 06:26:36.000000000 -0800
+++ gcc/libstdc++-v3/src/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/testsuite/Makefile.in.symbolic	2006-11-18 06:26:56.000000000 -0800
+++ gcc/libstdc++-v3/testsuite/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-12 18:52                                 ` H. J. Lu
@ 2007-01-13 13:48                                   ` Paolo Bonzini
  2007-01-13 14:51                                     ` H. J. Lu
                                                       ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Paolo Bonzini @ 2007-01-13 13:48 UTC (permalink / raw)
  To: H. J. Lu; +Cc: gcc-patches


>> Since I used -Bsymbolic-functions, it has no effect on data symbols.
>>
> 
> I extended -Bsymbolic-functions to libffi, libjava, libmudflap,
> libssp and libgcc. There are no regressions:
> 
> http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00511.html
> http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00510.html
> http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00509.html
> 
> If we apply -Bsymbolic-functions to all shared libraries on a system,
> it will improve application startup time and overall runtime
> performance.

Good.  As before, however, I don't understand the overall effect well
enough to give an approval myself.  Therefore, I suggest that you get
the approval of a GWP person (since some of these libraries have no
overall maintainer).

Otherwise, if you get approval for libgcc, libjava, libobjc,
libstdc++-v3, I will approve the rest.

Thanks for the patience,

Paolo


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-13 13:48                                   ` Paolo Bonzini
@ 2007-01-13 14:51                                     ` H. J. Lu
  2007-01-13 17:12                                     ` Andrew Pinski
  2007-01-14 13:04                                     ` Andrew Haley
  2 siblings, 0 replies; 24+ messages in thread
From: H. J. Lu @ 2007-01-13 14:51 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: gcc-patches, wilson

On Sat, Jan 13, 2007 at 02:47:47PM +0100, Paolo Bonzini wrote:
> 
> >>Since I used -Bsymbolic-functions, it has no effect on data symbols.
> >>
> >
> >I extended -Bsymbolic-functions to libffi, libjava, libmudflap,
> >libssp and libgcc. There are no regressions:
> >
> >http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00511.html
> >http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00510.html
> >http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00509.html
> >
> >If we apply -Bsymbolic-functions to all shared libraries on a system,
> >it will improve application startup time and overall runtime
> >performance.
> 
> Good.  As before, however, I don't understand the overall effect well
> enough to give an approval myself.  Therefore, I suggest that you get
> the approval of a GWP person (since some of these libraries have no
> overall maintainer).
> 

Hi Jim,

Is that possible for you to review this patch. Basically, the impact
of my patch on programmers is that they can no longer override
global functions in gcc libraries. It is OK since functions
in gcc libraries aren't supposed to be overridable unless they
are overridable as specified in language standards. Overriding
global functions in gcc libraries can lead runtime errors. If a global
function in gcc is overridable, there should be a testcase in gcc to
ensure that, just like C++ operator new/delete, which remain
overridable in my patch and work correctly as indicated in gcc
testsuites.

Thanks.


H.J.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-13 13:48                                   ` Paolo Bonzini
  2007-01-13 14:51                                     ` H. J. Lu
@ 2007-01-13 17:12                                     ` Andrew Pinski
  2007-01-13 17:32                                       ` H. J. Lu
  2007-01-14 13:04                                     ` Andrew Haley
  2 siblings, 1 reply; 24+ messages in thread
From: Andrew Pinski @ 2007-01-13 17:12 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: H. J. Lu, gcc-patches

> 
> 
> >> Since I used -Bsymbolic-functions, it has no effect on data symbols.
> >>
> > 
> > I extended -Bsymbolic-functions to libffi, libjava, libmudflap,
> > libssp and libgcc. There are no regressions:
> > 
> > http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00511.html
> > http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00510.html
> > http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00509.html
> > 
> > If we apply -Bsymbolic-functions to all shared libraries on a system,
> > it will improve application startup time and overall runtime
> > performance.
> 
> Good.  As before, however, I don't understand the overall effect well
> enough to give an approval myself.  Therefore, I suggest that you get
> the approval of a GWP person (since some of these libraries have no
> overall maintainer).
> 
> Otherwise, if you get approval for libgcc, libjava, libobjc,
> libstdc++-v3, I will approve the rest.

It is wrong for libobjc to have this option.  People should be able
to override the functions so they can debug their stuff.

-- Pinski

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-13 17:12                                     ` Andrew Pinski
@ 2007-01-13 17:32                                       ` H. J. Lu
  0 siblings, 0 replies; 24+ messages in thread
From: H. J. Lu @ 2007-01-13 17:32 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Paolo Bonzini, gcc-patches

On Sat, Jan 13, 2007 at 12:13:09PM -0500, Andrew Pinski wrote:
> > 
> > 
> > >> Since I used -Bsymbolic-functions, it has no effect on data symbols.
> > >>
> > > 
> > > I extended -Bsymbolic-functions to libffi, libjava, libmudflap,
> > > libssp and libgcc. There are no regressions:
> > > 
> > > http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00511.html
> > > http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00510.html
> > > http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00509.html
> > > 
> > > If we apply -Bsymbolic-functions to all shared libraries on a system,
> > > it will improve application startup time and overall runtime
> > > performance.
> > 
> > Good.  As before, however, I don't understand the overall effect well
> > enough to give an approval myself.  Therefore, I suggest that you get
> > the approval of a GWP person (since some of these libraries have no
> > overall maintainer).
> > 
> > Otherwise, if you get approval for libgcc, libjava, libobjc,
> > libstdc++-v3, I will approve the rest.
> 
> It is wrong for libobjc to have this option.  People should be able
> to override the functions so they can debug their stuff.

Is there a list of functions in libobjc which can be overriden when
linking statically?


H.J.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-13 13:48                                   ` Paolo Bonzini
  2007-01-13 14:51                                     ` H. J. Lu
  2007-01-13 17:12                                     ` Andrew Pinski
@ 2007-01-14 13:04                                     ` Andrew Haley
  2007-01-14 15:46                                       ` H. J. Lu
  2 siblings, 1 reply; 24+ messages in thread
From: Andrew Haley @ 2007-01-14 13:04 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: H. J. Lu, gcc-patches

Paolo Bonzini writes:
 > 
 > >> Since I used -Bsymbolic-functions, it has no effect on data symbols.
 > >>
 > > 
 > > I extended -Bsymbolic-functions to libffi, libjava, libmudflap,
 > > libssp and libgcc. There are no regressions:
 > > 
 > > http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00511.html
 > > http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00510.html
 > > http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00509.html
 > > 
 > > If we apply -Bsymbolic-functions to all shared libraries on a system,
 > > it will improve application startup time and overall runtime
 > > performance.
 > 
 > Good.  As before, however, I don't understand the overall effect well
 > enough to give an approval myself.  Therefore, I suggest that you get
 > the approval of a GWP person (since some of these libraries have no
 > overall maintainer).
 > 
 > Otherwise, if you get approval for libgcc, libjava, libobjc,
 > libstdc++-v3, I will approve the rest.

OK for libjava.

Andrew.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-14 13:04                                     ` Andrew Haley
@ 2007-01-14 15:46                                       ` H. J. Lu
  2007-01-14 18:29                                         ` Andrew Pinski
  0 siblings, 1 reply; 24+ messages in thread
From: H. J. Lu @ 2007-01-14 15:46 UTC (permalink / raw)
  To: Andrew Haley; +Cc: Paolo Bonzini, gcc-patches

On Sun, Jan 14, 2007 at 01:04:22PM +0000, Andrew Haley wrote:
> Paolo Bonzini writes:
>  > 
>  > >> Since I used -Bsymbolic-functions, it has no effect on data symbols.
>  > >>
>  > > 
>  > > I extended -Bsymbolic-functions to libffi, libjava, libmudflap,
>  > > libssp and libgcc. There are no regressions:
>  > > 
>  > > http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00511.html
>  > > http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00510.html
>  > > http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00509.html
>  > > 
>  > > If we apply -Bsymbolic-functions to all shared libraries on a system,
>  > > it will improve application startup time and overall runtime
>  > > performance.
>  > 
>  > Good.  As before, however, I don't understand the overall effect well
>  > enough to give an approval myself.  Therefore, I suggest that you get
>  > the approval of a GWP person (since some of these libraries have no
>  > overall maintainer).
>  > 
>  > Otherwise, if you get approval for libgcc, libjava, libobjc,
>  > libstdc++-v3, I will approve the rest.
> 
> OK for libjava.
> 

I checked in the libjava part. Here is the updated patch for other
libraries. If someone can give me a list of functions in libobjc
which should be overridable, I will add them to the dynamic list
for libobjc.

Thanks.

H.J.
-----
libffi/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (ACLOCAL_AMFLAGS): Add -I ../config.
	(libffi_la_LDFLAGS): Add $(extra_ldflags_libffi)
	* Makefile.in: Regenerated.

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libffi to $SYMBOLIC_LDFLAGS.  Substitute
	extra_ldflags_libffi.
	* configure: Regenerated.
	* aclocal.m4: Likewise.

libgcc/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.in (extra_ldflags_libgcc): New.
	(SHLIB_LINK): Add $(extra_ldflags_libgcc).

	* configure.ac: Include ../config/lib-ld.m4 and
	../config/ld-symbolic.m4.  Usde ACX_PROG_LD_GNU_SYMBOLIC. Set
	extra_ldflags_libgcc to $SYMBOLIC_LDFLAGS.  Substitute
	extra_ldflags_libgcc.
	* configure: Regenerated.

libgfortran/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libgfortran to $SYMBOLIC_LDFLAGS if it isn't set.
	* configure: Regenerated.
	* aclocal.m4: Likewise.
	* Makefile.in: Likewise.

libgomp/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Add
	$SYMBOLIC_LDFLAGS to OPT_LDFLAGS.
	* configure: Regenerated.
	* aclocal.m4: Likewise.
	* Makefile.in: Likewise.

libmudflap/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (libmudflap_la_LDFLAGS): Add
	$(extra_ldflags_libmudflap).
	(libmudflapth_la_LDFLAGS): Likewise.
	* Makefile.in: Regenerated.

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libmudflap to $SYMBOLIC_LDFLAGS.  Substitute
	extra_ldflags_libmudflap.
	* configure: Regenerated.
	* aclocal.m4: Likewise.

libobjc/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libobjc to $SYMBOLIC_LDFLAGS if it isn't set.
	* configure: Regenerated.
	* aclocal.m4: Likewise.

libssp/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (libssp_la_LDFLAGS): Add $(extra_ldflags_libssp).
	* Makefile.in: Regenerated.

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libssp to $SYMBOLIC_LDFLAGS.  Substitute
	extra_ldflags_libssp.
	* configure: Regenerated.
	* aclocal.m4: Likewise.

libstdc++-v3/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW.  Add
	$DYNAMIC_LIST_CPP_NEW_LDFLAGS to OPT_LDFLAGS.
	* configure: Regenerated.
	* aclocal.m4: Likewise.
	* Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* libmath/Makefile.in: Likewise.
	* libsupc++/Makefile.in: Likewise.
	* po/Makefile.in: Likewise.
	* src/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

--- gcc/libffi/Makefile.am.symbolic	2006-12-14 09:01:37.000000000 -0800
+++ gcc/libffi/Makefile.am	2007-01-12 07:45:01.000000000 -0800
@@ -1,7 +1,7 @@
 ## Process this with automake to create Makefile.in
 
 AUTOMAKE_OPTIONS = foreign subdir-objects
-ACLOCAL_AMFLAGS = -I ..
+ACLOCAL_AMFLAGS = -I .. -I ../config
 
 SUBDIRS = include testsuite
 
@@ -157,7 +157,7 @@ nodist_libffi_convenience_la_SOURCES = $
 
 AM_CFLAGS = -Wall -g -fexceptions
 
-libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libffi)
 
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
 AM_CCASFLAGS = $(AM_CPPFLAGS)
--- gcc/libffi/Makefile.in.symbolic	2006-12-14 09:01:37.000000000 -0800
+++ gcc/libffi/Makefile.in	2007-01-12 07:45:01.000000000 -0800
@@ -69,7 +69,11 @@ DIST_COMMON = README $(am__configure_dep
 	$(top_srcdir)/configure ChangeLog
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
+	$(top_srcdir)/../config/lead-dot.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/multi.m4 $(top_srcdir)/../libtool.m4 \
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -318,6 +322,7 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+extra_ldflags_libffi = @extra_ldflags_libffi@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -346,7 +351,7 @@ target_vendor = @target_vendor@
 toolexecdir = @toolexecdir@
 toolexeclibdir = @toolexeclibdir@
 AUTOMAKE_OPTIONS = foreign subdir-objects
-ACLOCAL_AMFLAGS = -I ..
+ACLOCAL_AMFLAGS = -I .. -I ../config
 SUBDIRS = include testsuite
 EXTRA_DIST = LICENSE ChangeLog.v1 \
 	src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \
@@ -427,7 +432,7 @@ nodist_libffi_la_SOURCES = $(am__append_
 libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
 AM_CFLAGS = -Wall -g -fexceptions
-libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libffi)
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
 AM_CCASFLAGS = $(AM_CPPFLAGS)
 all: fficonfig.h
@@ -1059,7 +1064,7 @@ distclean-tags:
 distdir: $(DISTFILES)
 	$(am__remove_distdir)
 	mkdir $(distdir)
-	$(mkdir_p) $(distdir)/.. $(distdir)/include $(distdir)/src/alpha $(distdir)/src/arm $(distdir)/src/cris $(distdir)/src/frv $(distdir)/src/m32r $(distdir)/src/m68k $(distdir)/src/mips $(distdir)/src/pa $(distdir)/src/powerpc $(distdir)/src/s390 $(distdir)/src/sh $(distdir)/src/sh64 $(distdir)/src/sparc $(distdir)/src/x86
+	$(mkdir_p) $(distdir)/.. $(distdir)/../config $(distdir)/include $(distdir)/src/alpha $(distdir)/src/arm $(distdir)/src/cris $(distdir)/src/frv $(distdir)/src/m32r $(distdir)/src/m68k $(distdir)/src/mips $(distdir)/src/pa $(distdir)/src/powerpc $(distdir)/src/s390 $(distdir)/src/sh $(distdir)/src/sh64 $(distdir)/src/sparc $(distdir)/src/x86
 	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
 	list='$(DISTFILES)'; for file in $$list; do \
--- gcc/libffi/configure.ac.symbolic	2006-12-14 09:01:37.000000000 -0800
+++ gcc/libffi/configure.ac	2007-01-12 07:45:01.000000000 -0800
@@ -276,6 +276,10 @@ esac
 AC_SUBST(toolexecdir)
 AC_SUBST(toolexeclibdir)
 
+ACX_PROG_LD_GNU_SYMBOLIC
+extra_ldflags_libffi=$SYMBOLIC_LDFLAGS
+AC_SUBST(extra_ldflags_libffi)
+
 if test "${multilib}" = "yes"; then
   multilib_arg="--enable-multilib"
 else
--- gcc/libgcc/Makefile.in.symbolic	2007-01-06 07:57:28.000000000 -0800
+++ gcc/libgcc/Makefile.in	2007-01-12 09:08:29.000000000 -0800
@@ -38,6 +38,8 @@ SHELL = @SHELL@
 enable_shared = @enable_shared@
 decimal_float = @decimal_float@
 
+extra_ldflags_libgcc = @extra_ldflags_libgcc@
+
 host_noncanonical = @host_noncanonical@
 
 # List of extra object files that should be compiled for this target machine.
@@ -224,6 +226,8 @@ include $(srcdir)/empty.mk $(tmake_file)
 #   - we know how to build them
 ifeq ($(SHLIB_LINK),)
   enable_shared := no
+else
+  SHLIB_LINK := $(subst $(GCC_FOR_TARGET),$(GCC_FOR_TARGET) $(extra_ldflags_libgcc), $(SHLIB_LINK))
 endif
 
 ifeq ($(enable_shared),yes)
--- gcc/libgcc/configure.ac.symbolic	2007-01-06 07:57:28.000000000 -0800
+++ gcc/libgcc/configure.ac	2007-01-12 07:52:14.000000000 -0800
@@ -2,6 +2,8 @@ dnl Process this file with autoconf to p
 
 sinclude(../config/acx.m4)
 sinclude(../config/no-executables.m4)
+sinclude(../config/lib-ld.m4)
+sinclude(../config/ld-symbolic.m4)
 
 AC_PREREQ(2.59)
 AC_INIT([GNU C Runtime Library], 1.0,,[libgcc])
@@ -136,6 +138,11 @@ AC_SUBST(tmake_file)
 AC_SUBST(extra_parts)
 AC_SUBST(asm_hidden_op)
 
+# Substitute GNU linker -Bsymbolic-functions
+ACX_PROG_LD_GNU_SYMBOLIC
+extra_ldflags_libgcc=$SYMBOLIC_LDFLAGS
+AC_SUBST(extra_ldflags_libgcc)
+
 # We need multilib support.
 AC_CONFIG_FILES([Makefile])
 AC_CONFIG_COMMANDS([default],
--- gcc/libgfortran/Makefile.in.symbolic	2007-01-12 07:42:03.000000000 -0800
+++ gcc/libgfortran/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -47,8 +47,10 @@ subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/lead-dot.m4 \
 	$(top_srcdir)/../config/multi.m4 \
-	$(top_srcdir)/../config/stdint.m4 $(top_srcdir)/acinclude.m4 \
-	$(top_srcdir)/../config/acx.m4 \
+	$(top_srcdir)/../config/stdint.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/acx.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
--- gcc/libgfortran/configure.ac.symbolic	2006-12-07 17:07:06.000000000 -0800
+++ gcc/libgfortran/configure.ac	2007-01-12 07:45:02.000000000 -0800
@@ -143,12 +143,17 @@ AC_SUBST(enable_static)
 FC="$GFORTRAN"
 AC_PROG_FC(gfortran)
 
+ACX_PROG_LD_GNU_SYMBOLIC
+
 # extra LD Flags which are required for targets
 case "${host}" in
   *-darwin*)
     # Darwin needs -single_module when linking libgfortran
     extra_ldflags_libgfortran=-Wl,-single_module
     ;;
+  *)
+    extra_ldflags_libgfortran=$SYMBOLIC_LDFLAGS
+    ;;
 esac
 AC_SUBST(extra_ldflags_libgfortran)
 
--- gcc/libgomp/Makefile.in.symbolic	2007-01-12 07:42:03.000000000 -0800
+++ gcc/libgomp/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -53,8 +53,11 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/lead-dot.m4 \
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/stdint.m4 \
-	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/acinclude.m4 \
-	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/../config/tls.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -163,7 +166,6 @@ FC = @FC@
 FCFLAGS = @FCFLAGS@
 GENINSRC_FALSE = @GENINSRC_FALSE@
 GENINSRC_TRUE = @GENINSRC_TRUE@
-GREP = @GREP@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -206,8 +208,11 @@ USE_FORTRAN_TRUE = @USE_FORTRAN_TRUE@
 VERSION = @VERSION@
 XCFLAGS = @XCFLAGS@
 XLDFLAGS = @XLDFLAGS@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__include = @am__include@
@@ -223,9 +228,6 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 config_path = @config_path@
 datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
 enable_shared = @enable_shared@
 enable_static = @enable_static@
 exec_prefix = @exec_prefix@
@@ -234,7 +236,6 @@ host_alias = @host_alias@
 host_cpu = @host_cpu@
 host_os = @host_os@
 host_vendor = @host_vendor@
-htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
@@ -242,16 +243,13 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 libtool_VERSION = @libtool_VERSION@
 link_gomp = @link_gomp@
-localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 multi_basedir = @multi_basedir@
 oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
-psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
--- gcc/libgomp/configure.ac.symbolic	2006-12-26 09:04:53.000000000 -0800
+++ gcc/libgomp/configure.ac	2007-01-12 07:45:02.000000000 -0800
@@ -331,6 +331,9 @@ AC_SUBST(OMP_LOCK_KIND)
 AC_SUBST(OMP_NEST_LOCK_KIND)
 CFLAGS="$save_CFLAGS"
 
+ACX_PROG_LD_GNU_SYMBOLIC
+OPT_LDFLAGS="$OPT_LDFLAGS $SYMBOLIC_LDFLAGS"
+
 AC_CONFIG_FILES(omp.h omp_lib.h omp_lib.f90 libgomp_f.h)
 AC_CONFIG_FILES(Makefile testsuite/Makefile libgomp.spec)
 AC_OUTPUT
--- gcc/libmudflap/Makefile.am.symbolic	2006-11-18 06:27:15.000000000 -0800
+++ gcc/libmudflap/Makefile.am	2007-01-12 07:45:02.000000000 -0800
@@ -34,7 +34,7 @@ libmudflap_la_SOURCES = \
 	mf-hooks2.c
 libmudflap_la_LIBADD = 
 libmudflap_la_DEPENDENCIES = $(libmudflap_la_LIBADD)
-libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libmudflap)
 
 clean-local:
 	rm -f pth/*.o pth/*.lo
@@ -59,7 +59,7 @@ libmudflapth_la_LIBADD = \
 	pth/mf-hooks2.lo \
 	pth/mf-hooks3.lo
 libmudflapth_la_DEPENDENCIES = $(libmudflapth_la_LIBADD)
-libmudflapth_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libmudflapth_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libmudflap)
 
 
 # XXX hack alert
--- gcc/libmudflap/Makefile.in.symbolic	2006-11-18 06:27:15.000000000 -0800
+++ gcc/libmudflap/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -50,7 +50,10 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
 	$(top_srcdir)/../config/depstand.m4 \
 	$(top_srcdir)/../config/enable.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../config/lead-dot.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -192,6 +195,7 @@ datadir = @datadir@
 enable_shared = @enable_shared@
 enable_static = @enable_static@
 exec_prefix = @exec_prefix@
+extra_ldflags_libmudflap = @extra_ldflags_libmudflap@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -241,7 +245,7 @@ libmudflap_la_SOURCES = \
 
 libmudflap_la_LIBADD = 
 libmudflap_la_DEPENDENCIES = $(libmudflap_la_LIBADD)
-libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libmudflap)
 libmudflapth_la_SOURCES = 
 libmudflapth_la_LIBADD = \
 	pth/mf-runtime.lo \
@@ -251,7 +255,7 @@ libmudflapth_la_LIBADD = \
 	pth/mf-hooks3.lo
 
 libmudflapth_la_DEPENDENCIES = $(libmudflapth_la_LIBADD)
-libmudflapth_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libmudflapth_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libmudflap)
 
 # XXX hack alert
 # From libffi/Makefile.am
--- gcc/libmudflap/configure.ac.symbolic	2006-11-18 06:27:15.000000000 -0800
+++ gcc/libmudflap/configure.ac	2007-01-12 07:45:02.000000000 -0800
@@ -256,6 +256,9 @@ fi
 AC_DEFINE_UNQUOTED([ENTRY_POINT], [$mudflap_cv_entry_point],
   [Define to the name of the symbol used for the entry point.])
 
+ACX_PROG_LD_GNU_SYMBOLIC
+extra_ldflags_libmudflap=$SYMBOLIC_LDFLAGS
+AC_SUBST(extra_ldflags_libmudflap)
 
 if test ${multilib} = yes; then
   multilib_arg="--enable-multilib"
--- gcc/libobjc/configure.ac.symbolic	2006-11-18 06:27:04.000000000 -0800
+++ gcc/libobjc/configure.ac	2007-01-12 07:45:02.000000000 -0800
@@ -156,12 +156,17 @@ m4_define([_AC_ARG_VAR_PRECIOUS],[])
 AC_PROG_CC
 m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
+ACX_PROG_LD_GNU_SYMBOLIC
+
 # extra LD Flags which are required for targets
 case "${host}" in
   *-darwin*)
     # Darwin needs -single_module when linking libobjc
     extra_ldflags_libobjc=-Wl,-single_module
     ;;
+  *)
+    extra_ldflags_libobjc=$SYMBOLIC_LDFLAGS
+    ;;
 esac
 AC_SUBST(extra_ldflags_libobjc)
 
--- gcc/libssp/Makefile.am.symbolic	2006-11-18 06:27:24.000000000 -0800
+++ gcc/libssp/Makefile.am	2007-01-12 07:45:02.000000000 -0800
@@ -35,7 +35,7 @@ libssp_la_SOURCES = \
 libssp_la_LIBADD = 
 libssp_la_DEPENDENCIES = $(version_dep) $(libssp_la_LIBADD)
 libssp_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
-		    $(version_arg)
+		    $(version_arg) $(extra_ldflags_libssp)
 
 libssp_nonshared_la_SOURCES = \
 	ssp-local.c
--- gcc/libssp/Makefile.in.symbolic	2006-11-18 06:27:24.000000000 -0800
+++ gcc/libssp/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -15,8 +15,6 @@
 @SET_MAKE@
 
 
-SOURCES = $(libssp_la_SOURCES) $(libssp_nonshared_la_SOURCES)
-
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 VPATH = @srcdir@
@@ -52,7 +50,10 @@ subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
 	$(top_srcdir)/../config/depstand.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../config/lead-dot.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -182,6 +183,7 @@ datadir = @datadir@
 enable_shared = @enable_shared@
 enable_static = @enable_static@
 exec_prefix = @exec_prefix@
+extra_ldflags_libssp = @extra_ldflags_libssp@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -234,7 +236,7 @@ libssp_la_SOURCES = \
 libssp_la_LIBADD = 
 libssp_la_DEPENDENCIES = $(version_dep) $(libssp_la_LIBADD)
 libssp_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
-		    $(version_arg)
+		    $(version_arg) $(extra_ldflags_libssp)
 
 libssp_nonshared_la_SOURCES = \
 	ssp-local.c
--- gcc/libssp/configure.ac.symbolic	2006-11-18 06:27:24.000000000 -0800
+++ gcc/libssp/configure.ac	2007-01-12 07:45:02.000000000 -0800
@@ -164,6 +164,10 @@ esac
 AC_SUBST(toolexecdir)
 AC_SUBST(toolexeclibdir)
 
+ACX_PROG_LD_GNU_SYMBOLIC
+extra_ldflags_libssp=$SYMBOLIC_LDFLAGS
+AC_SUBST(extra_ldflags_libssp)
+
 if test ${multilib} = yes; then
   multilib_arg="--enable-multilib"
 else
--- gcc/libstdc++-v3/Makefile.in.symbolic	2006-11-18 06:27:00.000000000 -0800
+++ gcc/libstdc++-v3/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -50,6 +50,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/configure.ac.symbolic	2006-11-18 06:27:00.000000000 -0800
+++ gcc/libstdc++-v3/configure.ac	2007-01-12 07:45:02.000000000 -0800
@@ -403,5 +403,8 @@ _EOF
 SUBDIRS="$SUBDIRS"
 ])
 
+ACX_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW
+OPT_LDFLAGS="$OPT_LDFLAGS $DYNAMIC_LIST_CPP_NEW_LDFLAGS"
+
 dnl And this actually makes things happen:
 AC_OUTPUT
--- gcc/libstdc++-v3/include/Makefile.in.symbolic	2006-12-07 17:07:03.000000000 -0800
+++ gcc/libstdc++-v3/include/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/libmath/Makefile.in.symbolic	2006-11-18 06:26:24.000000000 -0800
+++ gcc/libstdc++-v3/libmath/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/libsupc++/Makefile.in.symbolic	2006-11-18 06:26:35.000000000 -0800
+++ gcc/libstdc++-v3/libsupc++/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -47,6 +47,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/po/Makefile.in.symbolic	2006-11-18 06:27:00.000000000 -0800
+++ gcc/libstdc++-v3/po/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/src/Makefile.in.symbolic	2006-11-18 06:26:36.000000000 -0800
+++ gcc/libstdc++-v3/src/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/testsuite/Makefile.in.symbolic	2006-11-18 06:26:56.000000000 -0800
+++ gcc/libstdc++-v3/testsuite/Makefile.in	2007-01-12 07:45:02.000000000 -0800
@@ -45,6 +45,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-14 15:46                                       ` H. J. Lu
@ 2007-01-14 18:29                                         ` Andrew Pinski
  2007-01-14 18:47                                           ` H. J. Lu
  0 siblings, 1 reply; 24+ messages in thread
From: Andrew Pinski @ 2007-01-14 18:29 UTC (permalink / raw)
  To: H. J. Lu; +Cc: Andrew Haley, Paolo Bonzini, gcc-patches

> I checked in the libjava part. Here is the updated patch for other
> libraries. If someone can give me a list of functions in libobjc
> which should be overridable, I will add them to the dynamic list
> for libobjc.

All except for the class functions themselves.  For libobjc, a better
way of doing this is actually marking the class methods as hidden as they
are never called directly.

-- Pinski

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-14 18:29                                         ` Andrew Pinski
@ 2007-01-14 18:47                                           ` H. J. Lu
  2007-01-31 22:20                                             ` H. J. Lu
  0 siblings, 1 reply; 24+ messages in thread
From: H. J. Lu @ 2007-01-14 18:47 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Andrew Haley, Paolo Bonzini, gcc-patches

On Sun, Jan 14, 2007 at 01:30:07PM -0500, Andrew Pinski wrote:
> > I checked in the libjava part. Here is the updated patch for other
> > libraries. If someone can give me a list of functions in libobjc
> > which should be overridable, I will add them to the dynamic list
> > for libobjc.
> 
> All except for the class functions themselves.  For libobjc, a better
> way of doing this is actually marking the class methods as hidden as they
> are never called directly.

I assume *.m files have class functions and other files have non-class
functions which may be overrable by programmers. Is that correct?

What about functuons with the prefixes of __?


H.J.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-14 18:47                                           ` H. J. Lu
@ 2007-01-31 22:20                                             ` H. J. Lu
  2007-01-31 22:24                                               ` Andrew Pinski
  0 siblings, 1 reply; 24+ messages in thread
From: H. J. Lu @ 2007-01-31 22:20 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Andrew Haley, Paolo Bonzini, gcc-patches

On Sun, Jan 14, 2007 at 10:47:41AM -0800, H. J. Lu wrote:
> On Sun, Jan 14, 2007 at 01:30:07PM -0500, Andrew Pinski wrote:
> > > I checked in the libjava part. Here is the updated patch for other
> > > libraries. If someone can give me a list of functions in libobjc
> > > which should be overridable, I will add them to the dynamic list
> > > for libobjc.
> > 
> > All except for the class functions themselves.  For libobjc, a better
> > way of doing this is actually marking the class methods as hidden as they
> > are never called directly.
> 
> I assume *.m files have class functions and other files have non-class
> functions which may be overrable by programmers. Is that correct?
> 
> What about functuons with the prefixes of __?

I took a look at

http://www.dribin.org/dave/blog/archives/2006/04/22/tracing_objc/
http://developer.apple.com/documentation/DeveloperTools/Conceptual/DynamicLibraries/Articles/UsingDynamicLibraries.html#//apple_ref/doc/uid/TP40002182-DontLinkElementID_32

If I understand it correctly, you should be able to interpose a
function in a shared library in your code. That is in your code,
instead of calling the function in a shared library, you call another
function instead. It is useful to debug your code. But that doesn't
mean you will be able to interpose the function calls inside the
shared library.


H.J.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-31 22:20                                             ` H. J. Lu
@ 2007-01-31 22:24                                               ` Andrew Pinski
  2007-01-31 22:42                                                 ` H. J. Lu
  0 siblings, 1 reply; 24+ messages in thread
From: Andrew Pinski @ 2007-01-31 22:24 UTC (permalink / raw)
  To: H. J. Lu; +Cc: Andrew Pinski, Andrew Haley, Paolo Bonzini, gcc-patches

> 
> On Sun, Jan 14, 2007 at 10:47:41AM -0800, H. J. Lu wrote:
> > On Sun, Jan 14, 2007 at 01:30:07PM -0500, Andrew Pinski wrote:
> > > > I checked in the libjava part. Here is the updated patch for other
> > > > libraries. If someone can give me a list of functions in libobjc
> > > > which should be overridable, I will add them to the dynamic list
> > > > for libobjc.
> > > 
> > > All except for the class functions themselves.  For libobjc, a better
> > > way of doing this is actually marking the class methods as hidden as they
> > > are never called directly.
> > 
> > I assume *.m files have class functions and other files have non-class
> > functions which may be overrable by programmers. Is that correct?
> > 
> > What about functuons with the prefixes of __?
> 
> I took a look at
> 
> http://www.dribin.org/dave/blog/archives/2006/04/22/tracing_objc/
> http://developer.apple.com/documentation/DeveloperTools/Conceptual/DynamicLibraries/Articles/UsingDynamicLibraries.html#//apple_ref/doc/uid/TP40002182-DontLinkElementID_32


Apple's documention is about the NeXT runtime and not the GNU runtime so those don't
apply really. The first link also only applies to the NeXT runtime.  

I have a patch for libobjc to use -fvisibility=hidden.  The number of functions inside
the Objective-C runtime is little so the issue of getting binding faster will not help
it that much.  Also I am working on just getting the class's methods marked hidden.

Really your patch only helps targets where GNU binutils works and only where
that specific option has been added (which is not going to be released until later
this year).  And my patches will help all targets even with older binutils.

I would rather libobjc be done differently than the other target libraries because
there is no reason to include this option when there are better ways of getting this
working correctly.

-- Pinski

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-31 22:24                                               ` Andrew Pinski
@ 2007-01-31 22:42                                                 ` H. J. Lu
  2007-02-10 23:28                                                   ` H. J. Lu
  0 siblings, 1 reply; 24+ messages in thread
From: H. J. Lu @ 2007-01-31 22:42 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Andrew Haley, Paolo Bonzini, gcc-patches

On Wed, Jan 31, 2007 at 05:21:11PM -0500, Andrew Pinski wrote:
> > 
> > On Sun, Jan 14, 2007 at 10:47:41AM -0800, H. J. Lu wrote:
> > > On Sun, Jan 14, 2007 at 01:30:07PM -0500, Andrew Pinski wrote:
> > > > > I checked in the libjava part. Here is the updated patch for other
> > > > > libraries. If someone can give me a list of functions in libobjc
> > > > > which should be overridable, I will add them to the dynamic list
> > > > > for libobjc.
> > > > 
> > > > All except for the class functions themselves.  For libobjc, a better
> > > > way of doing this is actually marking the class methods as hidden as they
> > > > are never called directly.
> > > 
> > > I assume *.m files have class functions and other files have non-class
> > > functions which may be overrable by programmers. Is that correct?
> > > 
> > > What about functuons with the prefixes of __?
> > 
> > I took a look at
> > 
> > http://www.dribin.org/dave/blog/archives/2006/04/22/tracing_objc/
> > http://developer.apple.com/documentation/DeveloperTools/Conceptual/DynamicLibraries/Articles/UsingDynamicLibraries.html#//apple_ref/doc/uid/TP40002182-DontLinkElementID_32
> 
> 
> Apple's documention is about the NeXT runtime and not the GNU runtime so those don't
> apply really. The first link also only applies to the NeXT runtime.  

My point is a user shouldn't assume that he/she can override
global function call references within libobjc, which is the only
visible impact my patch has.

> 
> I have a patch for libobjc to use -fvisibility=hidden.  The number of functions inside
> the Objective-C runtime is little so the issue of getting binding faster will not help
> it that much.  Also I am working on just getting the class's methods marked hidden.
> 
> Really your patch only helps targets where GNU binutils works and only where
> that specific option has been added (which is not going to be released until later
> this year).  And my patches will help all targets even with older binutils.
> 
> I would rather libobjc be done differently than the other target libraries because
> there is no reason to include this option when there are better ways of getting this
> working correctly.

-fvisibility=hidden only works on global functions which aren't
the part of libobjc ABI. For example,

BOOL objc_hash_is_key_in_hash (cache_ptr cache, const void *key);

is in hash.h and user can call it. It can't be hidden. But there
is

[hjl@gnu-26 .libs]$ readelf  --wide -r libobjc.so.2  | grep objc_hash_is_key_in_hash
0000000000217910  0000010700000007 R_X86_64_JUMP_SLOT 000000000000cde0 objc_hash_is_key_in_hash + 0

My approach will remove this relocation.


H.J.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-01-31 22:42                                                 ` H. J. Lu
@ 2007-02-10 23:28                                                   ` H. J. Lu
  2007-02-11  9:09                                                     ` Andrew Pinski
  0 siblings, 1 reply; 24+ messages in thread
From: H. J. Lu @ 2007-02-10 23:28 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Andrew Haley, Paolo Bonzini, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 3337 bytes --]

On Wed, Jan 31, 2007 at 02:33:34PM -0800, H. J. Lu wrote:
> On Wed, Jan 31, 2007 at 05:21:11PM -0500, Andrew Pinski wrote:
> > 
> > I have a patch for libobjc to use -fvisibility=hidden.  The number of functions inside
> > the Objective-C runtime is little so the issue of getting binding faster will not help
> > it that much.  Also I am working on just getting the class's methods marked hidden.
> > 
> > Really your patch only helps targets where GNU binutils works and only where
> > that specific option has been added (which is not going to be released until later
> > this year).  And my patches will help all targets even with older binutils.
> > 
> > I would rather libobjc be done differently than the other target libraries because
> > there is no reason to include this option when there are better ways of getting this
> > working correctly.
> 
> -fvisibility=hidden only works on global functions which aren't
> the part of libobjc ABI. For example,
> 
> BOOL objc_hash_is_key_in_hash (cache_ptr cache, const void *key);
> 
> is in hash.h and user can call it. It can't be hidden. But there
> is
> 
> [hjl@gnu-26 .libs]$ readelf  --wide -r libobjc.so.2  | grep objc_hash_is_key_in_hash
> 0000000000217910  0000010700000007 R_X86_64_JUMP_SLOT 000000000000cde0 objc_hash_is_key_in_hash + 0
> 
> My approach will remove this relocation.
> 

Here are dynamic relocation changes on Linux/x86-64:

libgcc_s.so          Old			-Bsymbolic-functions
	'.rela.dyn': 10 entries			10 entries
	'.rela.plt': 31 entries			10 entries
libffi.so
	'.rela.dyn': 7 entries			7 entries
	'.rela.plt': 16 entries			4 entries
libgfortran.so
	'.rela.dyn': 139 entries		139 entries
	'.rela.plt': 283 entries		173 entries
libgomp.so
	'.rela.dyn': 10 entries			10 entries
	'.rela.plt': 26 entries			26 entries
libmudflapth.so
	'.rela.dyn': 133 entries		133 entries
	'.rela.plt': 172 entries		148 entries
libmudflap.so
	'.rela.dyn': 123 entries		123 entries
	'.rela.plt': 162 entries		139 entries
libobjc.so
	'.rela.dyn': 340 entries		340 entries
	'.rela.plt': 170 entries		56 entries
libssp.so
	'.rela.dyn': 9 entries			9 entries
	'.rela.plt': 20 entries			18 entries
libstdc++.so
	'.rela.dyn': 2435 entries		2435 entries
	'.rela.plt': 533 entries		107 entries

Here are dynamic relocation changes on Linux/i686:

		    Old				-Bsymbolic-functions
libgcc_s.so
	'.rel.dyn': 9 entries			9 entries
	'.rel.plt': 29 entries			11 entries
libffi.so
	'.rel.dyn': 7 entries			7 entries
	'.rel.plt': 8 entries			5 entries
libgfortran.so
	'.rel.dyn': 138 entries			138 entries
	'.rel.plt': 248 entries			174 entries
libgomp.so
	'.rel.dyn': 9 entries			9 entries
	'.rel.plt': 26 entries			26 entries
libmudflapth.so
	'.rel.dyn': 133 entries			133 entries
	'.rel.plt': 173 entries			149 entries
libmudflap.so
	'.rel.dyn': 123 entries			123 entries
	'.rel.plt': 163 entries			140 entries
libobjc.so
	'.rel.dyn': 340 entries			340 entries
	'.rel.plt': 171 entries			57 entries
libssp.so
	'.rel.dyn': 9 entries			9 entries
	'.rel.plt': 21 entries			19 entrie
libstdc++.so
	'.rel.dyn': 2435 entries		2435 entries
	'.rel.plt': 538 entries			110 entries

The test result is at

http://gcc.gnu.org/ml/gcc-testresults/2007-02/msg00388.html

-Bsymbolic-functions can reduce PLT relocations by as much as 80%
without any regressions. I am enclosing my patch here again.


H.J.

[-- Attachment #2: gcc-symbolic-14.patch --]
[-- Type: text/plain, Size: 18239 bytes --]

libffi/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (libffi_la_LDFLAGS): Add $(extra_ldflags_libffi).
	* Makefile.in: Regenerated.

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libffi to $SYMBOLIC_LDFLAGS.  Substitute
	extra_ldflags_libffi.
	* configure: Regenerated.
	* aclocal.m4: Likewise.

libgcc/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.in (extra_ldflags_libgcc): New.
	(SHLIB_LINK): Add $(extra_ldflags_libgcc).

	* configure.ac: Include ../config/lib-ld.m4 and
	../config/ld-symbolic.m4.  Usde ACX_PROG_LD_GNU_SYMBOLIC. Set
	extra_ldflags_libgcc to $SYMBOLIC_LDFLAGS.  Substitute
	extra_ldflags_libgcc.
	* configure: Regenerated.

libgfortran/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libgfortran to $SYMBOLIC_LDFLAGS if it isn't set.
	* configure: Regenerated.
	* aclocal.m4: Likewise.
	* Makefile.in: Likewise.

libgomp/

2007-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Add
	$SYMBOLIC_LDFLAGS to OPT_LDFLAGS.
	* configure: Regenerated.
	* aclocal.m4: Likewise.
	* Makefile.in: Likewise.

libmudflap/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (libmudflap_la_LDFLAGS): Add
	$(extra_ldflags_libmudflap).
	(libmudflapth_la_LDFLAGS): Likewise.
	* Makefile.in: Regenerated.

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libmudflap to $SYMBOLIC_LDFLAGS.  Substitute
	extra_ldflags_libmudflap.
	* configure: Regenerated.
	* aclocal.m4: Likewise.

libobjc/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libobjc to $SYMBOLIC_LDFLAGS if it isn't set.
	* configure: Regenerated.
	* aclocal.m4: Likewise.

libssp/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (libssp_la_LDFLAGS): Add $(extra_ldflags_libssp).
	* Makefile.in: Regenerated.

	* configure.ac: Use ACX_PROG_LD_GNU_SYMBOLIC.  Set
	extra_ldflags_libssp to $SYMBOLIC_LDFLAGS.  Substitute
	extra_ldflags_libssp.
	* configure: Regenerated.
	* aclocal.m4: Likewise.

libstdc++-v3/

2007-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Use ACX_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW.  Add
	$DYNAMIC_LIST_CPP_NEW_LDFLAGS to OPT_LDFLAGS.
	* configure: Regenerated.
	* aclocal.m4: Likewise.
	* Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* libmath/Makefile.in: Likewise.
	* libsupc++/Makefile.in: Likewise.
	* po/Makefile.in: Likewise.
	* src/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

--- gcc/libffi/Makefile.am.symbolic	2007-01-18 10:22:38.000000000 -0800
+++ gcc/libffi/Makefile.am	2007-02-01 13:07:39.000000000 -0800
@@ -157,7 +157,7 @@ nodist_libffi_convenience_la_SOURCES = $
 
 AM_CFLAGS = -Wall -g -fexceptions
 
-libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libffi)
 
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
 AM_CCASFLAGS = $(AM_CPPFLAGS)
--- gcc/libffi/Makefile.in.symbolic	2007-01-18 10:22:39.000000000 -0800
+++ gcc/libffi/Makefile.in	2007-02-01 13:07:39.000000000 -0800
@@ -320,6 +320,7 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+extra_ldflags_libffi = @extra_ldflags_libffi@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -429,7 +430,7 @@ nodist_libffi_la_SOURCES = $(am__append_
 libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
 AM_CFLAGS = -Wall -g -fexceptions
-libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libffi)
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
 AM_CCASFLAGS = $(AM_CPPFLAGS)
 all: fficonfig.h
--- gcc/libffi/configure.ac.symbolic	2006-12-14 09:01:37.000000000 -0800
+++ gcc/libffi/configure.ac	2007-02-01 13:07:39.000000000 -0800
@@ -276,6 +276,10 @@ esac
 AC_SUBST(toolexecdir)
 AC_SUBST(toolexeclibdir)
 
+ACX_PROG_LD_GNU_SYMBOLIC
+extra_ldflags_libffi=$SYMBOLIC_LDFLAGS
+AC_SUBST(extra_ldflags_libffi)
+
 if test "${multilib}" = "yes"; then
   multilib_arg="--enable-multilib"
 else
--- gcc/libgcc/Makefile.in.symbolic	2007-01-31 13:53:20.000000000 -0800
+++ gcc/libgcc/Makefile.in	2007-02-01 13:07:39.000000000 -0800
@@ -38,6 +38,8 @@ SHELL = @SHELL@
 enable_shared = @enable_shared@
 decimal_float = @decimal_float@
 
+extra_ldflags_libgcc = @extra_ldflags_libgcc@
+
 host_noncanonical = @host_noncanonical@
 
 # List of extra object files that should be compiled for this target machine.
@@ -228,6 +230,8 @@ include $(srcdir)/empty.mk $(tmake_file)
 #   - we know how to build them
 ifeq ($(SHLIB_LINK),)
   enable_shared := no
+else
+  SHLIB_LINK := $(subst $(GCC_FOR_TARGET),$(GCC_FOR_TARGET) $(extra_ldflags_libgcc), $(SHLIB_LINK))
 endif
 
 ifeq ($(enable_shared),yes)
--- gcc/libgcc/configure.ac.symbolic	2007-01-26 17:41:45.000000000 -0800
+++ gcc/libgcc/configure.ac	2007-02-01 13:07:39.000000000 -0800
@@ -2,6 +2,8 @@ dnl Process this file with autoconf to p
 
 sinclude(../config/acx.m4)
 sinclude(../config/no-executables.m4)
+sinclude(../config/lib-ld.m4)
+sinclude(../config/ld-symbolic.m4)
 
 AC_PREREQ(2.59)
 AC_INIT([GNU C Runtime Library], 1.0,,[libgcc])
@@ -147,6 +149,11 @@ AC_SUBST(tmake_file)
 AC_SUBST(extra_parts)
 AC_SUBST(asm_hidden_op)
 
+# Substitute GNU linker -Bsymbolic-functions
+ACX_PROG_LD_GNU_SYMBOLIC
+extra_ldflags_libgcc=$SYMBOLIC_LDFLAGS
+AC_SUBST(extra_ldflags_libgcc)
+
 # We need multilib support.
 AC_CONFIG_FILES([Makefile])
 AC_CONFIG_COMMANDS([default],
--- gcc/libgfortran/Makefile.in.symbolic	2007-01-22 13:26:42.000000000 -0800
+++ gcc/libgfortran/Makefile.in	2007-02-01 13:07:39.000000000 -0800
@@ -48,8 +48,10 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
 	$(top_srcdir)/../config/lead-dot.m4 \
 	$(top_srcdir)/../config/multi.m4 \
-	$(top_srcdir)/../config/stdint.m4 $(top_srcdir)/acinclude.m4 \
-	$(top_srcdir)/../config/acx.m4 \
+	$(top_srcdir)/../config/stdint.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/acx.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
--- gcc/libgfortran/configure.ac.symbolic	2007-01-22 13:26:13.000000000 -0800
+++ gcc/libgfortran/configure.ac	2007-02-01 13:07:39.000000000 -0800
@@ -142,12 +142,17 @@ AC_SUBST(enable_static)
 FC="$GFORTRAN"
 AC_PROG_FC(gfortran)
 
+ACX_PROG_LD_GNU_SYMBOLIC
+
 # extra LD Flags which are required for targets
 case "${host}" in
   *-darwin*)
     # Darwin needs -single_module when linking libgfortran
     extra_ldflags_libgfortran=-Wl,-single_module
     ;;
+  *)
+    extra_ldflags_libgfortran=$SYMBOLIC_LDFLAGS
+    ;;
 esac
 AC_SUBST(extra_ldflags_libgfortran)
 
--- gcc/libgomp/configure.ac.symbolic	2007-02-01 12:40:28.000000000 -0800
+++ gcc/libgomp/configure.ac	2007-02-01 13:07:39.000000000 -0800
@@ -338,6 +338,9 @@ AC_SUBST(OMP_LOCK_KIND)
 AC_SUBST(OMP_NEST_LOCK_KIND)
 CFLAGS="$save_CFLAGS"
 
+ACX_PROG_LD_GNU_SYMBOLIC
+OPT_LDFLAGS="$OPT_LDFLAGS $SYMBOLIC_LDFLAGS"
+
 AC_CONFIG_FILES(omp.h omp_lib.h omp_lib.f90 libgomp_f.h)
 AC_CONFIG_FILES(Makefile testsuite/Makefile libgomp.spec)
 AC_OUTPUT
--- gcc/libmudflap/Makefile.am.symbolic	2006-11-18 06:27:15.000000000 -0800
+++ gcc/libmudflap/Makefile.am	2007-02-01 13:07:39.000000000 -0800
@@ -34,7 +34,7 @@ libmudflap_la_SOURCES = \
 	mf-hooks2.c
 libmudflap_la_LIBADD = 
 libmudflap_la_DEPENDENCIES = $(libmudflap_la_LIBADD)
-libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libmudflap)
 
 clean-local:
 	rm -f pth/*.o pth/*.lo
@@ -59,7 +59,7 @@ libmudflapth_la_LIBADD = \
 	pth/mf-hooks2.lo \
 	pth/mf-hooks3.lo
 libmudflapth_la_DEPENDENCIES = $(libmudflapth_la_LIBADD)
-libmudflapth_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libmudflapth_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libmudflap)
 
 
 # XXX hack alert
--- gcc/libmudflap/Makefile.in.symbolic	2006-11-18 06:27:15.000000000 -0800
+++ gcc/libmudflap/Makefile.in	2007-02-01 13:07:39.000000000 -0800
@@ -50,7 +50,10 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
 	$(top_srcdir)/../config/depstand.m4 \
 	$(top_srcdir)/../config/enable.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../config/lead-dot.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -192,6 +195,7 @@ datadir = @datadir@
 enable_shared = @enable_shared@
 enable_static = @enable_static@
 exec_prefix = @exec_prefix@
+extra_ldflags_libmudflap = @extra_ldflags_libmudflap@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -241,7 +245,7 @@ libmudflap_la_SOURCES = \
 
 libmudflap_la_LIBADD = 
 libmudflap_la_DEPENDENCIES = $(libmudflap_la_LIBADD)
-libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libmudflap)
 libmudflapth_la_SOURCES = 
 libmudflapth_la_LIBADD = \
 	pth/mf-runtime.lo \
@@ -251,7 +255,7 @@ libmudflapth_la_LIBADD = \
 	pth/mf-hooks3.lo
 
 libmudflapth_la_DEPENDENCIES = $(libmudflapth_la_LIBADD)
-libmudflapth_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libmudflapth_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(extra_ldflags_libmudflap)
 
 # XXX hack alert
 # From libffi/Makefile.am
--- gcc/libmudflap/configure.ac.symbolic	2006-11-18 06:27:15.000000000 -0800
+++ gcc/libmudflap/configure.ac	2007-02-01 13:07:39.000000000 -0800
@@ -256,6 +256,9 @@ fi
 AC_DEFINE_UNQUOTED([ENTRY_POINT], [$mudflap_cv_entry_point],
   [Define to the name of the symbol used for the entry point.])
 
+ACX_PROG_LD_GNU_SYMBOLIC
+extra_ldflags_libmudflap=$SYMBOLIC_LDFLAGS
+AC_SUBST(extra_ldflags_libmudflap)
 
 if test ${multilib} = yes; then
   multilib_arg="--enable-multilib"
--- gcc/libobjc/configure.ac.symbolic	2006-11-18 06:27:04.000000000 -0800
+++ gcc/libobjc/configure.ac	2007-02-01 13:07:39.000000000 -0800
@@ -156,12 +156,17 @@ m4_define([_AC_ARG_VAR_PRECIOUS],[])
 AC_PROG_CC
 m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
+ACX_PROG_LD_GNU_SYMBOLIC
+
 # extra LD Flags which are required for targets
 case "${host}" in
   *-darwin*)
     # Darwin needs -single_module when linking libobjc
     extra_ldflags_libobjc=-Wl,-single_module
     ;;
+  *)
+    extra_ldflags_libobjc=$SYMBOLIC_LDFLAGS
+    ;;
 esac
 AC_SUBST(extra_ldflags_libobjc)
 
--- gcc/libssp/Makefile.am.symbolic	2006-11-18 06:27:24.000000000 -0800
+++ gcc/libssp/Makefile.am	2007-02-01 13:07:39.000000000 -0800
@@ -35,7 +35,7 @@ libssp_la_SOURCES = \
 libssp_la_LIBADD = 
 libssp_la_DEPENDENCIES = $(version_dep) $(libssp_la_LIBADD)
 libssp_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
-		    $(version_arg)
+		    $(version_arg) $(extra_ldflags_libssp)
 
 libssp_nonshared_la_SOURCES = \
 	ssp-local.c
--- gcc/libssp/Makefile.in.symbolic	2006-11-18 06:27:24.000000000 -0800
+++ gcc/libssp/Makefile.in	2007-02-01 13:07:39.000000000 -0800
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -15,8 +15,6 @@
 @SET_MAKE@
 
 
-SOURCES = $(libssp_la_SOURCES) $(libssp_nonshared_la_SOURCES)
-
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 VPATH = @srcdir@
@@ -52,7 +50,10 @@ subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
 	$(top_srcdir)/../config/depstand.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../config/lead-dot.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -182,6 +183,7 @@ datadir = @datadir@
 enable_shared = @enable_shared@
 enable_static = @enable_static@
 exec_prefix = @exec_prefix@
+extra_ldflags_libssp = @extra_ldflags_libssp@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -234,7 +236,7 @@ libssp_la_SOURCES = \
 libssp_la_LIBADD = 
 libssp_la_DEPENDENCIES = $(version_dep) $(libssp_la_LIBADD)
 libssp_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
-		    $(version_arg)
+		    $(version_arg) $(extra_ldflags_libssp)
 
 libssp_nonshared_la_SOURCES = \
 	ssp-local.c
--- gcc/libssp/configure.ac.symbolic	2006-11-18 06:27:24.000000000 -0800
+++ gcc/libssp/configure.ac	2007-02-01 13:07:39.000000000 -0800
@@ -164,6 +164,10 @@ esac
 AC_SUBST(toolexecdir)
 AC_SUBST(toolexeclibdir)
 
+ACX_PROG_LD_GNU_SYMBOLIC
+extra_ldflags_libssp=$SYMBOLIC_LDFLAGS
+AC_SUBST(extra_ldflags_libssp)
+
 if test ${multilib} = yes; then
   multilib_arg="--enable-multilib"
 else
--- gcc/libstdc++-v3/Makefile.in.symbolic	2007-01-29 10:30:14.000000000 -0800
+++ gcc/libstdc++-v3/Makefile.in	2007-02-01 13:07:39.000000000 -0800
@@ -54,6 +54,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/configure.ac.symbolic	2007-02-01 12:40:34.000000000 -0800
+++ gcc/libstdc++-v3/configure.ac	2007-02-01 13:07:39.000000000 -0800
@@ -403,5 +403,8 @@ _EOF
 SUBDIRS="$SUBDIRS"
 ])
 
+ACX_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW
+OPT_LDFLAGS="$OPT_LDFLAGS $DYNAMIC_LIST_CPP_NEW_LDFLAGS"
+
 dnl And this actually makes things happen:
 AC_OUTPUT
--- gcc/libstdc++-v3/include/Makefile.in.symbolic	2007-01-29 10:30:13.000000000 -0800
+++ gcc/libstdc++-v3/include/Makefile.in	2007-02-01 13:07:39.000000000 -0800
@@ -49,6 +49,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/libmath/Makefile.in.symbolic	2007-01-29 10:30:12.000000000 -0800
+++ gcc/libstdc++-v3/libmath/Makefile.in	2007-02-01 13:07:39.000000000 -0800
@@ -49,6 +49,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/libsupc++/Makefile.in.symbolic	2007-01-29 10:30:13.000000000 -0800
+++ gcc/libstdc++-v3/libsupc++/Makefile.in	2007-02-01 13:07:39.000000000 -0800
@@ -51,6 +51,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/po/Makefile.in.symbolic	2007-01-29 10:30:14.000000000 -0800
+++ gcc/libstdc++-v3/po/Makefile.in	2007-02-01 13:07:39.000000000 -0800
@@ -49,6 +49,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/src/Makefile.in.symbolic	2007-01-29 10:30:13.000000000 -0800
+++ gcc/libstdc++-v3/src/Makefile.in	2007-02-01 13:07:39.000000000 -0800
@@ -49,6 +49,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
--- gcc/libstdc++-v3/testsuite/Makefile.in.symbolic	2007-01-29 10:30:14.000000000 -0800
+++ gcc/libstdc++-v3/testsuite/Makefile.in	2007-02-01 13:07:39.000000000 -0800
@@ -49,6 +49,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../c
 	$(top_srcdir)/../config/multi.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../config/unwind_ipinfo.m4 \
+	$(top_srcdir)/../config/lib-ld.m4 \
+	$(top_srcdir)/../config/ld-symbolic.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
 	$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: PATCH: Build shared libraries with -Bsymbolic-functions
  2007-02-10 23:28                                                   ` H. J. Lu
@ 2007-02-11  9:09                                                     ` Andrew Pinski
  0 siblings, 0 replies; 24+ messages in thread
From: Andrew Pinski @ 2007-02-11  9:09 UTC (permalink / raw)
  To: H. J. Lu; +Cc: Andrew Pinski, Andrew Haley, Paolo Bonzini, gcc-patches

> 
> 
> --pWyiEgJYm5f9v55/
> > 
> > BOOL objc_hash_is_key_in_hash (cache_ptr cache, const void *key);
> > 
> > is in hash.h and user can call it. It can't be hidden. But there
> > is
> > 
> > [hjl@gnu-26 .libs]$ readelf  --wide -r libobjc.so.2  | grep objc_hash_is_key_in_hash
> > 0000000000217910  0000010700000007 R_X86_64_JUMP_SLOT 000000000000cde0 objc_hash_is_key_in_hash + 0
> > 
> > My approach will remove this relocation.
> > 

Again the benifit is little and useless for libobjc.  Look at your numbers,
only 100 saved which is small.  I still an rejecting this patch, there
are better ways of doing this issue in a generic way instead of changing
all of target libraries.

-- Pinski

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2007-02-11  0:07 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <17827.39608.578446.917969@zebedee.pink>
     [not found] ` <20070109134100.GA17596@lucon.org>
     [not found]   ` <17827.40388.768818.387227@zebedee.pink>
     [not found]     ` <20070109135627.GA24284@lucon.org>
     [not found]       ` <17827.41041.498443.221842@zebedee.pink>
     [not found]         ` <20070109141819.GA4072@lucon.org>
     [not found]           ` <20070109174240.GA31750@lucon.org>
     [not found]             ` <20070109192047.GA32254@lucon.org>
     [not found]               ` <20070110142929.GA22520@lucon.org>
     [not found]                 ` <m3tzyzqaha.fsf@localhost.localdomain>
2007-01-10 19:03                   ` PATCH: Build shared libraries with -Bsymbolic-functions H. J. Lu
2007-01-10 22:49                     ` H. J. Lu
2007-01-11  8:04                     ` Paolo Bonzini
2007-01-11 18:15                       ` H. J. Lu
2007-01-11 18:33                         ` Paolo Bonzini
2007-01-11 20:09                           ` H. J. Lu
2007-01-12  7:57                             ` Paolo Bonzini
2007-01-12 14:39                               ` H. J. Lu
2007-01-12 18:52                                 ` H. J. Lu
2007-01-13 13:48                                   ` Paolo Bonzini
2007-01-13 14:51                                     ` H. J. Lu
2007-01-13 17:12                                     ` Andrew Pinski
2007-01-13 17:32                                       ` H. J. Lu
2007-01-14 13:04                                     ` Andrew Haley
2007-01-14 15:46                                       ` H. J. Lu
2007-01-14 18:29                                         ` Andrew Pinski
2007-01-14 18:47                                           ` H. J. Lu
2007-01-31 22:20                                             ` H. J. Lu
2007-01-31 22:24                                               ` Andrew Pinski
2007-01-31 22:42                                                 ` H. J. Lu
2007-02-10 23:28                                                   ` H. J. Lu
2007-02-11  9:09                                                     ` Andrew Pinski
2007-01-12 12:13                             ` Andrew Haley
2007-01-12 14:40                               ` H. J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).