This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
On darwin8, no need to use flat namespace for libstdc++
- From: gkeating at apple dot com (Geoffrey Keating)
- To: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Thu, 13 Jan 2005 14:28:35 -0800 (PST)
- Subject: On darwin8, no need to use flat namespace for libstdc++
As of Tiger8A347, the dynamic linker is finally fixed so that new and
delete can be overridden without needing to build both libstdc++ and
your executable with -flat_namespace. Yay! We can now remove that
workaround. I've assumed that plain "darwin" means "not sure, please
try to make it work in all circumstances".
Bootstrapped & tested on powerpc-darwin8, verified that it does not
change the testsuite results. Also verified that the tests in the C++
testsuite that override new & delete still pass and do not
use -flat_namespace.
--
- Geoffrey Keating <geoffk@apple.com>
===File ~/patches/gcc-3168188.patch=========================
2005-01-13 Geoffrey Keating <geoffk@apple.com>
* configure.host (darwin): On darwin8 or later, no need to build
libstdc++ with -flat_namespace.
Index: configure.host
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.host,v
retrieving revision 1.33
diff -u -p -u -p -r1.33 configure.host
--- configure.host 28 Dec 2004 16:34:15 -0000 1.33
+++ configure.host 13 Jan 2005 22:24:43 -0000
@@ -174,13 +174,19 @@ case "${host_os}" in
cygwin*)
os_include_dir="os/newlib"
;;
- darwin*)
+ darwin | darwin[1-7] | darwin[1-7].*)
# On Darwin, performance is improved if libstdc++ is single-module.
- # Up to at least 10.3.5, -flat_namespace is required for proper
+ # Up to at least 10.3.7, -flat_namespace is required for proper
# treatment of coalesced symbols.
OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module -Wl,-flat_namespace"
os_include_dir="os/bsd/darwin"
;;
+ darwin[89] | darwin[89].* | darwin[1-9][0-9]* )
+ # 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"
+ os_include_dir="os/bsd/darwin"
+ ;;
*djgpp*) # leading * picks up "msdosdjgpp"
os_include_dir="os/djgpp"
;;
============================================================