aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp
diff options
context:
space:
mode:
authoralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
committeralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
commitbf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch)
tree1d1df72c0541a59a81439842f46d95396d3e7189 /contrib/libs/cxxsupp
parent8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff)
downloadydb-bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0.tar.gz
add ymake export to ydb
Diffstat (limited to 'contrib/libs/cxxsupp')
-rw-r--r--contrib/libs/cxxsupp/builtins/ya.make122
-rw-r--r--contrib/libs/cxxsupp/libcxx/ya.make258
-rw-r--r--contrib/libs/cxxsupp/libcxxabi-parts/ya.make48
-rw-r--r--contrib/libs/cxxsupp/libcxxabi/ya.make59
-rw-r--r--contrib/libs/cxxsupp/libcxxrt/ya.make53
-rw-r--r--contrib/libs/cxxsupp/openmp/ya.make93
-rw-r--r--contrib/libs/cxxsupp/ya.make29
7 files changed, 662 insertions, 0 deletions
diff --git a/contrib/libs/cxxsupp/builtins/ya.make b/contrib/libs/cxxsupp/builtins/ya.make
new file mode 100644
index 0000000000..85ba69953e
--- /dev/null
+++ b/contrib/libs/cxxsupp/builtins/ya.make
@@ -0,0 +1,122 @@
+LIBRARY()
+
+# Part of compiler-rt LLVM subproject
+
+# git repository: https://github.com/llvm/llvm-project.git
+# directory: compiler-rt/lib/builtins
+# revision: 08f0372c351a57b01afee6c64066961203da28c5
+
+# os_version_check.c was taken from revision 81b89fd7bdddb7da66f2cdace97d6ede5f99d58a
+# os_version_check.c was patched from git repository https://github.com/apple/llvm-project.git revision a02454b91d2aec347b9ce03020656c445f3b2841
+
+LICENSE(
+ Apache-2.0 AND
+ Apache-2.0 WITH LLVM-exception AND
+ MIT AND
+ NCSA
+)
+
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
+VERSION(2016-03-03-08f0372c351a57b01afee6c64066961203da28c5)
+
+ORIGINAL_SOURCE(https://github.com/llvm/llvm-project)
+
+# Check MUSL before NO_PLATFORM() disables it.
+IF (MUSL)
+ # We use C headers despite NO_PLATFORM, but we do not propagate
+ # them with ADDINCL GLOBAL because we do not have an API, and we
+ # can not propagate them because libcxx has to put its own
+ # includes before musl includes for its include_next to work.
+ ADDINCL(
+ contrib/libs/musl/arch/x86_64
+ contrib/libs/musl/arch/generic
+ contrib/libs/musl/include
+ contrib/libs/musl/extra
+ )
+ENDIF()
+
+NO_UTIL()
+
+NO_RUNTIME()
+
+NO_PLATFORM()
+
+NO_COMPILER_WARNINGS()
+
+NO_SANITIZE_HEADERS()
+
+IF (GCC OR CLANG)
+ # Clang (maybe GCC too) LTO code generator leaves the builtin calls unresolved
+ # even if they are available. After the code generation pass is done
+ # a linker is forced to select original object files from this library again
+ # as they contain unresolved symbols. But code generation is already done,
+ # object files actually are not ELFs but an LLVM bytecode and we get
+ # "member at xxxxx is not an ELF object" errors from the linker.
+ # Just generate native code from the beginning.
+ DISABLE(USE_LTO)
+ENDIF()
+
+SRCS(
+ addtf3.c
+ ashlti3.c
+ clzti2.c
+ comparetf2.c
+ divdc3.c
+ divsc3.c
+ divtf3.c
+ divti3.c
+ divxc3.c
+ extenddftf2.c
+ extendsftf2.c
+ fixdfti.c
+ fixsfti.c
+ fixtfdi.c
+ fixtfsi.c
+ fixunsdfti.c
+ fixunssfti.c
+ fixunstfdi.c
+ fixunstfsi.c
+ fixunstfti.c
+ fixunsxfti.c
+ floatditf.c
+ floatsitf.c
+ floattidf.c
+ floattisf.c
+ floattixf.c
+ floatunditf.c
+ floatunsitf.c
+ floatuntidf.c
+ floatuntisf.c
+ gcc_personality_v0.c
+ int_util.c
+ lshrti3.c
+ modti3.c
+ muldc3.c
+ muloti4.c
+ mulsc3.c
+ multf3.c
+ mulxc3.c
+ popcountdi2.c
+ subtf3.c
+ trunctfdf2.c
+ trunctfsf2.c
+ udivmodti4.c
+ udivti3.c
+ umodti3.c
+)
+
+IF (OS_DARWIN OR OS_IOS)
+ SRCS(
+ os_version_check.c
+ )
+ENDIF()
+
+IF (ARCH_ARM)
+ SRCS(
+ clear_cache.c
+ multc3.c
+ )
+ENDIF()
+
+END()
diff --git a/contrib/libs/cxxsupp/libcxx/ya.make b/contrib/libs/cxxsupp/libcxx/ya.make
new file mode 100644
index 0000000000..74502cedc4
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/ya.make
@@ -0,0 +1,258 @@
+LIBRARY()
+
+LICENSE(
+ Apache-2.0 AND
+ Apache-2.0 WITH LLVM-exception AND
+ BSD-2-Clause AND
+ MIT AND
+ NCSA
+)
+
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
+VERSION(2022-02-20)
+
+ORIGINAL_SOURCE(https://github.com/llvm/llvm-project/archive/34313583331e5c8cb0d3df28efb6c34c428fd235.tar.gz)
+
+ADDINCL(
+ GLOBAL contrib/libs/cxxsupp/libcxx/include
+ contrib/libs/cxxsupp/libcxx/src
+)
+
+NO_SANITIZE_HEADERS()
+
+CXXFLAGS(-D_LIBCPP_BUILDING_LIBRARY)
+
+IF (OS_ANDROID)
+ DEFAULT(CXX_RT "default")
+ IF (ARCH_I686 OR ARCH_ARM7)
+ # 32-bit architectures require additional libandroid_support.so to be linked
+ # We add --start-group / --end-group statements due to the issue in NDK < r22.
+ # See: https://github.com/android/ndk/issues/1130
+ #
+ # Though these statements are not respected by LLD, they might have sense for other linkers.
+ LDFLAGS(
+ -Wl,--start-group
+ -lc++abi
+ -landroid_support
+ -Wl,--end-group
+ )
+ ELSE()
+ LDFLAGS(-lc++abi)
+ ENDIF()
+ CFLAGS(
+ -DLIBCXX_BUILDING_LIBCXXABI
+ )
+ELSEIF (OS_IOS)
+ # Take cxxabi implementation from system.
+ LDFLAGS(-lc++abi)
+ CFLAGS(
+ -DLIBCXX_BUILDING_LIBCXXABI
+ )
+ # Yet take builtins library from Arcadia
+ PEERDIR(
+ contrib/libs/cxxsupp/builtins
+ )
+ELSEIF (OS_LINUX OR OS_DARWIN)
+ IF (ARCH_ARM7)
+ # XXX: libcxxrt support for ARM is currently broken
+ DEFAULT(CXX_RT "glibcxx_static")
+ # ARM7 OS_SDK has old libstdc++ without aligned allocation support
+ CFLAGS(
+ GLOBAL -fno-aligned-new
+ )
+ ELSE()
+ DEFAULT(CXX_RT "libcxxrt")
+ ENDIF()
+ IF (MUSL)
+ PEERDIR(
+ contrib/libs/musl/include
+ )
+ ENDIF()
+ELSEIF (OS_WINDOWS)
+ SRCS(
+ src/support/win32/locale_win32.cpp
+ src/support/win32/support.cpp
+ src/support/win32/atomic_win32.cpp
+ src/support/win32/new_win32.cpp
+ src/support/win32/thread_win32.cpp
+ )
+ CFLAGS(
+ GLOBAL -D_LIBCPP_VASPRINTF_DEFINED
+ GLOBAL -D_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_
+ )
+ IF (CLANG_CL)
+ PEERDIR(
+ contrib/libs/cxxsupp/builtins
+ )
+ ENDIF()
+ELSE()
+ DEFAULT(CXX_RT "glibcxx_static")
+ CXXFLAGS(
+ -Wno-unknown-pragmas
+ -nostdinc++
+ )
+ENDIF()
+
+IF (OS_LINUX)
+ EXTRALIBS(-lpthread)
+ENDIF()
+
+IF (CLANG)
+ CFLAGS(
+ GLOBAL -nostdinc++
+ )
+ENDIF()
+
+# The CXX_RT variable controls which C++ runtime is used.
+# * libcxxrt - https://github.com/libcxxrt/libcxxrt library stored in Arcadia
+# * glibcxx_static - GNU C++ Library runtime with static linkage
+# * glibcxx_dynamic - GNU C++ Library runtime with dynamic linkage
+# * default - default C++ runtime provided by the compiler driver
+#
+# All glibcxx* runtimes are taken from system/compiler SDK
+
+DEFAULT(CXX_RT "default")
+
+DISABLE(NEED_GLIBCXX_CXX17_SHIMS)
+DISABLE(NEED_CXX_RT_ADDINCL)
+
+IF (CXX_RT == "libcxxrt")
+ PEERDIR(
+ contrib/libs/cxxsupp/libcxxabi-parts
+ contrib/libs/cxxsupp/libcxxrt
+ contrib/libs/cxxsupp/builtins
+ )
+ ADDINCL(
+ GLOBAL contrib/libs/cxxsupp/libcxxrt/include
+ )
+ CFLAGS(
+ GLOBAL -DLIBCXX_BUILDING_LIBCXXRT
+ )
+ # 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)
+ CFLAGS(
+ GLOBAL -DLIBCXX_BUILDING_LIBGCC
+ )
+ELSEIF (CXX_RT == "glibcxx_dynamic")
+ LDFLAGS(
+ -lgcc_s
+ -lstdc++
+ )
+ CXXFLAGS(-D__GLIBCXX__=1)
+ CFLAGS(
+ GLOBAL -DLIBCXX_BUILDING_LIBGCC
+ )
+ ENABLE(NEED_GLIBCXX_CXX17_SHIMS)
+ ENABLE(NEED_CXX_RT_ADDINCL)
+ELSEIF (CXX_RT == "default")
+ # Do nothing
+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()
+
+NO_COMPILER_WARNINGS()
+
+IF (FUZZING)
+ NO_SANITIZE()
+ NO_SANITIZE_COVERAGE()
+ENDIF()
+
+SRCS(
+ src/algorithm.cpp
+ src/any.cpp
+ src/assert.cpp
+ src/atomic.cpp
+ src/barrier.cpp
+ src/bind.cpp
+ src/charconv.cpp
+ src/chrono.cpp
+ src/condition_variable.cpp
+ src/condition_variable_destructor.cpp
+ src/debug.cpp
+ src/exception.cpp
+ src/filesystem/directory_iterator.cpp
+ src/filesystem/operations.cpp
+ src/functional.cpp
+ src/future.cpp
+ src/hash.cpp
+ src/ios.cpp
+ src/ios.instantiations.cpp
+ src/iostream.cpp
+ src/legacy_pointer_safety.cpp
+ src/locale.cpp
+ src/memory.cpp
+ src/mutex.cpp
+ src/mutex_destructor.cpp
+ src/optional.cpp
+ src/random.cpp
+ src/random_shuffle.cpp
+ src/regex.cpp
+ src/ryu/d2fixed.cpp
+ src/ryu/d2s.cpp
+ src/ryu/f2s.cpp
+ src/shared_mutex.cpp
+ src/stdexcept.cpp
+ src/string.cpp
+ src/strstream.cpp
+ src/system_error.cpp
+ src/thread.cpp
+ src/typeinfo.cpp
+ src/utility.cpp
+ src/valarray.cpp
+ src/variant.cpp
+ src/vector.cpp
+)
+
+IF (NOT GCC)
+ # compiling src/format.cpp requires -std=c++20,
+ # yet our GCC version it too auld for this.
+ SRCS(
+ src/format.cpp
+ )
+ENDIF()
+
+IF (NOT OS_WINDOWS)
+ SRCS(
+ src/new.cpp
+ )
+ENDIF()
+
+END()
diff --git a/contrib/libs/cxxsupp/libcxxabi-parts/ya.make b/contrib/libs/cxxsupp/libcxxabi-parts/ya.make
new file mode 100644
index 0000000000..cd56d65395
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxxabi-parts/ya.make
@@ -0,0 +1,48 @@
+LIBRARY()
+
+WITHOUT_LICENSE_TEXTS()
+
+LICENSE(
+ Apache-2.0
+ WITH
+ LLVM-exception
+)
+
+VERSION(14.0.6)
+
+ORIGINAL_SOURCE(https://github.com/llvm/llvm-project/archive/llvmorg-14.0.6.tar.gz)
+
+ADDINCL(
+ contrib/libs/cxxsupp/libcxxabi/include
+ contrib/libs/cxxsupp/libcxx/include
+ contrib/libs/cxxsupp/libcxx
+)
+
+NO_COMPILER_WARNINGS()
+
+NO_SANITIZE_HEADERS()
+
+NO_RUNTIME()
+
+NO_UTIL()
+
+CFLAGS(-D_LIBCXXABI_BUILDING_LIBRARY)
+
+IF (EXPORT_CMAKE)
+ # TODO(YMAKE-91) keep flags required for libc++ vendoring in a separate core.conf variable
+ CXXFLAGS(GLOBAL -nostdinc++)
+ENDIF()
+
+SRCDIR(contrib/libs/cxxsupp/libcxxabi)
+
+SRCS(
+ src/abort_message.cpp
+ src/cxa_demangle.cpp
+)
+
+SRC_C_PIC(
+ src/cxa_thread_atexit.cpp
+ -fno-lto
+)
+
+END()
diff --git a/contrib/libs/cxxsupp/libcxxabi/ya.make b/contrib/libs/cxxsupp/libcxxabi/ya.make
new file mode 100644
index 0000000000..d71d5b8ec2
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxxabi/ya.make
@@ -0,0 +1,59 @@
+# Generated by devtools/yamaker from nixpkgs 22.11.
+
+LIBRARY()
+
+LICENSE(
+ Apache-2.0 AND
+ Apache-2.0 WITH LLVM-exception AND
+ MIT AND
+ NCSA
+)
+
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
+VERSION(14.0.6)
+
+ORIGINAL_SOURCE(https://github.com/llvm/llvm-project/archive/llvmorg-14.0.6.tar.gz)
+
+ADDINCL(
+ contrib/libs/cxxsupp/libcxxabi/include
+ contrib/libs/cxxsupp/libcxx/include
+ contrib/libs/cxxsupp/libcxx/src
+)
+
+NO_COMPILER_WARNINGS()
+
+NO_RUNTIME()
+
+NO_UTIL()
+
+CFLAGS(
+ -D_LIBCXXABI_BUILDING_LIBRARY
+)
+
+SRCS(
+ src/abort_message.cpp
+ src/cxa_aux_runtime.cpp
+ src/cxa_default_handlers.cpp
+ src/cxa_demangle.cpp
+ src/cxa_exception.cpp
+ src/cxa_exception_storage.cpp
+ src/cxa_guard.cpp
+ src/cxa_handlers.cpp
+ src/cxa_personality.cpp
+ src/cxa_vector.cpp
+ src/cxa_virtual.cpp
+ src/fallback_malloc.cpp
+ src/private_typeinfo.cpp
+ src/stdlib_exception.cpp
+ src/stdlib_new_delete.cpp
+ src/stdlib_stdexcept.cpp
+ src/stdlib_typeinfo.cpp
+)
+
+SRC_C_PIC(
+ src/cxa_thread_atexit.cpp
+ -fno-lto
+)
+
+END()
diff --git a/contrib/libs/cxxsupp/libcxxrt/ya.make b/contrib/libs/cxxsupp/libcxxrt/ya.make
new file mode 100644
index 0000000000..6e091b8ec9
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxxrt/ya.make
@@ -0,0 +1,53 @@
+# Generated by devtools/yamaker from nixpkgs 22.05.
+
+LIBRARY()
+
+LICENSE(
+ BSD-2-Clause AND
+ BSD-2-Clause-Views AND
+ BSD-3-Clause AND
+ MIT
+)
+
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
+VERSION(2021-09-08)
+
+ORIGINAL_SOURCE(https://github.com/libcxxrt/libcxxrt/archive/14bf5d5526056ae1cc16f03b7b8e96108a1e38d0.tar.gz)
+
+ADDINCL(
+ contrib/libs/cxxsupp/libcxxrt
+)
+
+NO_COMPILER_WARNINGS()
+
+NO_RUNTIME()
+
+CXXFLAGS(-nostdinc++)
+
+IF (CXX_UNWIND == "glibcxx_dynamic" OR ARCH_PPC64LE)
+ LDFLAGS(-lgcc_s)
+ELSE()
+ PEERDIR(
+ contrib/libs/libunwind
+ )
+ENDIF()
+
+NO_SANITIZE_HEADERS()
+
+IF (SANITIZER_TYPE == undefined OR FUZZING)
+ NO_SANITIZE()
+ NO_SANITIZE_COVERAGE()
+ENDIF()
+
+SRCS(
+ auxhelper.cc
+ dynamic_cast.cc
+ exception.cc
+ guard.cc
+ memory.cc
+ stdexcept.cc
+ typeinfo.cc
+)
+
+END()
diff --git a/contrib/libs/cxxsupp/openmp/ya.make b/contrib/libs/cxxsupp/openmp/ya.make
new file mode 100644
index 0000000000..897aa1bd85
--- /dev/null
+++ b/contrib/libs/cxxsupp/openmp/ya.make
@@ -0,0 +1,93 @@
+# Generated by devtools/yamaker from nixpkgs 22.11.
+
+LIBRARY()
+
+LICENSE(
+ Apache-2.0 AND
+ Apache-2.0 WITH LLVM-exception AND
+ Intel-LLVM-SGA AND
+ MIT AND
+ NCSA
+)
+
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
+VERSION(15.0.7)
+
+ORIGINAL_SOURCE(https://github.com/llvm/llvm-project/archive/llvmorg-15.0.7.tar.gz)
+
+ADDINCL(
+ GLOBAL contrib/libs/cxxsupp/openmp
+)
+
+NO_COMPILER_WARNINGS()
+
+NO_UTIL()
+
+NO_LTO()
+
+CFLAGS(
+ -fno-exceptions
+ -DKMP_USE_MONITOR=1
+)
+
+IF (SANITIZER_TYPE == thread)
+ NO_SANITIZE()
+ CFLAGS(
+ -fPIC
+ )
+ENDIF()
+
+IF (SANITIZER_TYPE == memory)
+ NO_SANITIZE()
+ CFLAGS(
+ -fPIC
+ )
+ENDIF()
+
+# The KMP_DEBUG define enables OpenMP debugging support, including tracing (controlled by environment variables)
+# and debug asserts. The upstream version unconditionally enables KMP_DEBUG for Debug/RelWithDebInfo builds.
+# Instead, we make this opt-in via a `ymake` variable to avoid accidentally releasing a relwithdebinfo binary
+# with KMP_DEBUG enabled. Note that the `ymake` variable is called OPENMP_DEBUG for clarity, since no one
+# really knows what KMP is.
+IF (OPENMP_DEBUG)
+ CFLAGS(
+ -DKMP_DEBUG=1
+ )
+ENDIF()
+
+SRCS(
+ kmp_affinity.cpp
+ kmp_alloc.cpp
+ kmp_atomic.cpp
+ kmp_barrier.cpp
+ kmp_cancel.cpp
+ kmp_csupport.cpp
+ kmp_debug.cpp
+ kmp_dispatch.cpp
+ kmp_environment.cpp
+ kmp_error.cpp
+ kmp_ftn_cdecl.cpp
+ kmp_ftn_extra.cpp
+ kmp_global.cpp
+ kmp_gsupport.cpp
+ kmp_i18n.cpp
+ kmp_io.cpp
+ kmp_itt.cpp
+ kmp_lock.cpp
+ kmp_runtime.cpp
+ kmp_sched.cpp
+ kmp_settings.cpp
+ kmp_str.cpp
+ kmp_taskdeps.cpp
+ kmp_tasking.cpp
+ kmp_threadprivate.cpp
+ kmp_utility.cpp
+ kmp_version.cpp
+ kmp_wait_release.cpp
+ ompt-general.cpp
+ z_Linux_asm.S
+ z_Linux_util.cpp
+)
+
+END()
diff --git a/contrib/libs/cxxsupp/ya.make b/contrib/libs/cxxsupp/ya.make
new file mode 100644
index 0000000000..6cc84b7141
--- /dev/null
+++ b/contrib/libs/cxxsupp/ya.make
@@ -0,0 +1,29 @@
+LIBRARY()
+
+WITHOUT_LICENSE_TEXTS()
+
+# Proxy library
+LICENSE(Not-Applicable)
+
+NO_SANITIZE_HEADERS()
+
+NO_PLATFORM()
+
+IF (NOT USE_STL_SYSTEM)
+ PEERDIR(
+ contrib/libs/cxxsupp/libcxx
+ )
+ELSE()
+ PEERDIR(
+ contrib/libs/cxxsupp/system_stl
+ )
+ENDIF()
+
+END()
+
+RECURSE(
+ libcxx
+ libcxxabi
+ libcxxrt
+ openmp
+)