summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.44.inc2
-rw-r--r--meta/recipes-devtools/binutils/binutils/0020-CVE-2025-7545.patch39
-rw-r--r--meta/recipes-devtools/binutils/binutils/0020-CVE-2025-7546.patch58
-rw-r--r--meta/recipes-devtools/clang/clang/0001-libclc-allow-existing-prepare-builtins-in-standalone.patch57
-rw-r--r--meta/recipes-devtools/clang/clang_git.bb49
-rw-r--r--meta/recipes-devtools/clang/common.inc1
-rw-r--r--meta/recipes-devtools/clang/libclc_git.bb43
7 files changed, 220 insertions, 29 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.44.inc b/meta/recipes-devtools/binutils/binutils-2.44.inc
index 2219ada4ac..3313e011bf 100644
--- a/meta/recipes-devtools/binutils/binutils-2.44.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.44.inc
@@ -43,4 +43,6 @@ SRC_URI = "\
43 file://0018-CVE-2025-5245.patch \ 43 file://0018-CVE-2025-5245.patch \
44 file://0019-CVE-2025-5244.patch \ 44 file://0019-CVE-2025-5244.patch \
45 file://0019-CVE-2025-3198.patch \ 45 file://0019-CVE-2025-3198.patch \
46 file://0020-CVE-2025-7546.patch \
47 file://0020-CVE-2025-7545.patch \
46" 48"
diff --git a/meta/recipes-devtools/binutils/binutils/0020-CVE-2025-7545.patch b/meta/recipes-devtools/binutils/binutils/0020-CVE-2025-7545.patch
new file mode 100644
index 0000000000..062d6721b6
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0020-CVE-2025-7545.patch
@@ -0,0 +1,39 @@
1From: "H.J. Lu" <hjl.tools@gmail.com>
2Date: Sat, 21 Jun 2025 06:36:56 +0800
3
4Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h08c3cbe5926e4d355b5cb70bbec2b1eeb40c2944]
5CVE: CVE-2025-7545
6
7Since the output section contents are copied from the input, don't
8extend the output section size beyond the input section size.
9
10 PR binutils/33049
11 * objcopy.c (copy_section): Don't extend the output section
12 size beyond the input section size.
13
14Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
15
16diff --git a/binutils/objcopy.c b/binutils/objcopy.c
17index e2e6bd7e..3cbb3977 100644
18--- a/binutils/objcopy.c
19+++ b/binutils/objcopy.c
20@@ -4634,6 +4634,7 @@ copy_section (bfd *ibfd, sec_ptr isection, bfd *obfd)
21 char *to = (char *) memhunk;
22 char *end = (char *) memhunk + size;
23 int i;
24+ bfd_size_type memhunk_size = size;
25
26 /* If the section address is not exactly divisible by the interleave,
27 then we must bias the from address. If the copy_byte is less than
28@@ -4653,6 +4654,11 @@ copy_section (bfd *ibfd, sec_ptr isection, bfd *obfd)
29 }
30
31 size = (size + interleave - 1 - copy_byte) / interleave * copy_width;
32+
33+ /* Don't extend the output section size. */
34+ if (size > memhunk_size)
35+ size = memhunk_size;
36+
37 osection->lma /= interleave;
38 if (copy_byte < extra)
39 osection->lma++;
diff --git a/meta/recipes-devtools/binutils/binutils/0020-CVE-2025-7546.patch b/meta/recipes-devtools/binutils/binutils/0020-CVE-2025-7546.patch
new file mode 100644
index 0000000000..23c38091a2
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0020-CVE-2025-7546.patch
@@ -0,0 +1,58 @@
1From 41461010eb7c79fee7a9d5f6209accdaac66cc6b Mon Sep 17 00:00:00 2001
2From: "H.J. Lu" <hjl.tools@gmail.com>
3Date: Sat, 21 Jun 2025 06:52:00 +0800
4Subject: [PATCH] elf: Report corrupted group section
5
6Report corrupted group section instead of trying to recover.
7
8 PR binutils/33050
9 * elf.c (bfd_elf_set_group_contents): Report corrupted group
10 section.
11
12Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=41461010eb7c79fee7a9d5f6209accdaac66cc6b]
13CVE: CVE-2025-7546
14
15Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
16Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
17---
18 bfd/elf.c | 23 ++++++++++-------------
19 1 file changed, 10 insertions(+), 13 deletions(-)
20
21diff --git a/bfd/elf.c b/bfd/elf.c
22index 14ce15c7254..ee894eb05f2 100644
23--- a/bfd/elf.c
24+++ b/bfd/elf.c
25@@ -3971,20 +3971,17 @@ bfd_elf_set_group_contents (bfd *abfd, asection *sec, void *failedptrarg)
26 break;
27 }
28
29- /* We should always get here with loc == sec->contents + 4, but it is
30- possible to craft bogus SHT_GROUP sections that will cause segfaults
31- in objcopy without checking loc here and in the loop above. */
32- if (loc == sec->contents)
33- BFD_ASSERT (0);
34- else
35+ /* We should always get here with loc == sec->contents + 4. Return
36+ an error for bogus SHT_GROUP sections. */
37+ loc -= 4;
38+ if (loc != sec->contents)
39 {
40- loc -= 4;
41- if (loc != sec->contents)
42- {
43- BFD_ASSERT (0);
44- memset (sec->contents + 4, 0, loc - sec->contents);
45- loc = sec->contents;
46- }
47+ /* xgettext:c-format */
48+ _bfd_error_handler (_("%pB: corrupted group section: `%pA'"),
49+ abfd, sec);
50+ bfd_set_error (bfd_error_bad_value);
51+ *failedptr = true;
52+ return;
53 }
54
55 H_PUT_32 (abfd, sec->flags & SEC_LINK_ONCE ? GRP_COMDAT : 0, loc);
56--
572.43.5
58
diff --git a/meta/recipes-devtools/clang/clang/0001-libclc-allow-existing-prepare-builtins-in-standalone.patch b/meta/recipes-devtools/clang/clang/0001-libclc-allow-existing-prepare-builtins-in-standalone.patch
new file mode 100644
index 0000000000..46929798ad
--- /dev/null
+++ b/meta/recipes-devtools/clang/clang/0001-libclc-allow-existing-prepare-builtins-in-standalone.patch
@@ -0,0 +1,57 @@
1From 348f846b206780646430d6477c04b7793b669f34 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@arm.com>
3Date: Wed, 16 Jul 2025 23:24:21 +0100
4Subject: [PATCH] allow external prepare_builtins
5
6In standalone cross builds, libclc can't build a native prepare_builtins.
7
8Hack the CMake to allow it to use an existing binary, which we build in the recipe.
9
10Upstream-Status: Inappropriate [discussion for a proper fix in https://github.com/llvm/llvm-project/issues/149814]
11Signed-off-by: Ross Burton <ross.burton@arm.com>
12---
13 libclc/CMakeLists.txt | 23 +++++++++++++++++------
14 1 file changed, 17 insertions(+), 6 deletions(-)
15
16diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
17index 43e213b385f5..d4a6d096169e 100644
18--- a/libclc/CMakeLists.txt
19+++ b/libclc/CMakeLists.txt
20@@ -181,17 +181,28 @@ set(LLVM_LINK_COMPONENTS
21 IRReader
22 Support
23 )
24+
25 if( LIBCLC_STANDALONE_BUILD )
26- add_llvm_executable( prepare_builtins utils/prepare-builtins.cpp )
27- set( prepare_builtins_exe prepare_builtins )
28- set( prepare_builtins_target prepare_builtins )
29+ message("cross ${CMAKE_CROSSCOMPILING}")
30+ if(CMAKE_CROSSCOMPILING)
31+ find_program(PREPARE_BUILTINS prepare_builtins REQUIRED)
32+ message("found ${PREPARE_BUILTINS}")
33+ set( prepare_builtins_exe ${PREPARE_BUILTINS} )
34+ else()
35+ add_llvm_executable( prepare_builtins utils/prepare-builtins.cpp )
36+ set( prepare_builtins_exe prepare_builtins )
37+ set( prepare_builtins_target prepare_builtins )
38+ target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
39+ # These were not properly reported in early LLVM and we don't need them
40+ target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )
41+ endif()
42 else()
43 add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp )
44 setup_host_tool( prepare_builtins PREPARE_BUILTINS prepare_builtins_exe prepare_builtins_target )
45+ target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
46+ # These were not properly reported in early LLVM and we don't need them
47+ target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )
48 endif()
49-target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
50-# These were not properly reported in early LLVM and we don't need them
51-target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )
52
53 # Setup arch devices
54 set( r600--_devices cedar cypress barts cayman )
55--
562.43.0
57
diff --git a/meta/recipes-devtools/clang/clang_git.bb b/meta/recipes-devtools/clang/clang_git.bb
index ed6e2d7da7..830c0282cd 100644
--- a/meta/recipes-devtools/clang/clang_git.bb
+++ b/meta/recipes-devtools/clang/clang_git.bb
@@ -54,6 +54,7 @@ def get_clang_target_arch(bb, d):
54 return get_clang_arch(bb, d, 'TARGET_ARCH') 54 return get_clang_arch(bb, d, 'TARGET_ARCH')
55 55
56PACKAGECONFIG_CLANG_COMMON = "build-id eh libedit rtti shared-libs libclang-python \ 56PACKAGECONFIG_CLANG_COMMON = "build-id eh libedit rtti shared-libs libclang-python \
57 ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', 'lld', '', d)} \
57 ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcplusplus libomp unwindlib', '', d)} \ 58 ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcplusplus libomp unwindlib', '', d)} \
58 " 59 "
59 60
@@ -111,16 +112,18 @@ CLANG_DEFAULT_CXX_STDLIB;CLANG_DEFAULT_RTLIB;CLANG_DEFAULT_UNWINDLIB;\
111CLANG_DEFAULT_OPENMP_RUNTIME;LLVM_ENABLE_PER_TARGET_RUNTIME_DIR;\ 112CLANG_DEFAULT_OPENMP_RUNTIME;LLVM_ENABLE_PER_TARGET_RUNTIME_DIR;\
112LLVM_BUILD_TOOLS;LLVM_USE_HOST_TOOLS;LLVM_CONFIG_PATH;LLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR;\ 113LLVM_BUILD_TOOLS;LLVM_USE_HOST_TOOLS;LLVM_CONFIG_PATH;LLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR;\
113" 114"
114#
115# Default to build all OE-Core supported target arches (user overridable).
116# Gennerally setting LLVM_TARGETS_TO_BUILD = "" in local.conf is ok in most simple situations
117# where only one target architecture is needed along with just one build arch (usually X86)
118# Core tier targets:
119# AArch64;AMDGPU;ARM;AVR;BPF;Hexagon;Lanai;LoongArch;Mips;MSP430;NVPTX;PowerPC;RISCV;Sparc;SPIRV;SystemZ;VE;WebAssembly;X86;XCore
120# Known experimental targets: ARC;CSKY;DirectX;M68k;Xtensa
121 115
122LLVM_TARGETS_TO_BUILD ?= "AMDGPU;AArch64;ARM;BPF;Mips;PowerPC;RISCV;X86;LoongArch;NVPTX;SPIRV" 116# By default we build all the supported CPU architectures, and the GPU targets
123LLVM_TARGETS_TO_BUILD:class-target ?= "${@get_clang_host_arch(bb, d)};AMDGPU;BPF;NVPTX;SPIRV" 117# if the opengl or vulkan DISTRO_FEATURES are enabled.
118#
119# For target builds we default to building that specific architecture, BPF, and the GPU targets if required.
120#
121# The available target list can be seen in the source code
122# in the LLVM_ALL_TARGETS assignment:
123# https://github.com/llvm/llvm-project/blob/main/llvm/CMakeLists.txt
124LLVM_TARGETS_GPU ?= "${@bb.utils.contains_any('DISTRO_FEATURES', 'opengl vulkan', 'AMDGPU;NVPTX;SPIRV', '', d)}"
125LLVM_TARGETS_TO_BUILD ?= "AArch64;ARM;BPF;Mips;PowerPC;RISCV;X86;LoongArch;${LLVM_TARGETS_GPU}"
126LLVM_TARGETS_TO_BUILD:class-target ?= "${@get_clang_host_arch(bb, d)};BPF;${LLVM_TARGETS_GPU}"
124 127
125LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ?= "" 128LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ?= ""
126 129
@@ -130,7 +133,7 @@ HF[vardepvalue] = "${HF}"
130 133
131# Ensure that LLVM_PROJECTS does not contain compiler runtime components e.g. libcxx etc 134# Ensure that LLVM_PROJECTS does not contain compiler runtime components e.g. libcxx etc
132# they are enabled via LLVM_ENABLE_RUNTIMES 135# they are enabled via LLVM_ENABLE_RUNTIMES
133LLVM_PROJECTS ?= "clang;clang-tools-extra;libclc;lld" 136LLVM_PROJECTS ?= "clang;clang-tools-extra;lld"
134 137
135# linux hosts (.so) on Windows .pyd 138# linux hosts (.so) on Windows .pyd
136SOLIBSDEV:mingw32 = ".pyd" 139SOLIBSDEV:mingw32 = ".pyd"
@@ -147,7 +150,6 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \
147 -DLLVM_ENABLE_FFI=ON \ 150 -DLLVM_ENABLE_FFI=ON \
148 -DLLVM_ENABLE_ZSTD=ON \ 151 -DLLVM_ENABLE_ZSTD=ON \
149 -DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \ 152 -DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \
150 -DLLVM_OPTIMIZED_TABLEGEN=ON \
151 -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON \ 153 -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON \
152 -DCMAKE_SYSTEM_NAME=Linux \ 154 -DCMAKE_SYSTEM_NAME=Linux \
153 -DCMAKE_BUILD_TYPE=Release \ 155 -DCMAKE_BUILD_TYPE=Release \
@@ -157,26 +159,20 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \
157 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ 159 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \
158 -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}' \ 160 -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}' \
159 -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}' \ 161 -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}' \
162 -DLLVM_NATIVE_TOOL_DIR=${STAGING_BINDIR_NATIVE} \
163 -DLLVM_HEADERS_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-min-tblgen \
160" 164"
161 165
162EXTRA_OECMAKE:append:class-native = "\
163 -DPYTHON_EXECUTABLE='${PYTHON}' \
164"
165EXTRA_OECMAKE:append:class-nativesdk = "\ 166EXTRA_OECMAKE:append:class-nativesdk = "\
166 -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain-native.cmake' \ 167 -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain-native.cmake' \
167 -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ 168 -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \
168 -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ 169 -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \
169 -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ 170 -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \
170 -DCMAKE_STRIP=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-strip \ 171 -DCMAKE_STRIP=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-strip \
171 -DLLVM_NATIVE_TOOL_DIR=${STAGING_BINDIR_NATIVE} \
172 -DLLVM_HEADERS_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-min-tblgen \
173 -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \ 172 -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \
174 -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \ 173 -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \
175 -DPYTHON_EXECUTABLE='${PYTHON}' \
176" 174"
177EXTRA_OECMAKE:append:class-target = "\ 175EXTRA_OECMAKE:append:class-target = "\
178 -DLLVM_NATIVE_TOOL_DIR=${STAGING_BINDIR_NATIVE} \
179 -DLLVM_HEADERS_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-min-tblgen \
180 -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ 176 -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \
181 -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ 177 -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \
182 -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ 178 -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \
@@ -191,7 +187,7 @@ EXTRA_OECMAKE:append:class-target = "\
191 187
192DEPENDS = "binutils zlib zstd libffi libxml2 libxml2-native ninja-native swig-native spirv-tools-native llvm-tblgen-native" 188DEPENDS = "binutils zlib zstd libffi libxml2 libxml2-native ninja-native swig-native spirv-tools-native llvm-tblgen-native"
193DEPENDS:append:class-nativesdk = " clang-crosssdk-${SDK_SYS} virtual/nativesdk-cross-binutils nativesdk-python3" 189DEPENDS:append:class-nativesdk = " clang-crosssdk-${SDK_SYS} virtual/nativesdk-cross-binutils nativesdk-python3"
194DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} python3 ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcxx', '', d)} spirv-llvm-translator-native" 190DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} python3 ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcxx', '', d)}"
195 191
196RRECOMMENDS:${PN} = "binutils" 192RRECOMMENDS:${PN} = "binutils"
197RRECOMMENDS:${PN}:append:class-target = "${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', ' libcxx-dev', '', d)}" 193RRECOMMENDS:${PN}:append:class-target = "${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', ' libcxx-dev', '', d)}"
@@ -258,7 +254,6 @@ do_install:append:class-native () {
258 install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clangd-indexer ${D}${bindir}/clangd-indexer 254 install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clangd-indexer ${D}${bindir}/clangd-indexer
259 fi 255 fi
260 install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tidy-confusable-chars-gen ${D}${bindir}/clang-tidy-confusable-chars-gen 256 install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tidy-confusable-chars-gen ${D}${bindir}/clang-tidy-confusable-chars-gen
261 install -Dm 0755 ${B}${BINPATHPREFIX}/bin/prepare_builtins ${D}${bindir}/prepare_builtins
262 257
263 for f in `find ${D}${bindir} -executable -type f -not -type l`; do 258 for f in `find ${D}${bindir} -executable -type f -not -type l`; do
264 test -n "`file -b $f|grep -i ELF`" && ${STRIP} $f 259 test -n "`file -b $f|grep -i ELF`" && ${STRIP} $f
@@ -294,11 +289,11 @@ do_install:append:class-nativesdk () {
294 fi 289 fi
295} 290}
296 291
297PROVIDES:append:class-native = " llvm-native libclc-native" 292PROVIDES:append:class-native = " llvm-native"
298PROVIDES:append:class-target = " llvm libclc" 293PROVIDES:append:class-target = " llvm"
299PROVIDES:append:class-nativesdk = " nativesdk-llvm nativesdk-libclc" 294PROVIDES:append:class-nativesdk = " nativesdk-llvm"
300 295
301PACKAGES =+ "${PN}-libllvm ${PN}-libclang-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools ${PN}-clc \ 296PACKAGES =+ "${PN}-libllvm ${PN}-libclang-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools \
302 libclang llvm-linker-tools" 297 libclang llvm-linker-tools"
303 298
304BBCLASSEXTEND = "native nativesdk" 299BBCLASSEXTEND = "native nativesdk"
@@ -315,8 +310,6 @@ RDEPENDS:${PN}-tools += "\
315 perl-module-term-ansicolor \ 310 perl-module-term-ansicolor \
316" 311"
317 312
318RPROVIDES:${PN}-clc = "${MLPREFIX}libclc"
319
320RRECOMMENDS:${PN}-tidy += "${PN}-tools" 313RRECOMMENDS:${PN}-tidy += "${PN}-tools"
321 314
322FILES:llvm-linker-tools = "${libdir}/LLVMgold* ${libdir}/libLTO.so.* ${libdir}/LLVMPolly*" 315FILES:llvm-linker-tools = "${libdir}/LLVMgold* ${libdir}/libLTO.so.* ${libdir}/LLVMPolly*"
@@ -383,8 +376,6 @@ FILES:${PN} += "\
383 ${nonarch_libdir}/${BPN}/*/include/ \ 376 ${nonarch_libdir}/${BPN}/*/include/ \
384" 377"
385 378
386FILES:${PN}-clc += "${datadir}/clc"
387
388FILES:${PN}-libllvm =+ "\ 379FILES:${PN}-libllvm =+ "\
389 ${libdir}/libLLVM.so.${MAJOR_VER}.${MINOR_VER} \ 380 ${libdir}/libLLVM.so.${MAJOR_VER}.${MINOR_VER} \
390 ${libdir}/libLLVM-${MAJOR_VER}.so \ 381 ${libdir}/libLLVM-${MAJOR_VER}.so \
diff --git a/meta/recipes-devtools/clang/common.inc b/meta/recipes-devtools/clang/common.inc
index d66f9059b2..d6280c2fbe 100644
--- a/meta/recipes-devtools/clang/common.inc
+++ b/meta/recipes-devtools/clang/common.inc
@@ -59,6 +59,7 @@ SRC_URI = "\
59 file://0036-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch \ 59 file://0036-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch \
60 file://0037-compiler-rt-Exclude-sync_fetch_and_-for-any-pre-ARMv.patch \ 60 file://0037-compiler-rt-Exclude-sync_fetch_and_-for-any-pre-ARMv.patch \
61 file://0038-compiler-rt-Hardcode-uptr-sptr-typedefs-on-Mips-Linu.patch \ 61 file://0038-compiler-rt-Hardcode-uptr-sptr-typedefs-on-Mips-Linu.patch \
62 file://0001-libclc-allow-existing-prepare-builtins-in-standalone.patch \
62" 63"
63# Fallback to no-PIE if not set 64# Fallback to no-PIE if not set
64GCCPIE ??= "" 65GCCPIE ??= ""
diff --git a/meta/recipes-devtools/clang/libclc_git.bb b/meta/recipes-devtools/clang/libclc_git.bb
new file mode 100644
index 0000000000..ed31de503a
--- /dev/null
+++ b/meta/recipes-devtools/clang/libclc_git.bb
@@ -0,0 +1,43 @@
1SUMMARY = "Implementation of the library requirements of the OpenCL C programming language."
2HOMEPAGE = "https://libclc.llvm.org"
3SECTION = "devel"
4
5require common-clang.inc
6require common-source.inc
7
8LIC_FILES_CHKSUM = "file://libclc/LICENSE.TXT;md5=7cc795f6cbb2d801d84336b83c8017db"
9
10inherit cmake pkgconfig
11
12# Depend explicitly on clang-native instead of using TOOLCHAIN as the build
13# objects from this recipe are build explicitly using clang for GPU targets.
14# We could INHIBIT_DEFAULT_DEPS to avoid any other toolchain but then we need
15# to wrestle CMake to configure without a toolchain.
16DEPENDS += "clang-native spirv-llvm-translator-native"
17
18OECMAKE_SOURCEPATH = "${S}/libclc"
19B_NATIVE = "${B}-native"
20
21# Semicolon-separated list of targets to build
22LIBCLC_TARGETS ?= "all"
23
24EXTRA_OECMAKE = "-DLIBCLC_TARGETS_TO_BUILD=${LIBCLC_TARGETS} \
25 -DPREPARE_BUILTINS=${B_NATIVE}/prepare_builtins"
26
27# Need to build a native prepare_builtins binary in target builds. The easiest
28# way to do this is with a second native cmake build tree.
29do_build_prepare_builtins() {
30 cmake --fresh -G Ninja \
31 -S ${OECMAKE_SOURCEPATH} -B ${B_NATIVE} \
32 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${WORKDIR}/toolchain-native.cmake \
33 -DLIBCLC_TARGETS_TO_BUILD=
34 cmake --build ${B_NATIVE} --target prepare_builtins
35}
36do_build_prepare_builtins:class-native() {
37 :
38}
39do_configure[prefuncs] += "do_build_prepare_builtins"
40
41FILES:${PN} += "${datadir}/clc"
42
43BBCLASSEXTEND = "native nativesdk"