summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann Congal <yoann.congal@smile.fr>2025-03-26 00:42:34 +0100
committerKhem Raj <raj.khem@gmail.com>2025-03-27 12:39:55 -0700
commitfa1b780b8b9fafed08204719ab94a56e20d6a03a (patch)
tree3643e5b034d866504b1c3ef371d251666595f7ab
parent65da70e6ba202b7582b2a3d0cb1fdfa54c9fd55d (diff)
downloadmeta-clang-fa1b780b8b9fafed08204719ab94a56e20d6a03a.tar.gz
clang: Disable building dexp in clang-native
Building dexp (native) on Debian 11 causes intermittent failure[0]. This tools in not used in clang except in tests (that we don't run). So, disable building this tool by encapsulating its build in a cmake option and then in a PACKAGECONFIG. Users sure of not using Debian 11 (or the impacted g++ compiler) can turn this config on safely. Only the -native* variants change. Dexp is still enabled by default for target. [0]: https://bugzilla.yoctoproject.org/show_bug.cgi?id=15803 Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
-rw-r--r--recipes-devtools/clang/clang/0037-clangd-Add-a-build-option-to-disable-building-dexp.patch84
-rw-r--r--recipes-devtools/clang/clang_git.bb6
-rw-r--r--recipes-devtools/clang/common.inc1
3 files changed, 91 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0037-clangd-Add-a-build-option-to-disable-building-dexp.patch b/recipes-devtools/clang/clang/0037-clangd-Add-a-build-option-to-disable-building-dexp.patch
new file mode 100644
index 0000000..3851488
--- /dev/null
+++ b/recipes-devtools/clang/clang/0037-clangd-Add-a-build-option-to-disable-building-dexp.patch
@@ -0,0 +1,84 @@
1From 8001f900e602c0a8abcf118bda5869a2eb0d5ee9 Mon Sep 17 00:00:00 2001
2From: Yoann Congal <yoann.congal@smile.fr>
3Date: Tue, 25 Mar 2025 22:25:55 +0100
4Subject: [PATCH] clangd: Add a build option to disable building dexp
5
6Building dexp on Debian 11 currently causes intermittent failure[0][1].
7
8Adding the CLANGD_BUILD_DEXP option to disable dexp from the build
9allows Debian 11 users to build clang (albeit without the dexp tool).
10
11This option is set to "Build Dexp" by default so, no change is expected
12without manual setting.
13
14[0]: https://bugzilla.yoctoproject.org/show_bug.cgi?id=15803
15[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1101322
16
17Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/133124]
18Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
19---
20 clang-tools-extra/clangd/CMakeLists.txt | 8 +++++++-
21 clang-tools-extra/clangd/test/CMakeLists.txt | 7 +++++--
22 clang-tools-extra/clangd/test/lit.site.cfg.py.in | 1 +
23 3 files changed, 13 insertions(+), 3 deletions(-)
24
25diff --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt
26index 6f10afe4a562..a1e9da41b4b3 100644
27--- a/clang-tools-extra/clangd/CMakeLists.txt
28+++ b/clang-tools-extra/clangd/CMakeLists.txt
29@@ -210,6 +210,9 @@ if (CLANGD_ENABLE_REMOTE)
30 include(AddGRPC)
31 endif()
32
33+option(CLANGD_BUILD_DEXP "Build the dexp tool as part of Clangd" ON)
34+llvm_canonicalize_cmake_booleans(CLANGD_BUILD_DEXP)
35+
36 if(CLANG_INCLUDE_TESTS)
37 add_subdirectory(test)
38 add_subdirectory(unittests)
39@@ -220,4 +223,7 @@ option(CLANGD_ENABLE_REMOTE "Use gRPC library to enable remote index support for
40 set(GRPC_INSTALL_PATH "" CACHE PATH "Path to gRPC library manual installation.")
41
42 add_subdirectory(index/remote)
43-add_subdirectory(index/dex/dexp)
44+
45+if(CLANGD_BUILD_DEXP)
46+ add_subdirectory(index/dex/dexp)
47+endif()
48diff --git a/clang-tools-extra/clangd/test/CMakeLists.txt b/clang-tools-extra/clangd/test/CMakeLists.txt
49index b51f461a4986..42fc3506641f 100644
50--- a/clang-tools-extra/clangd/test/CMakeLists.txt
51+++ b/clang-tools-extra/clangd/test/CMakeLists.txt
52@@ -3,8 +3,6 @@ set(CLANGD_TEST_DEPS
53 ClangdTests
54 clangd-indexer
55 split-file
56- # No tests for it, but we should still make sure they build.
57- dexp
58 )
59
60 if(CLANGD_BUILD_XPC)
61@@ -12,6 +10,11 @@ if(CLANGD_BUILD_XPC)
62 list(APPEND CLANGD_TEST_DEPS ClangdXpcUnitTests)
63 endif()
64
65+if(CLANGD_BUILD_DEXP)
66+ # No tests for it, but we should still make sure they build.
67+ list(APPEND CLANGD_TEST_DEPS dexp)
68+endif()
69+
70 if(CLANGD_ENABLE_REMOTE)
71 list(APPEND CLANGD_TEST_DEPS clangd-index-server clangd-index-server-monitor)
72 endif()
73diff --git a/clang-tools-extra/clangd/test/lit.site.cfg.py.in b/clang-tools-extra/clangd/test/lit.site.cfg.py.in
74index 1fe7c8d0f324..a0bb3561e19e 100644
75--- a/clang-tools-extra/clangd/test/lit.site.cfg.py.in
76+++ b/clang-tools-extra/clangd/test/lit.site.cfg.py.in
77@@ -15,6 +15,7 @@ config.llvm_shlib_dir = "@SHLIBDIR@"
78 config.clangd_source_dir = "@CMAKE_CURRENT_SOURCE_DIR@/.."
79 config.clangd_binary_dir = "@CMAKE_CURRENT_BINARY_DIR@/.."
80 config.clangd_build_xpc = @CLANGD_BUILD_XPC@
81+config.clangd_build_dexp = @CLANGD_BUILD_DEXP@
82 config.clangd_enable_remote = @CLANGD_ENABLE_REMOTE@
83 config.clangd_tidy_checks = @CLANGD_TIDY_CHECKS@
84 config.have_zlib = @LLVM_ENABLE_ZLIB@
diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb
index 40e32c7..8fe5c6a 100644
--- a/recipes-devtools/clang/clang_git.bb
+++ b/recipes-devtools/clang/clang_git.bb
@@ -78,6 +78,12 @@ PACKAGECONFIG:class-nativesdk = "clangd \
78PACKAGECONFIG[bootstrap] = "-DCLANG_ENABLE_BOOTSTRAP=On -DCLANG_BOOTSTRAP_PASSTHROUGH='${PASSTHROUGH}' -DBOOTSTRAP_LLVM_ENABLE_LTO=Thin -DBOOTSTRAP_LLVM_ENABLE_LLD=ON,,," 78PACKAGECONFIG[bootstrap] = "-DCLANG_ENABLE_BOOTSTRAP=On -DCLANG_BOOTSTRAP_PASSTHROUGH='${PASSTHROUGH}' -DBOOTSTRAP_LLVM_ENABLE_LTO=Thin -DBOOTSTRAP_LLVM_ENABLE_LLD=ON,,,"
79PACKAGECONFIG[build-id] = "-DENABLE_LINKER_BUILD_ID=ON,-DENABLE_LINKER_BUILD_ID=OFF,," 79PACKAGECONFIG[build-id] = "-DENABLE_LINKER_BUILD_ID=ON,-DENABLE_LINKER_BUILD_ID=OFF,,"
80PACKAGECONFIG[clangd] = "-DCLANG_ENABLE_CLANGD=ON,-DCLANG_ENABLE_CLANGD=OFF,," 80PACKAGECONFIG[clangd] = "-DCLANG_ENABLE_CLANGD=ON,-DCLANG_ENABLE_CLANGD=OFF,,"
81
82# Activate to build the dexp tool in clangd
83# Disabled by default for -native since it is known to trigger compiler failure on Debian 11
84# See: https://bugzilla.yoctoproject.org/show_bug.cgi?id=15803
85PACKAGECONFIG[clangd-dexp] = "-DCLANGD_BUILD_DEXP=ON,-DCLANGD_BUILD_DEXP=OFF,,"
86
81PACKAGECONFIG[compiler-rt] = "-DCLANG_DEFAULT_RTLIB=compiler-rt,," 87PACKAGECONFIG[compiler-rt] = "-DCLANG_DEFAULT_RTLIB=compiler-rt,,"
82PACKAGECONFIG[eh] = "-DLLVM_ENABLE_EH=ON,-DLLVM_ENABLE_EH=OFF,," 88PACKAGECONFIG[eh] = "-DLLVM_ENABLE_EH=ON,-DLLVM_ENABLE_EH=OFF,,"
83PACKAGECONFIG[libcplusplus] = "-DCLANG_DEFAULT_CXX_STDLIB=libc++,," 89PACKAGECONFIG[libcplusplus] = "-DCLANG_DEFAULT_CXX_STDLIB=libc++,,"
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc
index ef9e7eb..5f43192 100644
--- a/recipes-devtools/clang/common.inc
+++ b/recipes-devtools/clang/common.inc
@@ -55,6 +55,7 @@ SRC_URI = "\
55 file://0034-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch \ 55 file://0034-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch \
56 file://0035-compiler-rt-Do-not-pass-target-to-clang-compiler.patch \ 56 file://0035-compiler-rt-Do-not-pass-target-to-clang-compiler.patch \
57 file://0036-Fix-build-on-ppc64-musl.patch \ 57 file://0036-Fix-build-on-ppc64-musl.patch \
58 file://0037-clangd-Add-a-build-option-to-disable-building-dexp.patch \
58" 59"
59# Fallback to no-PIE if not set 60# Fallback to no-PIE if not set
60GCCPIE ??= "" 61GCCPIE ??= ""