diff options
author | thegeorg <thegeorg@yandex-team.com> | 2024-03-22 22:27:17 +0300 |
---|---|---|
committer | thegeorg <thegeorg@yandex-team.com> | 2024-03-22 22:37:50 +0300 |
commit | 479f32d72e7c09be2569241a47b9cd28bd13ab97 (patch) | |
tree | 9bb643ecf5ad013587f6369c7490ae12955c05cd | |
parent | faa1ad36d2e56b8c952b0a45ee32ca378764df36 (diff) | |
download | ydb-479f32d72e7c09be2569241a47b9cd28bd13ab97.tar.gz |
Use classic clang to emit AST on Android
49d8a171b92769861a4abb22bfbb16339ac2d398
-rw-r--r-- | build/platform/clang/ya.make | 9 | ||||
-rw-r--r-- | build/ymake.core.conf | 25 |
2 files changed, 4 insertions, 30 deletions
diff --git a/build/platform/clang/ya.make b/build/platform/clang/ya.make index 7f99cd1009..64dfc5e686 100644 --- a/build/platform/clang/ya.make +++ b/build/platform/clang/ya.make @@ -6,13 +6,4 @@ DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(CLANG16 clang16.json) # This is the default clang to be used in llvm-version-independent cases DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(CLANG clang14.json) -IF (OS_ANDROID) - DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE( - CLANG_ANDROID # Clang 12 - sbr:2554889297 FOR LINUX - sbr:2554895399 FOR DARWIN - sbr:2554895399 FOR DARWIN-ARM64 -) -ENDIF() - END() diff --git a/build/ymake.core.conf b/build/ymake.core.conf index 33aa8b71dc..13e90f8dba 100644 --- a/build/ymake.core.conf +++ b/build/ymake.core.conf @@ -4709,29 +4709,12 @@ macro USE_LLVM_BC16() { SET(CLANG_BC_ROOT ${CLANG16_RESOURCE_GLOBAL}) } -CLANG_DEFAULT_ROOT=${CLANG_RESOURCE_GLOBAL} -CLANG_C_COMPILER_BIN=${CLANG_RESOURCE_GLOBAL}/bin/clang -CLANG_CPP_COMPILER_BIN=${CLANG_RESOURCE_GLOBAL}/bin/clang++ - -when ($OS_ANDROID == "yes") { - # We use clang shipped with android-ndk which has different layout - CLANG_DEFAULT_ROOT=$CLANG_ANDROID_RESOURCE_GLOBAL - when ($HOST_OS_DARWIN) { - CLANG_C_COMPILER_BIN=${CLANG_ANDROID_RESOURCE_GLOBAL}/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang - CLANG_CPP_COMPILER_BIN=${CLANG_ANDROID_RESOURCE_GLOBAL}/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ - } - otherwise { - CLANG_C_COMPILER_BIN=${CLANG_ANDROID_RESOURCE_GLOBAL}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang - CLANG_CPP_COMPILER_BIN=${CLANG_ANDROID_RESOURCE_GLOBAL}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ - } -} - ### @usage: CLANG_EMIT_AST_CXX(Input Output Opts...) ### ### Emit Clang AST from .cpp file. CXXFLAGS and LLVM_OPTS are passed in, while CFLAGS and C_FLAGS_PLATFORM are not. ### Note: Output name is used as is, no extension added. macro CLANG_EMIT_AST_CXX(Input, Output, Opts...) { - .CMD=$YMAKE_PYTHON ${input:"build/scripts/clang_wrapper.py"} $WINDOWS ${CLANG_CPP_COMPILER_BIN} ${pre=-I:_C__INCLUDE} $CXXFLAGS $C_FLAGS_PLATFORM $LLVM_OPTS -emit-ast -c ${input:Input} -o ${noauto;output:Output} $Opts ${kv;hide:"p ST"} ${kv;hide:"pc light-green"} + .CMD=$YMAKE_PYTHON ${input:"build/scripts/clang_wrapper.py"} $WINDOWS ${CLANG_RESOURCE_GLOBAL}/bin/clang++ ${pre=-I:_C__INCLUDE} $CXXFLAGS $C_FLAGS_PLATFORM $LLVM_OPTS -emit-ast -c ${input:Input} -o ${noauto;output:Output} $Opts ${kv;hide:"p ST"} ${kv;hide:"pc light-green"} PEERDIR(build/platform/clang) } @@ -4760,7 +4743,7 @@ macro LLVM_COMPILE_C(Input, Output, Opts...) { ### Emit eBPF bytecode from .c file. ### Note: Output name is used as is, no extension added. macro BPF(Input, Output, Opts...) { - .CMD=$YMAKE_PYTHON ${input:"build/scripts/clang_wrapper.py"} $WINDOWS ${CLANG_C_COMPILER_BIN} ${pre=-I:_C__INCLUDE} $C_FLAGS_PLATFORM -target bpf -c ${input:Input} -o ${noauto;output:Output} $Opts ${kv;hide:"p BP"} ${kv;hide:"pc light-green"} + .CMD=$YMAKE_PYTHON ${input:"build/scripts/clang_wrapper.py"} $WINDOWS ${CLANG_RESOURCE_GLOBAL}/bin/clang ${pre=-I:_C__INCLUDE} $C_FLAGS_PLATFORM -target bpf -c ${input:Input} -o ${noauto;output:Output} $Opts ${kv;hide:"p BP"} ${kv;hide:"pc light-green"} PEERDIR(build/platform/clang) } @@ -4774,7 +4757,7 @@ when($OS_LINUX) { ### Emit eBPF bytecode from .c file. ### Note: Output name is used as is, no extension added. macro BPF_STATIC(Input, Output, Opts...) { - .CMD=$YMAKE_PYTHON ${input:"build/scripts/clang_wrapper.py"} $WINDOWS ${CLANG_C_COMPILER_BIN} ${pre=-I:_C__INCLUDE} $C_FLAGS_PLATFORM -target bpf -c ${input:Input} -o ${noauto;output:Output} $Opts ${kv;hide:"p BP"} ${kv;hide:"pc light-green"} && ${cwd:BINDIR} $LLD_ROOT_RESOURCE_GLOBAL/$LD_BINARY_NAME -r -b binary -m elf_x86_64 -o ${noauto;output;suf=.bpf.o:Input} ${noauto;nopath:Output} + .CMD=$YMAKE_PYTHON ${input:"build/scripts/clang_wrapper.py"} $WINDOWS ${CLANG_RESOURCE_GLOBAL}/bin/clang ${pre=-I:_C__INCLUDE} $C_FLAGS_PLATFORM -target bpf -c ${input:Input} -o ${noauto;output:Output} $Opts ${kv;hide:"p BP"} ${kv;hide:"pc light-green"} && ${cwd:BINDIR} $LLD_ROOT_RESOURCE_GLOBAL/$LD_BINARY_NAME -r -b binary -m elf_x86_64 -o ${noauto;output;suf=.bpf.o:Input} ${noauto;nopath:Output} PEERDIR(build/platform/clang build/platform/lld) } @@ -5845,6 +5828,6 @@ macro _CPP_STYLE(EXCLUDE[], Files...) { ### - CWD - path to the working directory of the Tool ### Note: Generated AST files generated into BINDIR according to corresponding .cpp file names listed in SOURCES parameter. macro CLANG_EMIT_AST_CXX_RUN_TOOL(SOURCES[], OPTS[], Tool, IN{input}[], IN_NOPARSE{input}[], OUT{output}[], OUT_NOAUTO{output}[], TOOL{tool}[], OUTPUT_INCLUDES[], INDUCED_DEPS[], IN_DEPS[], STDOUT="", STDOUT_NOAUTO="", CWD="", ENV[], Args...) { - .CMD=${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/clang_wrapper.py"} $WINDOWS ${CLANG_CPP_COMPILER_BIN} ${pre=-I:_C__INCLUDE} $CXXFLAGS $C_FLAGS_PLATFORM $LLVM_OPTS -emit-ast -c ${input:SOURCES} ${hide;tmp;noext;nopath:SOURCES.ast} $OPTS ${kv;hide:"p ST"} ${kv;hide:"pc light-green"} && ${cwd:CWD} ${env:ENV} ${tool:Tool} $Args ${hide;input:IN} ${input;context=TEXT;hide:IN_NOPARSE} ${hide;input:IN_DEPS} ${output_include;hide:OUTPUT_INCLUDES} $INDUCED_DEPS ${hide;tool:TOOL} ${hide;output:OUT} ${hide;noauto;output:OUT_NOAUTO} ${output;stdout:STDOUT} ${output;stdout;noauto:STDOUT_NOAUTO} ${kv;hide:"p PR"} ${kv;hide:"pc yellow"} ${kv;hide:"show_out"} + .CMD=${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/clang_wrapper.py"} $WINDOWS ${CLANG_RESOURCE_GLOBAL}/bin/clang++ ${pre=-I:_C__INCLUDE} $CXXFLAGS $C_FLAGS_PLATFORM $LLVM_OPTS -emit-ast -c ${input:SOURCES} ${hide;tmp;noext;nopath:SOURCES.ast} $OPTS ${kv;hide:"p ST"} ${kv;hide:"pc light-green"} && ${cwd:CWD} ${env:ENV} ${tool:Tool} $Args ${hide;input:IN} ${input;context=TEXT;hide:IN_NOPARSE} ${hide;input:IN_DEPS} ${output_include;hide:OUTPUT_INCLUDES} $INDUCED_DEPS ${hide;tool:TOOL} ${hide;output:OUT} ${hide;noauto;output:OUT_NOAUTO} ${output;stdout:STDOUT} ${output;stdout;noauto:STDOUT_NOAUTO} ${kv;hide:"p PR"} ${kv;hide:"pc yellow"} ${kv;hide:"show_out"} PEERDIR(build/platform/clang) } |