diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 32685cbfa161b1949a1ac7ce90d1e7de4bec62e2..1031465d422b4108c4ff8b60b3b6ba98a8c6e129 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,10 @@
+2006-12-02  Howard Hinnant  <hhinnant@apple.com>
+
+	* acinclude.m4: Allow OPTIMIZE_CXXFLAGS to be set by configure.host.
+	* configure.host: Set OPTIMIZE_CXXFLAGS to -fvisibility-inlines-hidden
+	for x86/darwin.
+	* configure: Regenerate.
+
 2006-12-01  Paolo Carlini  <pcarlini@suse.de>
 
 	* include/ext/mt_allocator.h (__pool_base::_M_get_align): Remove
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index a15e076ce784a4f9e11d142a396855749b2cd1ff..38345fa2e32a2d5d0af3614b1bfc6e5e412ace3d 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -653,8 +653,8 @@ dnl
 AC_DEFUN([GLIBCXX_EXPORT_FLAGS], [
   # Optimization flags that are probably a good idea for thrill-seekers. Just
   # uncomment the lines below and make, everything else is ready to go...
+  # Alternatively OPTIMIZE_CXXFLAGS can be set in configure.host.
   # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
-  OPTIMIZE_CXXFLAGS=
   AC_SUBST(OPTIMIZE_CXXFLAGS)
 
   WARN_FLAGS='-Wall -Wextra -Wwrite-strings -Wcast-qual'
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 8454849501d816e7a7393dbf67a1199aa47f659b..ae4e09e15dcdad3fb20507656430d7ae1ea8c607 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -110313,8 +110313,8 @@ echo "${ECHO_T}$gxx_include_dir" >&6
 
   # Optimization flags that are probably a good idea for thrill-seekers. Just
   # uncomment the lines below and make, everything else is ready to go...
+  # Alternatively OPTIMIZE_CXXFLAGS can be set in configure.host.
   # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
-  OPTIMIZE_CXXFLAGS=
 
 
   WARN_FLAGS='-Wall -Wextra -Wwrite-strings -Wcast-qual'
diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
index 441eb4cab3713a136b730eeecfaa3f798a0fb365..ef4d1de4c0216e26a2f4bed8b16e6708a1cf466f 100644
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -202,6 +202,11 @@ case "${host_os}" in
     # On Darwin, performance is improved if libstdc++ is single-module,
     # and on 8+ compatibility is better if not -flat_namespace.
     OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module"
+    case "${host_cpu}" in
+      i[34567]86 | x86_64)
+        OPTIMIZE_CXXFLAGS="${OPTIMIZE_CXXFLAGS} -fvisibility-inlines-hidden"
+        ;;
+    esac
     os_include_dir="os/bsd/darwin"
     ;;
   *djgpp*)      # leading * picks up "msdosdjgpp"