diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2025-03-03 19:55:08 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2025-03-03 20:18:36 +0300 |
commit | 92c70f8129e50e748728331eb0605da6f2d58f36 (patch) | |
tree | 8330797ca61eb6adc092195729b441cb8b2b14e7 | |
parent | 2bc1762eb4cc1110a3dfe6195ec4ee7423a9e30e (diff) | |
download | ydb-92c70f8129e50e748728331eb0605da6f2d58f36.tar.gz |
Intermediate changes
commit_hash:be434c99b42a4b4baf5cc164e6e573152ab3a84e
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/.yandex_meta/build.ym | 48 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/glibcxx_eh_cxx17.cpp | 17 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/ya.make | 47 |
3 files changed, 2 insertions, 110 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/.yandex_meta/build.ym b/contrib/libs/cxxsupp/libcxx/.yandex_meta/build.ym index 23f291c8a4..85545f7c95 100644 --- a/contrib/libs/cxxsupp/libcxx/.yandex_meta/build.ym +++ b/contrib/libs/cxxsupp/libcxx/.yandex_meta/build.ym @@ -5,7 +5,6 @@ {% block keep_sources %} .yandex_meta/scripts/sysincls.py -glibcxx_eh_cxx17.cpp include/__config_site include/__config_epilogue.h include/__memory/pointer_safety.h @@ -114,12 +113,7 @@ ELSEIF (OS_IOS) ELSEIF (OS_LINUX OR OS_DARWIN) IF (ARCH_ARM7) # libcxxrt support for ARM is currently broken, use libcxxabi instead - # But allow switching back to glibcxx_static via -DCXX_RT=glibcxx_static - DEFAULT(CXX_RT "libcxxabi") - # ARM7 OS_SDK has old libstdc++ without aligned allocation support - CFLAGS( - GLOBAL -fno-aligned-new - ) + SET(CXX_RT "libcxxabi") ELSE() SET(CXX_RT "libcxxrt") ENDIF() @@ -156,13 +150,8 @@ ENDIF() # * libcxxabi - https://github.com/llvm/llvm-project/tree/main/libcxxabi from Arcadia # * libcxxabi_dynamic - https://github.com/llvm/llvm-project/tree/main/libcxxabi from SDK, dynamically linked # * libcxxrt - https://github.com/libcxxrt/libcxxrt from Arcadia (with some parts hijacked from libcxxabi) -# * glibcxx_static - https://github.com/gcc-mirror/gcc/tree/master/libstdc++-v3/libsupc++ from SDK, statically linked # * msvcrt - Visual C++ runtime library from SDK, dynamically linked -DISABLE(NEED_GLIBCXX_CXX17_SHIMS) - -DISABLE(NEED_CXX_RT_ADDINCL) - IF (CXX_RT == "libcxxrt") PEERDIR( contrib/libs/cxxsupp/libcxxabi-parts @@ -175,20 +164,6 @@ IF (CXX_RT == "libcxxrt") CFLAGS( -DLIBCXXRT ) - # These builtins are equivalent to clang -rtlib=compiler_rt and - # are needed by potentially any code generated by clang. - # With glibcxx runtime, builtins are provided by libgcc -ELSEIF (CXX_RT == "glibcxx_static") - LDFLAGS( - -Wl,-Bstatic - -lsupc++ - -lgcc - -lgcc_eh - -Wl,-Bdynamic - ) - CXXFLAGS(-D__GLIBCXX__=1) - ENABLE(NEED_GLIBCXX_CXX17_SHIMS) - ENABLE(NEED_CXX_RT_ADDINCL) ELSEIF (CXX_RT == "libcxxabi") PEERDIR( contrib/libs/cxxsupp/builtins @@ -213,27 +188,6 @@ ELSE() MESSAGE(FATAL_ERROR "Unexpected CXX_RT value: \${CXX_RT}") ENDIF() -IF (NEED_GLIBCXX_CXX17_SHIMS) - IF (GCC) - # Assume GCC is bundled with a modern enough version of C++ runtime - ELSEIF (OS_SDK == "ubuntu-12" OR OS_SDK == "ubuntu-14" OR OS_SDK == "ubuntu-16") - # Prior to ubuntu-18, system C++ runtime for C++17 is incomplete - # and requires std::uncaught_exceptions() to be implemented. - SRCS( - glibcxx_eh_cxx17.cpp - ) - ENDIF() -ENDIF() - -IF (NEED_CXX_RT_ADDINCL) - # FIXME: - # This looks extremely weird and we have to use cxxabi.h from libsupc++ instead. - # This ADDINCL is placed here just to fix the status quo - ADDINCL( - GLOBAL contrib/libs/cxxsupp/libcxxrt/include - ) -ENDIF() - NO_UTIL() NO_RUNTIME() diff --git a/contrib/libs/cxxsupp/libcxx/glibcxx_eh_cxx17.cpp b/contrib/libs/cxxsupp/libcxx/glibcxx_eh_cxx17.cpp deleted file mode 100644 index 5e5ad083ba..0000000000 --- a/contrib/libs/cxxsupp/libcxx/glibcxx_eh_cxx17.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include <cxxabi.h> - -/** - * libc++ expects std::uncaught_exceptions() to be provided by C++ runtime library. - * - * GCC versions prior to GCC 6 did not provide this function yet, but it can be - * implemented using its API. - * - * This implementation should cover ubuntu-12, ubuntu-14, ubuntu-16. - */ - -namespace std { - int uncaught_exceptions() noexcept { - const auto* globals{__cxxabiv1::__cxa_get_globals()}; - return static_cast<int>(globals->uncaughtExceptions); - } -} diff --git a/contrib/libs/cxxsupp/libcxx/ya.make b/contrib/libs/cxxsupp/libcxx/ya.make index 122c16d4f7..c4b545164e 100644 --- a/contrib/libs/cxxsupp/libcxx/ya.make +++ b/contrib/libs/cxxsupp/libcxx/ya.make @@ -36,12 +36,7 @@ ELSEIF (OS_IOS) ELSEIF (OS_LINUX OR OS_DARWIN) IF (ARCH_ARM7) # libcxxrt support for ARM is currently broken, use libcxxabi instead - # But allow switching back to glibcxx_static via -DCXX_RT=glibcxx_static - DEFAULT(CXX_RT "libcxxabi") - # ARM7 OS_SDK has old libstdc++ without aligned allocation support - CFLAGS( - GLOBAL -fno-aligned-new - ) + SET(CXX_RT "libcxxabi") ELSE() SET(CXX_RT "libcxxrt") ENDIF() @@ -74,13 +69,8 @@ ENDIF() # * libcxxabi - https://github.com/llvm/llvm-project/tree/main/libcxxabi from Arcadia # * libcxxabi_dynamic - https://github.com/llvm/llvm-project/tree/main/libcxxabi from SDK, dynamically linked # * libcxxrt - https://github.com/libcxxrt/libcxxrt from Arcadia (with some parts hijacked from libcxxabi) -# * glibcxx_static - https://github.com/gcc-mirror/gcc/tree/master/libstdc++-v3/libsupc++ from SDK, statically linked # * msvcrt - Visual C++ runtime library from SDK, dynamically linked -DISABLE(NEED_GLIBCXX_CXX17_SHIMS) - -DISABLE(NEED_CXX_RT_ADDINCL) - IF (CXX_RT == "libcxxrt") PEERDIR( contrib/libs/cxxsupp/libcxxabi-parts @@ -93,20 +83,6 @@ IF (CXX_RT == "libcxxrt") CFLAGS( -DLIBCXXRT ) - # These builtins are equivalent to clang -rtlib=compiler_rt and - # are needed by potentially any code generated by clang. - # With glibcxx runtime, builtins are provided by libgcc -ELSEIF (CXX_RT == "glibcxx_static") - LDFLAGS( - -Wl,-Bstatic - -lsupc++ - -lgcc - -lgcc_eh - -Wl,-Bdynamic - ) - CXXFLAGS(-D__GLIBCXX__=1) - ENABLE(NEED_GLIBCXX_CXX17_SHIMS) - ENABLE(NEED_CXX_RT_ADDINCL) ELSEIF (CXX_RT == "libcxxabi") PEERDIR( contrib/libs/cxxsupp/builtins @@ -129,27 +105,6 @@ ELSE() MESSAGE(FATAL_ERROR "Unexpected CXX_RT value: ${CXX_RT}") ENDIF() -IF (NEED_GLIBCXX_CXX17_SHIMS) - IF (GCC) - # Assume GCC is bundled with a modern enough version of C++ runtime - ELSEIF (OS_SDK == "ubuntu-12" OR OS_SDK == "ubuntu-14" OR OS_SDK == "ubuntu-16") - # Prior to ubuntu-18, system C++ runtime for C++17 is incomplete - # and requires std::uncaught_exceptions() to be implemented. - SRCS( - glibcxx_eh_cxx17.cpp - ) - ENDIF() -ENDIF() - -IF (NEED_CXX_RT_ADDINCL) - # FIXME: - # This looks extremely weird and we have to use cxxabi.h from libsupc++ instead. - # This ADDINCL is placed here just to fix the status quo - ADDINCL( - GLOBAL contrib/libs/cxxsupp/libcxxrt/include - ) -ENDIF() - NO_UTIL() NO_RUNTIME() |