summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-08-07 20:29:36 -0700
committerKhem Raj <raj.khem@gmail.com>2024-08-09 09:25:32 -0700
commita5ebfbeaec07929844bc902fb386b229e360bde8 (patch)
tree003073d5766448bd1a4566a793541e44fbbe85b7
parent4141d77f0fb8a8e3f0d71b746523964f714907d4 (diff)
downloadmeta-clang-a5ebfbeaec07929844bc902fb386b229e360bde8.tar.gz
clang: Set -DLLVM_APPEND_VC_REV=OFF
Fixes Issue #991 If this is not disabled, the build tries to use CMake magic to compute repository and sha1 its building, however in case of OE it gets it completely wrong when building from tarball, because its building under TMPDIR which maybe a directory under main repo checkout e.g. poky tree so it traverses up and finds the sha of poky and assumes that its building from a git tree instead of tarball and emits the version control info into clang -v output e.g. ❯ ../image/mnt/b/yoe/master/build/tmp/work/x86_64-linux/clang-native/20.0.0/recipe-sysroot-native/usr/bin/clang -v clang version 20.0.0 (/home/kraj/work/llvm-project f133c59b33a749dc6d5fa8fb9a2366b95ea45068) This can contain buildpaths since work-shared is where llvm sources will be and they will appear here. Therefore, avoid cmake trying to do this and we get good clean version info > ../recipe-sysroot-native/usr/bin/aarch64-yoe-linux/aarch64-yoe-linux-clang clang version 20.0.0 This will also avoid emitting buildpaths into debuginfo in some cases where compiler version is emitted into build.id info Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--recipes-devtools/clang/clang_git.bb1
-rw-r--r--recipes-devtools/clang/compiler-rt-sanitizers_git.bb1
-rw-r--r--recipes-devtools/clang/compiler-rt_git.bb1
-rw-r--r--recipes-devtools/clang/libclc_git.bb1
-rw-r--r--recipes-devtools/clang/libcxx_git.bb1
-rw-r--r--recipes-devtools/clang/openmp_git.bb1
6 files changed, 6 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb
index 88ae329..7b9096a 100644
--- a/recipes-devtools/clang/clang_git.bb
+++ b/recipes-devtools/clang/clang_git.bb
@@ -133,6 +133,7 @@ SOLIBSDEV:mingw32 = ".pyd"
133#CMAKE_VERBOSE = "VERBOSE=1" 133#CMAKE_VERBOSE = "VERBOSE=1"
134 134
135EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ 135EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \
136 -DLLVM_APPEND_VC_REV=OFF \
136 -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ 137 -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \
137 -DLLVM_ENABLE_EXPENSIVE_CHECKS=OFF \ 138 -DLLVM_ENABLE_EXPENSIVE_CHECKS=OFF \
138 -DLLVM_ENABLE_PIC=ON \ 139 -DLLVM_ENABLE_PIC=ON \
diff --git a/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/recipes-devtools/clang/compiler-rt-sanitizers_git.bb
index be01822..f866aa5 100644
--- a/recipes-devtools/clang/compiler-rt-sanitizers_git.bb
+++ b/recipes-devtools/clang/compiler-rt-sanitizers_git.bb
@@ -50,6 +50,7 @@ EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \
50 -DCOMPILER_RT_BUILD_MEMPROF=ON \ 50 -DCOMPILER_RT_BUILD_MEMPROF=ON \
51 -DLLVM_ENABLE_PROJECTS='compiler-rt' \ 51 -DLLVM_ENABLE_PROJECTS='compiler-rt' \
52 -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ 52 -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \
53 -DLLVM_APPEND_VC_REV=OFF \
53" 54"
54 55
55EXTRA_OECMAKE:append:class-nativesdk = "\ 56EXTRA_OECMAKE:append:class-nativesdk = "\
diff --git a/recipes-devtools/clang/compiler-rt_git.bb b/recipes-devtools/clang/compiler-rt_git.bb
index 6ed9bc8..84878aa 100644
--- a/recipes-devtools/clang/compiler-rt_git.bb
+++ b/recipes-devtools/clang/compiler-rt_git.bb
@@ -70,6 +70,7 @@ EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \
70 -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \ 70 -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \
71 -DLLVM_ENABLE_PROJECTS='compiler-rt' \ 71 -DLLVM_ENABLE_PROJECTS='compiler-rt' \
72 -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ 72 -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \
73 -DLLVM_APPEND_VC_REV=OFF \
73" 74"
74EXTRA_OECMAKE:append:class-target = "\ 75EXTRA_OECMAKE:append:class-target = "\
75 -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ 76 -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \
diff --git a/recipes-devtools/clang/libclc_git.bb b/recipes-devtools/clang/libclc_git.bb
index 1f30c54..16ab833 100644
--- a/recipes-devtools/clang/libclc_git.bb
+++ b/recipes-devtools/clang/libclc_git.bb
@@ -16,6 +16,7 @@ DEPENDS += "clang spirv-tools spirv-llvm-translator spirv-llvm-translator-native
16OECMAKE_SOURCEPATH = "${S}/libclc" 16OECMAKE_SOURCEPATH = "${S}/libclc"
17 17
18EXTRA_OECMAKE += "\ 18EXTRA_OECMAKE += "\
19 -DLLVM_APPEND_VC_REV=OFF \
19 -DLIBCLC_CUSTOM_LLVM_TOOLS_BINARY_DIR=${STAGING_BINDIR_NATIVE} \ 20 -DLIBCLC_CUSTOM_LLVM_TOOLS_BINARY_DIR=${STAGING_BINDIR_NATIVE} \
20 -DLLVM_CLANG=${STAGING_BINDIR_NATIVE}/clang \ 21 -DLLVM_CLANG=${STAGING_BINDIR_NATIVE}/clang \
21 -DLLVM_AS=${STAGING_BINDIR_NATIVE}/llvm-as \ 22 -DLLVM_AS=${STAGING_BINDIR_NATIVE}/llvm-as \
diff --git a/recipes-devtools/clang/libcxx_git.bb b/recipes-devtools/clang/libcxx_git.bb
index 280f3d6..8b57dfc 100644
--- a/recipes-devtools/clang/libcxx_git.bb
+++ b/recipes-devtools/clang/libcxx_git.bb
@@ -72,6 +72,7 @@ EXTRA_OECMAKE += "\
72 -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind' \ 72 -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind' \
73 -DLLVM_RUNTIME_TARGETS=${HOST_SYS} \ 73 -DLLVM_RUNTIME_TARGETS=${HOST_SYS} \
74 -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ 74 -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \
75 -DLLVM_APPEND_VC_REV=OFF \
75 -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ 76 -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
76" 77"
77 78
diff --git a/recipes-devtools/clang/openmp_git.bb b/recipes-devtools/clang/openmp_git.bb
index 865dbe6..34f6e4a 100644
--- a/recipes-devtools/clang/openmp_git.bb
+++ b/recipes-devtools/clang/openmp_git.bb
@@ -17,6 +17,7 @@ inherit cmake pkgconfig perlnative python3native python3targetconfig
17DEPENDS += "elfutils libffi clang" 17DEPENDS += "elfutils libffi clang"
18 18
19EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ 19EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \
20 -DLLVM_APPEND_VC_REV=OFF \
20 -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ 21 -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \
21 -DOPENMP_LIBDIR_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \ 22 -DOPENMP_LIBDIR_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \
22 -DOPENMP_STANDALONE_BUILD=ON \ 23 -DOPENMP_STANDALONE_BUILD=ON \