From patchwork Thu Mar 29 06:23:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v3] libstdc++/52689 Date: Wed, 28 Mar 2012 20:23:47 -0000 From: Benjamin Kosnik X-Patchwork-Id: 149364 Message-Id: <20120328232347.6e07674c@adair> To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Seems like libstdc++.a has suffered a bit in the transition to a more modular convenience-library build system. Here's a patch to clean up the compatibility symbols throughout libstdc++, to insure that necessary symbols for versioning purposes are only in shared binaries, ie libstdc++.so. Most of these are completely un-necessary for a static library, and are now duly noted as such. I'm checking this in on trunk and hope to move it to 4_7-branch for 4.7.1 after it's been fire-tested. tested various ways x86/linux -benjamin 2012-03-28 Benjamin Kosnik PR libstdc++/52689 * libsupc++/Makefile.am (LTCXXCOMPILE, CXXLINK): Tweak. * libsupc++/Makefile.in: Regenerated. * src/Makefile.am (LTCXXCOMPILE, CXXLINK): Tweak. (libstdc___la_SOURCES): Add in compatiblity files, with content that varies with -DPIC. * src/Makefile.in: Regenerated. * src/c++11/Makefile.am (LTCXXCOMPILE, CXXLINK): Tweak. * src/c++11/Makefile.in: Regenerated. * src/c++11/compatibility-atomic-c++0x.cc: Guard with PIC. * src/c++11/compatibility-c++0x.cc: Same. * src/c++11/future.cc: Consolidate compatibility bits into.. * src/c++11/mutex.cc: Consolidate compatibility bits into.. * src/c++11/compatibility-thread-cxx0x.cc: ...here. New. * src/c++98/Makefile.am (LTCXXCOMPILE, CXXLINK): Tweak. * src/c++98/Makefile.in: Regenerated. * src/c++98/compatibility-ldbl.cc: Guard with PIC * src/c++98/compatibility-list-2.cc: Same. * src/c++98/compatibility-list.cc: Same. * src/c++98/compatibility.cc: Tweak comments. diff --git a/libstdc++-v3/libsupc++/Makefile.am b/libstdc++-v3/libsupc++/Makefile.am index bee4353..eaf109e 100644 --- a/libstdc++-v3/libsupc++/Makefile.am +++ b/libstdc++-v3/libsupc++/Makefile.am @@ -32,17 +32,17 @@ toolexeclib_LTLIBRARIES = libsupc++.la noinst_LTLIBRARIES = libsupc++convenience.la std_HEADERS = \ - cxxabi.h exception initializer_list new typeinfo + cxxabi.h exception initializer_list new typeinfo bits_HEADERS = \ atomic_lockfree_defines.h cxxabi_forced.h \ - exception_defines.h exception_ptr.h hash_bytes.h nested_exception.h + exception_defines.h exception_ptr.h hash_bytes.h nested_exception.h headers = $(std_HEADERS) $(bits_HEADERS) if GLIBCXX_HOSTED c_sources = \ - cp-demangle.c + cp-demangle.c endif sources = \ @@ -95,7 +95,7 @@ sources = \ vmi_class_type_info.cc \ vterminate.cc -libsupc___la_SOURCES = $(sources) $(c_sources) +libsupc___la_SOURCES = $(sources) $(c_sources) libsupc__convenience_la_SOURCES = $(sources) $(c_sources) # AM_CXXFLAGS needs to be in each subdirectory so that it can be @@ -106,9 +106,7 @@ libsupc__convenience_la_SOURCES = $(sources) $(c_sources) AM_CXXFLAGS = \ $(PIC_CXXFLAGS) \ $(XTEMPLATE_FLAGS) \ - $(WARN_CXXFLAGS) \ - $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) AM_MAKEFLAGS = \ "gxx_include_dir=$(gxx_include_dir)" @@ -125,7 +123,7 @@ C_COMPILE = \ # LTCOMPILE is copied from LTCXXCOMPILE below. LTCOMPILE = $(LIBTOOL) --tag CC --tag disable-shared $(LIBTOOLFLAGS) --mode=compile \ $(CC) $(DEFS) $(C_INCLUDES) $(PIC_CXXFLAGS) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) cp-demangle.c: rm -f $@ @@ -178,9 +176,11 @@ nested_exception.o: nested_exception.cc # # We have to put --tag disable-shared after --tag CXX lest things # CXX undo the affect of disable-shared. -LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) @@ -190,10 +190,11 @@ LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) # course is problematic at this point. So, we get the top-level # directory to configure libstdc++-v3 to use gcc as the C++ # compilation driver. -CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=link $(CXX) \ - $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ - +CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ # Install notes # We have to have rules modified from the default to counteract SUN make diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am index eb80bfe..28430cf 100644 --- a/libstdc++-v3/src/Makefile.am +++ b/libstdc++-v3/src/Makefile.am @@ -29,10 +29,37 @@ SUBDIRS = c++98 c++11 # Cross compiler support. toolexeclib_LTLIBRARIES = libstdc++.la -vpath % $(top_srcdir)/src -vpath % $(top_srcdir) +vpath % $(top_srcdir)/src/c++98 +vpath % $(top_srcdir)/src/c++11 -libstdc___la_SOURCES = +if GLIBCXX_LDBL_COMPAT +ldbl_compat_sources = compatibility-ldbl.cc +else +ldbl_compat_sources = +endif + +if ENABLE_PARALLEL +parallel_compat_sources = \ + compatibility-parallel_list.cc compatibility-parallel_list-2.cc +else +parallel_compat_sources = +endif + +cxx98_sources = \ + compatibility.cc \ + compatibility-debug_list.cc \ + compatibility-debug_list-2.cc \ + compatibility-list.cc \ + compatibility-list-2.cc \ + ${ldbl_compat_sources} \ + ${parallel_compat_sources} + +cxx11_sources = \ + compatibility-c++0x.cc \ + compatibility-atomic-c++0x.cc \ + compatibility-thread-c++0x.cc + +libstdc___la_SOURCES = $(cxx98_sources) $(cxx11_sources) libstdc___la_LIBADD = \ $(GLIBCXX_LIBS) \ @@ -52,6 +79,43 @@ libstdc___la_LDFLAGS = \ libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) +# Use special rules for parallel mode compilation. +PARALLEL_FLAGS = -fopenmp -D_GLIBCXX_PARALLEL -I$(glibcxx_builddir)/../libgomp +compatibility-parallel_list.lo: compatibility-parallel_list.cc + $(LTCXXCOMPILE) -c $< +compatibility-parallel_list.o: compatibility-parallel_list.cc + $(CXXCOMPILE) -c $< + +compatibility-parallel_list-2.lo: compatibility-parallel_list-2.cc + $(LTCXXCOMPILE) -c $< +compatibility-parallel_list-2.o: compatibility-parallel_list-2.cc + $(CXXCOMPILE) -c $< + +# Use special rules for compatibility-ldbl.cc compilation, as we need to +# pass -mlong-double-64. +if GLIBCXX_LDBL_COMPAT +compatibility-ldbl.lo: compatibility-ldbl.cc + $(LTCXXCOMPILE) -mlong-double-64 -c $< +compatibility-ldbl.o: compatibility-ldbl.cc + $(CXXCOMPILE) -mlong-double-64 -c $< +endif + +# Use special rules for C++11 files/objects. +compatibility-c++0x.lo: compatibility-c++0x.cc + $(LTCXXCOMPILE) -std=gnu++11 -c $< +compatibility-c++0x.o: compatibility-c++0x.cc + $(CXXCOMPILE) -std=gnu++11 -c $< + +compatibility-atomic-c++0x.lo: compatibility-atomic-c++0x.cc + $(LTCXXCOMPILE) -std=gnu++11 -c $< +compatibility-atomic-c++0x.o: compatibility-atomic-c++0x.cc + $(CXXCOMPILE) -std=gnu++11 -c $< + +compatibility-thread-c++0x.lo: compatibility-thread-c++0x.cc + $(LTCXXCOMPILE) -std=gnu++11 -c $< +compatibility-thread-c++0x.o: compatibility-thread-c++0x.cc + $(CXXCOMPILE) -std=gnu++11 -c $< + # AM_CXXFLAGS needs to be in each subdirectory so that it can be # modified in a per-library or per-sub-library way. Need to manually # set this option because CONFIG_CXXFLAGS has to be after @@ -59,12 +123,9 @@ libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) # as the occasion calls for it. AM_CXXFLAGS = \ $(XTEMPLATE_FLAGS) \ - $(WARN_CXXFLAGS) \ - $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) - + $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) -# libstdc++ libtool notes +# Libtool notes # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is # last. (That way, things like -O2 passed down from the toplevel can @@ -82,10 +143,11 @@ AM_CXXFLAGS = \ # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to # attempt to infer which configuration to use -LTCXXCOMPILE = $(LIBTOOL) --tag CXX \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \ - $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = \ + $(LIBTOOL) --tag CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) @@ -95,8 +157,12 @@ LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) # course is problematic at this point. So, we get the top-level # directory to configure libstdc++-v3 to use gcc as the C++ # compilation driver. -CXXLINK = $(LIBTOOL) --tag CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ - $(CXX) $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ +CXXLINK = \ + $(LIBTOOL) --tag CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ + # Symbol versioning for shared libraries. if ENABLE_SYMVERS @@ -116,7 +182,7 @@ libstdc++-symbols.ver: ${glibcxx_srcdir}/$(SYMVER_FILE) \ fi; \ fi $(EGREP) -v '^[ ]*#(#| |$$)' $@.tmp | \ - $(COMPILE) -E -P -include config.h - > $@ || (rm -f $@ ; exit 1) + $(CC) -E -P -include ../config.h - > $@ || (rm -f $@ ; exit 1) rm -f $@.tmp CLEANFILES = libstdc++-symbols.ver @@ -165,7 +231,6 @@ endif # Control additional build primary rules. -# EXTRA_LTLIBRARIES = all-once: libstdc++convenience.la $(STAMP_DEBUG) install-data-once: $(STAMP_INSTALL_DEBUG) diff --git a/libstdc++-v3/src/c++11/Makefile.am b/libstdc++-v3/src/c++11/Makefile.am index 395af5c..e8a4d3a 100644 --- a/libstdc++-v3/src/c++11/Makefile.am +++ b/libstdc++-v3/src/c++11/Makefile.am @@ -32,8 +32,6 @@ headers = sources = \ chrono.cc \ condition_variable.cc \ - compatibility-c++0x.cc \ - compatibility-atomic-c++0x.cc \ debug.cc \ functexcept.cc \ functional.cc \ @@ -60,7 +58,6 @@ inst_sources = endif vpath % $(top_srcdir)/src/c++11 -vpath % $(top_srcdir) libc__11convenience_la_SOURCES = $(sources) $(inst_sources) @@ -70,11 +67,10 @@ libc__11convenience_la_SOURCES = $(sources) $(inst_sources) # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden # as the occasion calls for it. AM_CXXFLAGS = \ + -std=gnu++11 \ $(PIC_CXXFLAGS) \ $(XTEMPLATE_FLAGS) \ - $(WARN_CXXFLAGS) \ - $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) -std=gnu++11 + $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) AM_MAKEFLAGS = \ "gxx_include_dir=$(gxx_include_dir)" @@ -99,9 +95,11 @@ AM_MAKEFLAGS = \ # attempt to infer which configuration to use. # We have to put --tag disable-shared after --tag CXX lest things # CXX undo the affect of disable-shared. -LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) @@ -111,6 +109,8 @@ LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) # course is problematic at this point. So, we get the top-level # directory to configure libstdc++-v3 to use gcc as the C++ # compilation driver. -CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=link $(CXX) \ - $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ +CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ diff --git a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc index 1ee0d7e..8ccad93 100644 --- a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc +++ b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc @@ -1,6 +1,6 @@ // compatibility -*- C++ -*- -// Copyright (C) 2008, 2009, 2010, 2011 +// Copyright (C) 2008, 2009, 2010, 2011, 2012 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -30,6 +30,8 @@ // XXX GLIBCXX_ABI Deprecated // gcc-4.7.0 +#ifdef PIC + #define LOGSIZE 4 namespace @@ -133,6 +135,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#endif // XXX GLIBCXX_ABI Deprecated // gcc-4.5.0 diff --git a/libstdc++-v3/src/c++11/compatibility-c++0x.cc b/libstdc++-v3/src/c++11/compatibility-c++0x.cc index 03c58d2..bd5dbe0 100644 --- a/libstdc++-v3/src/c++11/compatibility-c++0x.cc +++ b/libstdc++-v3/src/c++11/compatibility-c++0x.cc @@ -1,6 +1,6 @@ // Compatibility symbols for previous versions, C++0x bits -*- C++ -*- -// Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -30,6 +30,8 @@ # error "compatibility-c++0x.cc must be compiled with -std=gnu++0x" #endif +#ifdef PIC + namespace std _GLIBCXX_VISIBILITY(default) { // gcc-4.4.0 @@ -119,3 +121,4 @@ namespace std _GLIBCXX_VISIBILITY(default) } // namespace chrono } +#endif diff --git a/libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc b/libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc new file mode 100644 index 0000000..cc8761e --- /dev/null +++ b/libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc @@ -0,0 +1,72 @@ +// Compatibility symbols for previous versions, C++0x bits -*- C++ -*- + +// Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#include +#include + +#ifndef __GXX_EXPERIMENTAL_CXX0X__ +# error "compatibility-c++0x.cc must be compiled with -std=gnu++0x" +#endif + +#define _GLIBCXX_ASM_SYMVER(cur, old, version) \ + asm (".symver " #cur "," #old "@@@" #version); + +// XXX GLIBCXX_ABI Deprecated +// gcc-4.6.0 +// export changes +#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \ + && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \ + && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) + +namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) +{ + const std::error_category* future_category = &std::future_category(); +} + +_GLIBCXX_ASM_SYMVER(_ZN9__gnu_cxx15future_categoryE, _ZSt15future_category, GLIBCXX_3.4.14) + +#endif + +// XXX GLIBCXX_ABI Deprecated +// gcc-4.6.0 +// export changes +#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) +#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \ + && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \ + && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) + +namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) +{ + std::defer_lock_t defer_lock; + std::try_to_lock_t try_to_lock; + std::adopt_lock_t adopt_lock; +} + +_GLIBCXX_ASM_SYMVER(_ZN9__gnu_cxx10adopt_lockE, _ZSt10adopt_lock, GLIBCXX_3.4.11) +_GLIBCXX_ASM_SYMVER(_ZN9__gnu_cxx10defer_lockE, _ZSt10defer_lock, GLIBCXX_3.4.11) +_GLIBCXX_ASM_SYMVER(_ZN9__gnu_cxx11try_to_lockE, _ZSt11try_to_lock, GLIBCXX_3.4.11) + + +#endif +#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 diff --git a/libstdc++-v3/src/c++11/future.cc b/libstdc++-v3/src/c++11/future.cc index a488139..380c3a4 100644 --- a/libstdc++-v3/src/c++11/future.cc +++ b/libstdc++-v3/src/c++11/future.cc @@ -96,23 +96,3 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace std - -// XXX GLIBCXX_ABI Deprecated -// gcc-4.6.0 -// export changes -#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \ - && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \ - && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) - -namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) -{ - const std::error_category* future_category = &__future_category_instance(); -} - -#define _GLIBCXX_ASM_SYMVER(cur, old, version) \ - asm (".symver " #cur "," #old "@@@" #version); - -_GLIBCXX_ASM_SYMVER(_ZN9__gnu_cxx15future_categoryE, _ZSt15future_category, GLIBCXX_3.4.14) - -#endif - diff --git a/libstdc++-v3/src/c++11/mutex.cc b/libstdc++-v3/src/c++11/mutex.cc index d6f2f03..86d0293 100644 --- a/libstdc++-v3/src/c++11/mutex.cc +++ b/libstdc++-v3/src/c++11/mutex.cc @@ -1,6 +1,6 @@ // mutex -*- C++ -*- -// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009, 2010, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -92,30 +92,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } _GLIBCXX_END_NAMESPACE_VERSION -} // namespace - -// XXX GLIBCXX_ABI Deprecated -// gcc-4.6.0 -// export changes -#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \ - && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \ - && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) - -namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) -{ - std::defer_lock_t defer_lock; - std::try_to_lock_t try_to_lock; - std::adopt_lock_t adopt_lock; -} - -#define _GLIBCXX_ASM_SYMVER(cur, old, version) \ - asm (".symver " #cur "," #old "@@" #version); - -_GLIBCXX_ASM_SYMVER(_ZN9__gnu_cxx10adopt_lockE, _ZSt10adopt_lock, GLIBCXX_3.4.11) -_GLIBCXX_ASM_SYMVER(_ZN9__gnu_cxx10defer_lockE, _ZSt10defer_lock, GLIBCXX_3.4.11) -_GLIBCXX_ASM_SYMVER(_ZN9__gnu_cxx11try_to_lockE, _ZSt11try_to_lock, GLIBCXX_3.4.11) - - -#endif +} // namespace std #endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 diff --git a/libstdc++-v3/src/c++98/Makefile.am b/libstdc++-v3/src/c++98/Makefile.am index e960d94..05767e9 100644 --- a/libstdc++-v3/src/c++98/Makefile.am +++ b/libstdc++-v3/src/c++98/Makefile.am @@ -25,7 +25,7 @@ include $(top_srcdir)/fragment.am # Convenience library for C++98 runtime. -noinst_LTLIBRARIES = libc++98convenience.la +noinst_LTLIBRARIES = libc++98convenience.la headers = @@ -74,7 +74,7 @@ atomicity.cc: ${atomicity_file} # particular host, but with ad hoc naming rules. host_sources_extra = \ basic_file.cc c++locale.cc \ - ${inst_sources} ${ldbl_compat_sources} ${parallel_sources} + ${inst_sources} ${parallel_sources} c++locale.cc: ${glibcxx_srcdir}/$(CLOCALE_CC) $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_CC) ./$@ || true @@ -83,19 +83,11 @@ basic_file.cc: ${glibcxx_srcdir}/$(BASIC_FILE_CC) $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_CC) ./$@ || true if ENABLE_PARALLEL -parallel_sources = parallel_settings.cc \ - compatibility-parallel_list.cc \ - compatibility-parallel_list-2.cc +parallel_sources = parallel_settings.cc else parallel_sources = endif -if GLIBCXX_LDBL_COMPAT -ldbl_compat_sources = compatibility-ldbl.cc -else -ldbl_compat_sources = -endif - if ENABLE_EXTERN_TEMPLATE XTEMPLATE_FLAGS = -fno-implicit-templates inst_sources = \ @@ -122,11 +114,6 @@ sources = \ pool_allocator.cc \ mt_allocator.cc \ codecvt.cc \ - compatibility.cc \ - compatibility-debug_list.cc \ - compatibility-debug_list-2.cc \ - compatibility-list.cc \ - compatibility-list-2.cc \ complex_io.cc \ ctype.cc \ globals_io.cc \ @@ -153,7 +140,6 @@ sources = \ ${host_sources_extra} vpath % $(top_srcdir)/src/c++98 -vpath % $(top_srcdir) libc__98convenience_la_SOURCES = $(sources) @@ -180,25 +166,6 @@ parallel_settings.lo: parallel_settings.cc parallel_settings.o: parallel_settings.cc $(CXXCOMPILE) $(PARALLEL_FLAGS) -c $< -compatibility-parallel_list.lo: compatibility-parallel_list.cc - $(LTCXXCOMPILE) -c $< -compatibility-parallel_list.o: compatibility-parallel_list.cc - $(CXXCOMPILE) -c $< - -compatibility-parallel_list-2.lo: compatibility-parallel_list-2.cc - $(LTCXXCOMPILE) -c $< -compatibility-parallel_list-2.o: compatibility-parallel_list-2.cc - $(CXXCOMPILE) -c $< - -if GLIBCXX_LDBL_COMPAT -# Use special rules for compatibility-ldbl.cc compilation, as we need to -# pass -mlong-double-64. -compatibility-ldbl.lo: compatibility-ldbl.cc - $(LTCXXCOMPILE) -mlong-double-64 -c $< -compatibility-ldbl.o: compatibility-ldbl.cc - $(CXXCOMPILE) -mlong-double-64 -c $< -endif - # AM_CXXFLAGS needs to be in each subdirectory so that it can be # modified in a per-library or per-sub-library way. Need to manually # set this option because CONFIG_CXXFLAGS has to be after @@ -207,9 +174,7 @@ endif AM_CXXFLAGS = \ $(PIC_CXXFLAGS) \ $(XTEMPLATE_FLAGS) \ - $(WARN_CXXFLAGS) \ - $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) AM_MAKEFLAGS = \ "gxx_include_dir=$(gxx_include_dir)" @@ -234,9 +199,11 @@ AM_MAKEFLAGS = \ # attempt to infer which configuration to use. # We have to put --tag disable-shared after --tag CXX lest things # CXX undo the affect of disable-shared. -LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) @@ -246,6 +213,8 @@ LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) # course is problematic at this point. So, we get the top-level # directory to configure libstdc++-v3 to use gcc as the C++ # compilation driver. -CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=link $(CXX) \ - $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ +CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ diff --git a/libstdc++-v3/src/c++98/compatibility-ldbl.cc b/libstdc++-v3/src/c++98/compatibility-ldbl.cc index a103856..b40e54a 100644 --- a/libstdc++-v3/src/c++98/compatibility-ldbl.cc +++ b/libstdc++-v3/src/c++98/compatibility-ldbl.cc @@ -1,6 +1,6 @@ // Compatibility symbols for -mlong-double-64 compatibility -*- C++ -*- -// Copyright (C) 2006, 2008, 2009, 2010, 2011 +// Copyright (C) 2006, 2008, 2009, 2010, 2011, 2012 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -27,6 +27,8 @@ #include #include +#ifdef PIC + #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT #ifdef __LONG_DOUBLE_128__ @@ -78,3 +80,5 @@ extern "C" void _ZNKSt4hashIeEclEe (void) __attribute__((alias ("_ZNKSt3tr14hashIeEclEe"))); #endif + +#endif diff --git a/libstdc++-v3/src/c++98/compatibility-list-2.cc b/libstdc++-v3/src/c++98/compatibility-list-2.cc index ac69798..975450c 100644 --- a/libstdc++-v3/src/c++98/compatibility-list-2.cc +++ b/libstdc++-v3/src/c++98/compatibility-list-2.cc @@ -1,6 +1,6 @@ // Compatibility symbols for previous versions, list bits -*- C++ -*- -// Copyright (C) 2011 Free Software Foundation, Inc. +// Copyright (C) 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -24,6 +24,8 @@ #include +#ifdef PIC + #ifndef _GLIBCXX_BEGIN_NAMESPACE_COMPAT # define _GLIBCXX_BEGIN_NAMESPACE_COMPAT #endif @@ -111,3 +113,5 @@ _GLIBCXX_BEGIN_NAMESPACE_COMPAT _GLIBCXX_END_NAMESPACE_COMPAT } // namespace std + +#endif diff --git a/libstdc++-v3/src/c++98/compatibility-list.cc b/libstdc++-v3/src/c++98/compatibility-list.cc index a0d706b..8b91849 100644 --- a/libstdc++-v3/src/c++98/compatibility-list.cc +++ b/libstdc++-v3/src/c++98/compatibility-list.cc @@ -1,6 +1,6 @@ // Compatibility symbols for previous versions, list bits -*- C++ -*- -// Copyright (C) 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -24,6 +24,8 @@ #include +#ifdef PIC + #ifndef _GLIBCXX_BEGIN_NAMESPACE_COMPAT # define _GLIBCXX_BEGIN_NAMESPACE_COMPAT #endif @@ -144,3 +146,5 @@ _GLIBCXX_BEGIN_NAMESPACE_COMPAT _GLIBCXX_END_NAMESPACE_COMPAT } // namespace std + +#endif diff --git a/libstdc++-v3/src/c++98/compatibility.cc b/libstdc++-v3/src/c++98/compatibility.cc index d4cf5d7..38d9e4b 100644 --- a/libstdc++-v3/src/c++98/compatibility.cc +++ b/libstdc++-v3/src/c++98/compatibility.cc @@ -199,7 +199,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif _GLIBCXX_END_NAMESPACE_VERSION -} // namespace +} // namespace std // NB: These symbols renames should go into the shared library only, @@ -228,7 +228,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif _GLIBCXX_END_NAMESPACE_VERSION -} // namespace +} // namespace std /* gcc-4.0.0 @@ -357,7 +357,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif _GLIBCXX_END_NAMESPACE_VERSION -} // namespace +} // namespace std // The rename syntax for default exported names is // asm (".symver name1,exportedname@GLIBCXX_3.4")