diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index f4bc048676839515ce9b169db0393ce45e5bb533..21abaeb07788142ecbb8a252dfe0b714c7c308c9 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -789,6 +789,8 @@ GLIBCXX_HOSTED_TRUE glibcxx_compiler_shared_flag glibcxx_compiler_pic_flag glibcxx_lt_pic_flag +OS_IS_DARWIN_FALSE +OS_IS_DARWIN_TRUE ENABLE_DARWIN_AT_RPATH_FALSE ENABLE_DARWIN_AT_RPATH_TRUE enable_static @@ -12278,7 +12280,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12281 "configure" +#line 12283 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12384,7 +12386,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12387 "configure" +#line 12389 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15744,6 +15746,19 @@ else ENABLE_DARWIN_AT_RPATH_FALSE= fi +os_is_darwin=no +case ${host_os} in + darwin*) os_is_darwin=yes ;; + *) ;; +esac + if test x${os_is_darwin} = xyes; then + OS_IS_DARWIN_TRUE= + OS_IS_DARWIN_FALSE='#' +else + OS_IS_DARWIN_TRUE='#' + OS_IS_DARWIN_FALSE= +fi + if test "$enable_vtable_verify" = yes; then predep_objects_CXX="${predep_objects_CXX} ${glibcxx_builddir}/../libgcc/vtv_start.o" @@ -16167,7 +16182,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } # Fake what AC_TRY_COMPILE does. cat > conftest.$ac_ext << EOF -#line 16170 "configure" +#line 16185 "configure" int main() { typedef bool atomic_type; @@ -16202,7 +16217,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 16205 "configure" +#line 16220 "configure" int main() { typedef short atomic_type; @@ -16237,7 +16252,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 16240 "configure" +#line 16255 "configure" int main() { // NB: _Atomic_word not necessarily int. @@ -16273,7 +16288,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 16276 "configure" +#line 16291 "configure" int main() { typedef long long atomic_type; @@ -16429,7 +16444,7 @@ $as_echo "mutex" >&6; } # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 16432 "configure" +#line 16447 "configure" int main() { _Decimal32 d1; @@ -16471,7 +16486,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 16474 "configure" +#line 16489 "configure" template<typename T1, typename T2> struct same { typedef T2 type; }; @@ -55833,6 +55848,10 @@ if test -z "${ENABLE_DARWIN_AT_RPATH_TRUE}" && test -z "${ENABLE_DARWIN_AT_RPATH as_fn_error $? "conditional \"ENABLE_DARWIN_AT_RPATH\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${OS_IS_DARWIN_TRUE}" && test -z "${OS_IS_DARWIN_FALSE}"; then + as_fn_error $? "conditional \"OS_IS_DARWIN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${GLIBCXX_HOSTED_TRUE}" && test -z "${GLIBCXX_HOSTED_FALSE}"; then as_fn_error $? "conditional \"GLIBCXX_HOSTED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index c68cac4f345d6242309020fede5ecaba46e510db..37396bd6ebbe64a29fb631ced2bc8d94214ffe23 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -109,6 +109,12 @@ ACX_LT_HOST_FLAGS AC_SUBST(enable_shared) AC_SUBST(enable_static) AM_CONDITIONAL([ENABLE_DARWIN_AT_RPATH], [test x$enable_darwin_at_rpath = xyes]) +os_is_darwin=no +case ${host_os} in + darwin*) os_is_darwin=yes ;; + *) ;; +esac +AM_CONDITIONAL([OS_IS_DARWIN], [test x${os_is_darwin} = xyes]) if test "$enable_vtable_verify" = yes; then predep_objects_CXX="${predep_objects_CXX} ${glibcxx_builddir}/../libgcc/vtv_start.o" diff --git a/libstdc++-v3/libsupc++/Makefile.am b/libstdc++-v3/libsupc++/Makefile.am index d0e1618507e0da7e8395f65dc110bd2544ab9f2e..e151ce7a1fe604852269a5b51dfb73ffb771cbc1 100644 --- a/libstdc++-v3/libsupc++/Makefile.am +++ b/libstdc++-v3/libsupc++/Makefile.am @@ -132,6 +132,14 @@ atomicity_file = ${glibcxx_srcdir}/$(ATOMICITY_SRCDIR)/atomicity.h atomicity.cc: ${atomicity_file} $(LN_S) ${atomicity_file} ./atomicity.cc || true +if OS_IS_DARWIN +# See PR 112397 +new_opvnt.lo: new_opvnt.cc + $(LTCXXCOMPILE) -fno-reorder-blocks-and-partition -I. -c $< +new_opvnt.o: new_opvnt.cc + $(CXXCOMPILE) -fno-reorder-blocks-and-partition -I. -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 diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in index 2e755abf14c1b2ad8494f0abde17d628f81c164d..732ab89c8a2e8cd04a10c62e7138c5e7a88ac272 100644 --- a/libstdc++-v3/libsupc++/Makefile.in +++ b/libstdc++-v3/libsupc++/Makefile.in @@ -973,6 +973,12 @@ cp-demangle.o: cp-demangle.c atomicity.cc: ${atomicity_file} $(LN_S) ${atomicity_file} ./atomicity.cc || true +# See PR 112397 +@OS_IS_DARWIN_TRUE@new_opvnt.lo: new_opvnt.cc +@OS_IS_DARWIN_TRUE@ $(LTCXXCOMPILE) -fno-reorder-blocks-and-partition -I. -c $< +@OS_IS_DARWIN_TRUE@new_opvnt.o: new_opvnt.cc +@OS_IS_DARWIN_TRUE@ $(CXXCOMPILE) -fno-reorder-blocks-and-partition -I. -c $< + install-stdHEADERS: $(std_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(stddir)