With the new linker switches, -Bsymbolic-functions and
--dynamic-list-cpp-new, we can improve shared library
performance in gcc. This change will build libstdc++.so with
-Bsymbolic-functions and --dynamic-list-cpp-new. I can expand it
to other libraries.


H.J.
--
--- gcc/libstdc++-v3/acinclude.m4.symbolic      2007-01-09 16:43:09.000000000 
-0800
+++ gcc/libstdc++-v3/acinclude.m4       2007-01-09 17:10:30.000000000 -0800
@@ -299,6 +299,22 @@ AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES]
     AC_MSG_RESULT($ac_ld_relro)
   fi
 
+  # Set --dynamic-list-cpp-new and -Bsymbolic-functions
+  # Note this is only for shared objects.
+  ac_ld_symbolic_functions=no
+  if test x"$with_gnu_ld" = x"yes"; then
+    AC_MSG_CHECKING([for ld that supports --dynamic-list-cpp-new and 
-Bsymbolic-functions])
+    cxx_symbolic_functions=`$LD -v --help 2>/dev/null | grep 
"dynamic-list-cpp-new"`
+    if test -n "$cxx_symbolic_functions"; then
+      cxx_symbolic_functions=`$LD -v --help 2>/dev/null | grep 
"Bsymbolic-functions"`
+    fi
+    if test -n "$cxx_symbolic_functions"; then
+      OPT_LDFLAGS="$OPT_LDFLAGS 
-Wl,--dynamic-list-cpp-new,-Bsymbolic-functions"
+      ac_ld_symbolic_functions=yes
+    fi
+    AC_MSG_RESULT($ac_ld_symbolic_functions)
+  fi
+
   # Set linker optimization flags.
   if test x"$with_gnu_ld" = x"yes"; then
     OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"

Reply via email to