aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/libsupc++
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-04-14 20:48:54 +0100
committerJonathan Wakely <jwakely@redhat.com>2021-04-15 16:56:44 +0100
commit6c0c7fc6236470a533675cd3cd1ebb1cc3dd112c (patch)
tree9946f22c00ca3efa238fc6176913e15a9a4e9361 /libstdc++-v3/libsupc++
parent4d224603d38d3e88f2a3c215b65c12c5f0da1d8d (diff)
downloadgcc-6c0c7fc6236470a533675cd3cd1ebb1cc3dd112c.zip
gcc-6c0c7fc6236470a533675cd3cd1ebb1cc3dd112c.tar.gz
gcc-6c0c7fc6236470a533675cd3cd1ebb1cc3dd112c.tar.bz2
libstdc++: Move atomic functions to libsupc++ [PR 96657]
The changes for PR libstdc++/64735 mean that libsupc++ function might now depend on the __exchange_and_add and __atomic_add functions defined in config/cpu/*/atomicity.h which is not compiled into libsupc++. This causes a link failure for some targets when trying to use libsupc++ without the rest of libstdc++. This patch simply moves the definitions of those functions into libsupc++ so that they are available there. libstdc++-v3/ChangeLog: PR libstdc++/96657 * libsupc++/Makefile.am: Add atomicity.cc here. * src/c++98/Makefile.am: Remove it from here. * libsupc++/Makefile.in: Regenerate. * src/c++98/Makefile.in: Regenerate. * testsuite/18_support/exception_ptr/96657.cc: New test.
Diffstat (limited to 'libstdc++-v3/libsupc++')
-rw-r--r--libstdc++-v3/libsupc++/Makefile.am4
-rw-r--r--libstdc++-v3/libsupc++/Makefile.in18
2 files changed, 15 insertions, 7 deletions
diff --git a/libstdc++-v3/libsupc++/Makefile.am b/libstdc++-v3/libsupc++/Makefile.am
index 3563a3b..10ac4bb 100644
--- a/libstdc++-v3/libsupc++/Makefile.am
+++ b/libstdc++-v3/libsupc++/Makefile.am
@@ -48,6 +48,7 @@ sources = \
array_type_info.cc \
atexit_arm.cc \
atexit_thread.cc \
+ atomicity.cc \
bad_alloc.cc \
bad_array_length.cc \
bad_array_new.cc \
@@ -127,6 +128,9 @@ cp-demangle.lo: cp-demangle.c
cp-demangle.o: cp-demangle.c
$(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<
+atomicity_file = ${glibcxx_srcdir}/$(ATOMICITY_SRCDIR)/atomicity.h
+atomicity.cc: ${atomicity_file}
+ $(LN_S) ${atomicity_file} ./atomicity.cc || true
# 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
diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in
index 831f3ed..5776a56 100644
--- a/libstdc++-v3/libsupc++/Makefile.in
+++ b/libstdc++-v3/libsupc++/Makefile.in
@@ -153,13 +153,13 @@ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(bitsdir)" \
LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
libsupc___la_LIBADD =
am__objects_1 = array_type_info.lo atexit_arm.lo atexit_thread.lo \
- bad_alloc.lo bad_array_length.lo bad_array_new.lo bad_cast.lo \
- bad_typeid.lo class_type_info.lo del_op.lo del_ops.lo \
- del_opnt.lo del_opv.lo del_opvs.lo del_opvnt.lo dyncast.lo \
- eh_alloc.lo eh_arm.lo eh_aux_runtime.lo eh_call.lo eh_catch.lo \
- eh_exception.lo eh_globals.lo eh_personality.lo eh_ptr.lo \
- eh_term_handler.lo eh_terminate.lo eh_tm.lo eh_throw.lo \
- eh_type.lo eh_unex_handler.lo enum_type_info.lo \
+ atomicity.lo bad_alloc.lo bad_array_length.lo bad_array_new.lo \
+ bad_cast.lo bad_typeid.lo class_type_info.lo del_op.lo \
+ del_ops.lo del_opnt.lo del_opv.lo del_opvs.lo del_opvnt.lo \
+ dyncast.lo eh_alloc.lo eh_arm.lo eh_aux_runtime.lo eh_call.lo \
+ eh_catch.lo eh_exception.lo eh_globals.lo eh_personality.lo \
+ eh_ptr.lo eh_term_handler.lo eh_terminate.lo eh_tm.lo \
+ eh_throw.lo eh_type.lo eh_unex_handler.lo enum_type_info.lo \
function_type_info.lo fundamental_type_info.lo guard.lo \
guard_error.lo hash_bytes.lo nested_exception.lo \
new_handler.lo new_op.lo new_opnt.lo new_opv.lo new_opvnt.lo \
@@ -503,6 +503,7 @@ sources = \
array_type_info.cc \
atexit_arm.cc \
atexit_thread.cc \
+ atomicity.cc \
bad_alloc.cc \
bad_array_length.cc \
bad_array_new.cc \
@@ -569,6 +570,7 @@ sources = \
libsupc___la_SOURCES = $(sources) $(c_sources) $(vtv_sources)
libsupc__convenience_la_SOURCES = $(sources) $(c_sources) $(vtv_sources)
+atomicity_file = ${glibcxx_srcdir}/$(ATOMICITY_SRCDIR)/atomicity.h
# 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
@@ -960,6 +962,8 @@ cp-demangle.lo: cp-demangle.c
$(LTCOMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<
cp-demangle.o: cp-demangle.c
$(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<
+atomicity.cc: ${atomicity_file}
+ $(LN_S) ${atomicity_file} ./atomicity.cc || true
install-stdHEADERS: $(std_HEADERS)
@$(NORMAL_INSTALL)