Skip to content

Commit

Permalink
Library import 8 (#1074)
Browse files Browse the repository at this point in the history
* Library import 8

* Add contrib/libs/cxxsupp/libcxx/include/__verbose_abort
  • Loading branch information
alexv-smirnov authored Jan 18, 2024
1 parent 404ef88 commit 9d0a376
Show file tree
Hide file tree
Showing 850 changed files with 50,412 additions and 27,613 deletions.
4 changes: 3 additions & 1 deletion build/conf/compilers/gnu_compiler.conf
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ elsewhen ($PIE == "yes") {
}

when ($CLANG16 == "yes") {
CFLAGS+=-Wno-array-parameter -Wno-deprecate-lax-vec-conv-all -Wno-unqualified-std-cast-call -Wno-unused-but-set-parameter -Wno-unused-command-line-argument -Wno-unused-but-set-variable -Wno-implicit-function-declaration -Wno-int-conversion -Wno-incompatible-function-pointer-types -Wno-implicit-int -Wno-address-of-packed-member
CFLAGS+=-Wno-array-parameter -Wno-deprecate-lax-vec-conv-all -Wno-unqualified-std-cast-call -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-implicit-function-declaration -Wno-int-conversion -Wno-incompatible-function-pointer-types -Wno-implicit-int -Wno-address-of-packed-member
}

when ($MSAN_TRACK_ORIGIN == "yes") {
Expand All @@ -67,6 +67,8 @@ when ($ARCH_XTENSA == "yes") {

when ($OS_EMSCRIPTEN == "yes") {
FSTACK=-fno-stack-protector
CFLAGS+=-D__EMSCRIPTEN__
CFLAGS+=-D_LIBCPP_HAS_MUSL_LIBC
}

CFLAGS+=$_C_FLAGS $DEBUG_INFO_FLAGS $_C_FOPTIONS $C_WARNING_OPTS $GCC_PREPROCESSOR_OPTS $USER_CFLAGS $USER_CFLAGS_GLOBAL
Expand Down
15 changes: 15 additions & 0 deletions build/conf/java.conf
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,26 @@ JDK_LATEST_VERSION=19
JDK_LATEST_PEERDIR=build/platform/java/jdk/jdk${JDK_LATEST_VERSION}

# tag:java-specific
# Fill semantic by RUN_JAVA_PROGRAM()
_SEM_RUN_JAVA_PROGRAM= \
&& runs-ITEM \
&& runs-args ${Args} \
&& runs-classpath ${RUN_JAR_PROG_CP_PRE}${tool:CLASSPATH}${RUN_JAR_PROG_CP_SUF} \
&& runs-cwd ${cwd:CWD} \
&& runs-in ${IN} \
&& runs-in_dir ${IN_DIR} \
&& runs-in_dirs_inputs ${IN_DIRS_INPUTS} \
&& runs-in_noparse ${IN_NOPARSE} \
&& runs-out ${OUT} \
&& runs-out_dir ${OUT_DIR} \
&& runs-tool ${TOOL}

macro _DO_2_RUN_JAR_PROGRAM(IN_DIRS_VAR="uniq_", IN_DIRS_INPUTS[], IN{input}[], IN_NOPARSE{input}[], IN_DIR[], OUT_NOAUTO{output}[], OUT{output}[], TOOL{tool}[], OUT_DIR[], CLASSPATH[], ADD_SRCS_TO_CLASSPATH?"yes":"no", CWD="${ARCADIA_BUILD_ROOT}", STDOUT="", STDOUT_NOAUTO="", Args...) {
_LATE_GLOB(${IN_DIRS_VAR} ${suf=/**/*:IN_DIR})
_CHECK_RUN_JAVA_PROG_CLASSPATH($CLASSPATH)
.PEERDIR=build/platform/java/jdk $JDK_RESOURCE_PEERDIR
.CMD=${kv;hide:"p RJ"} ${kv;hide:"pc blue"} ${hide:JAVA_FAKEID} ${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/mkdir.py"} ${OUT_DIR} && ${cwd:CWD} $YMAKE_PYTHON ${input:"build/scripts/setup_java_tmpdir.py"} $YMAKE_PYTHON ${input:"build/scripts/stdout2stderr.py"} ${pre=--file=:STDOUT} ${output;hide:STDOUT} ${pre=--file=:STDOUT_NOAUTO} ${output;hide;noauto:STDOUT_NOAUTO} $YMAKE_PYTHON ${input:"build/scripts/fix_java_command_file_cp.py"} --build-root ${ARCADIA_BUILD_ROOT} $JDK_RESOURCE/bin/java -Dfile.encoding=utf8 -classpath ${RUN_JAR_PROG_CP_PRE}${tool:CLASSPATH}${RUN_JAR_PROG_CP_SUF} ${Args} && $_GENTAR_HELPER($CLASSPATH $IN_DIR $IN $IN_NOPARSE $TOOL $Args OUT_DIR $OUT_DIR) ${input;hide:IN} ${input;context=TEXT;hide:IN_NOPARSE} ${output;noauto;hide:OUT_NOAUTO} ${output;hide:OUT} ${tool;hide:TOOL} ${IN_DIRS_INPUTS}
.SEM=_SEM_RUN_JAVA_PROGRAM
}

# tag:java-specific
Expand Down
4 changes: 2 additions & 2 deletions build/conf/linkers/ld.conf
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ _C_SYSTEM_LIBRARIES=$_LD_USE_STDLIB $_LD_THREAD_LIBRARY $_LD_SYS_LIB -lc
when ($MUSL == "yes") {
_C_SYSTEM_LIBRARIES=-nostdlib
}
C_SYSTEM_LIBRARIES=$_C_SYSTEM_LIBRARIES
when ($OS_EMSCRIPTEN == "yes") {
C_SYSTEM_LIBRARIES=-nostdlib
_C_SYSTEM_LIBRARIES=-nostdlib
}
C_SYSTEM_LIBRARIES=$_C_SYSTEM_LIBRARIES

OBJADDE=

Expand Down
4 changes: 4 additions & 0 deletions build/conf/sysincl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,7 @@ when ($ARCH_RISCV32) {
when ($USE_ARCADIA_COMPILER_RUNTIME == "no") {
SYSINCL+=build/sysincl/local-compiler-runtime.yml
}

when ($OS_EMSCRIPTEN) {
SYSINCL+=build/sysincl/emscripten.yml
}
7 changes: 4 additions & 3 deletions build/export_generators/gradle/build.gradle.kts.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ dependencies {
{% if targets|selectattr("app_main_class") -%}
{% if library.excludes.consumer is defined %}
implementation({{ classpath }}) {
{% for exclude in library.excludes.consumer -%}
{% set classpath_parts = exclude.classpath.split(':') -%}
exclude group: '{{ classpath_parts[0] }}', module: '{{ classpath_parts[1] }}'
{% for exclude in library.excludes.consumer if exclude.classpath -%}
{% set classpath = exclude.classpath|replace('"','') -%}
{% set classpath_parts = split(classpath, ':') -%}
exclude(group = "{{ classpath_parts[0] }}", module = "{{ classpath_parts[1] }}")
{% endfor -%}
}
{% else -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, args):
if other_args[0] != '--linking-cmdline':
raise Exception("expected '--linking-cmdline' arg, got {}".format(other_args[0]))

self.is_msvc_linker = other_args[1].endswith('\\link.exe')
self.is_msvc_compatible_linker = other_args[1].endswith('\\link.exe') or other_args[1].endswith('\\lld-link.exe')

is_host_system_windows = self.parsed_args.cmake_host_system_name == 'Windows'
std_libraries_to_exclude_from_input = (
Expand All @@ -38,11 +38,9 @@ def __init__(self, args):
else set()
)
msvc_preserved_option_prefixes = [
'errorreport',
'machine:',
'nodefaultlib',
'nologo',
'subsystem',
]

self.preserved_options = []
Expand Down Expand Up @@ -129,7 +127,7 @@ def __init__(self, opts):
# force LIBTOOL even if CMAKE_AR is defined because 'ar' under Darwin does not contain the necessary options
arch_type = 'LIBTOOL'
archiver_tool_path = 'libtool'
elif opts.is_msvc_linker:
elif opts.is_msvc_compatible_linker:
arch_type = 'LIB'
elif opts.parsed_args.cmake_ar.endswith('llvm-ar'):
arch_type = 'LLVM_AR'
Expand All @@ -152,7 +150,7 @@ def __init__(self, opts):
def do(self, output, input_list):
input_file_path = None
try:
if self.opts.is_msvc_linker:
if self.opts.is_msvc_compatible_linker:
# use response file for input (because of Windows cmdline length limitations)

# can't use NamedTemporaryFile because of permissions issues on Windows
Expand All @@ -177,7 +175,7 @@ def do(self, output, input_list):
if input_file_path is not None:
os.remove(input_file_path)

if not self.opts.is_msvc_linker:
if not self.opts.is_msvc_compatible_linker:
subprocess.check_call([self.opts.parsed_args.cmake_ranlib, output])


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
include(default)
[settings]
arch=armv8
build_type=Release
compiler=clang
compiler.libcxx=libc++
compiler.version=14
compiler.cppstd=20
os=Android
os.api_level=21
[tool_requires]
android-ndk/r25
[options]
[env]

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
include(default)
[settings]
arch=armv7
build_type=Release
compiler=clang
compiler.libcxx=libc++
compiler.version=14
compiler.cppstd=20
os=Android
os.api_level=21
[tool_requires]
android-ndk/r25
[options]
[env]

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
include(default)
[settings]
arch=x86
build_type=Release
compiler=clang
compiler.libcxx=libc++
compiler.version=14
compiler.cppstd=20
os=Android
os.api_level=21
[tool_requires]
android-ndk/r25
[options]
[env]

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
include(default)
[settings]
arch=x86_64
build_type=Release
compiler=clang
compiler.libcxx=libc++
compiler.version=14
compiler.cppstd=20
os=Android
os.api_level=21
[tool_requires]
android-ndk/r25
[options]
[env]

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
include(default)

target_host=aarch64-linux-gnu

[settings]
arch=armv8
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=12
compiler.cppstd=20
os=Linux
[options]

[env]
CONAN_CMAKE_FIND_ROOT_PATH=/usr/$target_host
CONAN_CMAKE_SYSROOT=/usr/$target_host
SYSROOT=/usr/$target_host
CC=$target_host-gcc
CXX=$target_host-g++
CXXFLAGS="-I/usr/$target_host/include/"
CFLAGS="-I/usr/$target_host/include/"
CHOST=$target_host
AR=$target_host-ar
AS=$target_host-as
RANLIB=$target_host-ranlib
LD=$target_host-ld
STRIP=$target_host-strip
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
include(default)

target_host=powerpc64le-linux-gnu

[settings]
arch=ppc64le
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=12
compiler.cppstd=20
os=Linux
[options]

[env]
CONAN_CMAKE_FIND_ROOT_PATH=/usr/$target_host
CONAN_CMAKE_SYSROOT=/usr/$target_host
SYSROOT=/usr/$target_host
CC=$target_host-gcc
CXX=$target_host-g++
CXXFLAGS="-I/usr/$target_host/include/"
CFLAGS="-I/usr/$target_host/include/"
CHOST=$target_host
AR=$target_host-ar
AS=$target_host-as
RANLIB=$target_host-ranlib
LD=$target_host-ld
STRIP=$target_host-strip
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include(default)
[settings]
arch=armv8
build_type=Release
compiler=clang
compiler.libcxx=libc++
compiler.version=14
compiler.cppstd=20
os=Macos
[options]
[env]
11 changes: 9 additions & 2 deletions build/export_generators/hardcoded-cmake/cmake/conan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ macro(_conan_detect_compiler)
conan_cmake_detect_unix_libcxx(_LIBCXX)
set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX})
endif ()
elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang)
elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang
AND NOT "${CMAKE_${LANGUAGE}_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC"
AND NOT "${CMAKE_${LANGUAGE}_SIMULATE_ID}" STREQUAL "MSVC")

string(REPLACE "." ";" VERSION_LIST ${CMAKE_${LANGUAGE}_COMPILER_VERSION})
list(GET VERSION_LIST 0 MAJOR)
list(GET VERSION_LIST 1 MINOR)
Expand All @@ -190,7 +193,11 @@ macro(_conan_detect_compiler)
conan_cmake_detect_unix_libcxx(_LIBCXX)
set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX})
endif ()
elseif(${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL MSVC)
elseif(${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL MSVC
OR (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang
AND "${CMAKE_${LANGUAGE}_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC"
AND "${CMAKE_${LANGUAGE}_SIMULATE_ID}" STREQUAL "MSVC"))

set(_VISUAL "Visual Studio")
_get_msvc_ide_version(_VISUAL_VERSION)
if("${_VISUAL_VERSION}" STREQUAL "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,37 +48,9 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm.*|aarch64|ppc64le)")
string(APPEND _GNU_COMMON_C_CXX_FLAGS " -fsigned-char")
endif()

if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(i686|x86_64|AMD64)$")
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "i686")
string(APPEND _GNU_COMMON_C_CXX_FLAGS " -m32")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$")
string(APPEND _GNU_COMMON_C_CXX_FLAGS " -m64")
endif()
string(APPEND _GNU_COMMON_C_CXX_FLAGS "\
-msse2 \
-msse3 \
-mssse3 \
")
include(global_flags.compiler.gnu.march)
string(APPEND _GNU_COMMON_C_CXX_FLAGS " ${_GNU_MARCH_C_CXX_FLAGS}")

if ((CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$") OR (NOT ANDROID))
string(APPEND _GNU_COMMON_C_CXX_FLAGS "\
-msse4.1 \
-msse4.2 \
-mpopcnt \
")
if (NOT ANDROID)
# older clang versions did not support this feature on Android:
# https://reviews.llvm.org/rGc32d307a49f5255602e7543e64e6c38a7f536abc
string(APPEND _GNU_COMMON_C_CXX_FLAGS " -mcx16")
endif()
endif()

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
string(APPEND _GNU_COMMON_C_CXX_FLAGS " -D_YNDX_LIBUNWIND_ENABLE_EXCEPTION_BACKTRACE")
endif()
elseif (ANDROID AND (CMAKE_ANDROID_ARCH_ABI STREQUAL "armeabi-v7a"))
string(APPEND _GNU_COMMON_C_CXX_FLAGS " -mfloat-abi=softfp")
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_GNU_COMMON_C_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_GNU_COMMON_C_CXX_FLAGS} \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

set(_GNU_MARCH_C_CXX_FLAGS "")

if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(i686|x86_64|AMD64)$")
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "i686")
string(APPEND _GNU_MARCH_C_CXX_FLAGS " -m32")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$")
string(APPEND _GNU_MARCH_C_CXX_FLAGS " -m64")
endif()
string(APPEND _GNU_MARCH_C_CXX_FLAGS "\
-msse2 \
-msse3 \
-mssse3 \
")

if ((CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$") OR (NOT ANDROID))
string(APPEND _GNU_MARCH_C_CXX_FLAGS "\
-msse4.1 \
-msse4.2 \
-mpopcnt \
")
if (NOT ANDROID)
# older clang versions did not support this feature on Android:
# https://reviews.llvm.org/rGc32d307a49f5255602e7543e64e6c38a7f536abc
string(APPEND _GNU_MARCH_C_CXX_FLAGS " -mcx16")
endif()
endif()

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
string(APPEND _GNU_MARCH_C_CXX_FLAGS " -D_YNDX_LIBUNWIND_ENABLE_EXCEPTION_BACKTRACE")
endif()
elseif (ANDROID AND (CMAKE_ANDROID_ARCH_ABI STREQUAL "armeabi-v7a"))
string(APPEND _GNU_MARCH_C_CXX_FLAGS " -mfloat-abi=softfp")
endif()
Loading

0 comments on commit 9d0a376

Please sign in to comment.