Browse Source

Library import 8 (#1074)

* Library import 8

* Add contrib/libs/cxxsupp/libcxx/include/__verbose_abort
AlexSm 1 year ago
parent
commit
9d0a3761b3

+ 3 - 1
build/conf/compilers/gnu_compiler.conf

@@ -54,7 +54,7 @@ elsewhen ($PIE == "yes") {
 }
 }
 
 
 when ($CLANG16 == "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") {
 when ($MSAN_TRACK_ORIGIN == "yes") {
@@ -67,6 +67,8 @@ when ($ARCH_XTENSA == "yes") {
 
 
 when ($OS_EMSCRIPTEN == "yes") {
 when ($OS_EMSCRIPTEN == "yes") {
     FSTACK=-fno-stack-protector
     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
 CFLAGS+=$_C_FLAGS $DEBUG_INFO_FLAGS $_C_FOPTIONS $C_WARNING_OPTS $GCC_PREPROCESSOR_OPTS $USER_CFLAGS $USER_CFLAGS_GLOBAL

+ 15 - 0
build/conf/java.conf

@@ -414,11 +414,26 @@ JDK_LATEST_VERSION=19
 JDK_LATEST_PEERDIR=build/platform/java/jdk/jdk${JDK_LATEST_VERSION}
 JDK_LATEST_PEERDIR=build/platform/java/jdk/jdk${JDK_LATEST_VERSION}
 
 
 # tag:java-specific
 # 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...) {
 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})
     _LATE_GLOB(${IN_DIRS_VAR} ${suf=/**/*:IN_DIR})
     _CHECK_RUN_JAVA_PROG_CLASSPATH($CLASSPATH)
     _CHECK_RUN_JAVA_PROG_CLASSPATH($CLASSPATH)
     .PEERDIR=build/platform/java/jdk $JDK_RESOURCE_PEERDIR
     .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}
     .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
 # tag:java-specific

+ 2 - 2
build/conf/linkers/ld.conf

@@ -103,10 +103,10 @@ _C_SYSTEM_LIBRARIES=$_LD_USE_STDLIB $_LD_THREAD_LIBRARY $_LD_SYS_LIB -lc
 when ($MUSL == "yes") {
 when ($MUSL == "yes") {
     _C_SYSTEM_LIBRARIES=-nostdlib
     _C_SYSTEM_LIBRARIES=-nostdlib
 }
 }
-C_SYSTEM_LIBRARIES=$_C_SYSTEM_LIBRARIES
 when ($OS_EMSCRIPTEN == "yes") {
 when ($OS_EMSCRIPTEN == "yes") {
-    C_SYSTEM_LIBRARIES=-nostdlib
+    _C_SYSTEM_LIBRARIES=-nostdlib
 }
 }
+C_SYSTEM_LIBRARIES=$_C_SYSTEM_LIBRARIES
 
 
 OBJADDE=
 OBJADDE=
 
 

+ 4 - 0
build/conf/sysincl.conf

@@ -82,3 +82,7 @@ when ($ARCH_RISCV32) {
 when ($USE_ARCADIA_COMPILER_RUNTIME == "no") {
 when ($USE_ARCADIA_COMPILER_RUNTIME == "no") {
     SYSINCL+=build/sysincl/local-compiler-runtime.yml
     SYSINCL+=build/sysincl/local-compiler-runtime.yml
 }
 }
+
+when ($OS_EMSCRIPTEN) {
+    SYSINCL+=build/sysincl/emscripten.yml
+}

+ 4 - 3
build/export_generators/gradle/build.gradle.kts.jinja

@@ -46,9 +46,10 @@ dependencies {
 {%         if targets|selectattr("app_main_class") -%}
 {%         if targets|selectattr("app_main_class") -%}
 {%             if library.excludes.consumer is defined %}
 {%             if library.excludes.consumer is defined %}
     implementation({{ classpath }}) {
     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 -%}
 {%                 endfor -%}
     }
     }
 {%             else -%}
 {%             else -%}

+ 4 - 6
build/export_generators/hardcoded-cmake/build/scripts/create_recursive_library_for_cmake.py

@@ -29,7 +29,7 @@ class Opts(object):
         if other_args[0] != '--linking-cmdline':
         if other_args[0] != '--linking-cmdline':
             raise Exception("expected '--linking-cmdline' arg, got {}".format(other_args[0]))
             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'
         is_host_system_windows = self.parsed_args.cmake_host_system_name == 'Windows'
         std_libraries_to_exclude_from_input = (
         std_libraries_to_exclude_from_input = (
@@ -38,11 +38,9 @@ class Opts(object):
             else set()
             else set()
         )
         )
         msvc_preserved_option_prefixes = [
         msvc_preserved_option_prefixes = [
-            'errorreport',
             'machine:',
             'machine:',
             'nodefaultlib',
             'nodefaultlib',
             'nologo',
             'nologo',
-            'subsystem',
         ]
         ]
 
 
         self.preserved_options = []
         self.preserved_options = []
@@ -129,7 +127,7 @@ class FilesCombiner(object):
             # force LIBTOOL even if CMAKE_AR is defined because 'ar' under Darwin does not contain the necessary options
             # force LIBTOOL even if CMAKE_AR is defined because 'ar' under Darwin does not contain the necessary options
             arch_type = 'LIBTOOL'
             arch_type = 'LIBTOOL'
             archiver_tool_path = 'libtool'
             archiver_tool_path = 'libtool'
-        elif opts.is_msvc_linker:
+        elif opts.is_msvc_compatible_linker:
             arch_type = 'LIB'
             arch_type = 'LIB'
         elif opts.parsed_args.cmake_ar.endswith('llvm-ar'):
         elif opts.parsed_args.cmake_ar.endswith('llvm-ar'):
             arch_type = 'LLVM_AR'
             arch_type = 'LLVM_AR'
@@ -152,7 +150,7 @@ class FilesCombiner(object):
     def do(self, output, input_list):
     def do(self, output, input_list):
         input_file_path = None
         input_file_path = None
         try:
         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)
                 # use response file for input (because of Windows cmdline length limitations)
 
 
                 # can't use NamedTemporaryFile because of permissions issues on Windows
                 # can't use NamedTemporaryFile because of permissions issues on Windows
@@ -177,7 +175,7 @@ class FilesCombiner(object):
             if input_file_path is not None:
             if input_file_path is not None:
                 os.remove(input_file_path)
                 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])
             subprocess.check_call([self.opts.parsed_args.cmake_ranlib, output])
 
 
 
 

+ 15 - 0
build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.arm64.profile

@@ -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]
+

+ 15 - 0
build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.armv7.profile

@@ -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]
+

+ 15 - 0
build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.x86.profile

@@ -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]
+

+ 15 - 0
build/export_generators/hardcoded-cmake/cmake/conan-profiles/android.x86_64.profile

@@ -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]
+

Some files were not shown because too many files changed in this diff