Skip to contentSkip to conversation

clang.inc: Global settings for clang toolchain

PATCH In review Khem Raj 4 participants 31 messages Nov 5, 2024 – Jan 7, 2025

Subsystems (2)
lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/19 clang.inc: Global settings for clang toolchain

It is added to default distro include file

---
 meta/conf/distro/include/clang.inc | 147 +++++++++++++++++++++++++++++
 1 file changed, 147 insertions(+)
 create mode 100644 meta/conf/distro/include/clang.inc
meta/conf/distro/include/clang.inc new file +147 -0
new file mode 100644
index 00000000000..ce49bbc0ed1
@@ -0,0 +1,147 @@
+# Add the necessary override
+CCACHE_COMPILERCHECK:toolchain-clang ?= "%compiler% -v"
+HOST_CC_ARCH:prepend:toolchain-clang = "-target ${HOST_SYS} "
+CC:toolchain-clang  = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+CXX:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+CPP:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} -E"
+CCLD:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+RANLIB:toolchain-clang = "${HOST_PREFIX}llvm-ranlib"
+AR:toolchain-clang = "${HOST_PREFIX}llvm-ar"
+NM:toolchain-clang = "${HOST_PREFIX}llvm-nm"
+OBJDUMP:toolchain-clang = "${HOST_PREFIX}llvm-objdump"
+OBJCOPY:toolchain-clang = "${HOST_PREFIX}llvm-objcopy"
+STRIP:toolchain-clang = "${HOST_PREFIX}llvm-strip"
+STRINGS:toolchain-clang = "${HOST_PREFIX}llvm-strings"
+READELF:toolchain-clang = "${HOST_PREFIX}llvm-readelf"
+LD:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '${HOST_PREFIX}ld.lld${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}', '${HOST_PREFIX}ld${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}', d)}"
+
+LTO:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'thin-lto', '-flto=thin', '-flto -fuse-ld=lld', d)}"
+
+COMPILER_RT ??= ""
+COMPILER_RT:toolchain-clang:class-native = "-rtlib=libgcc ${UNWINDLIB}"
+COMPILER_RT:armeb = "-rtlib=libgcc ${UNWINDLIB}"
+COMPILER_RT:libc-klibc = "-rtlib=libgcc ${UNWINDLIB}"
+
+UNWINDLIB ??= ""
+UNWINDLIB:toolchain-clang:class-native = "--unwindlib=libgcc"
+UNWINDLIB:armeb = "--unwindlib=libgcc"
+UNWINDLIB_libc-klibc = "--unwindlib=libgcc"
+
+LIBCPLUSPLUS ??= ""
+LIBCPLUSPLUS:armv5 = "-stdlib=libstdc++"
+
+CXXFLAGS:append:toolchain-clang = " ${LIBCPLUSPLUS}"
+LDFLAGS:append:toolchain-clang = " ${COMPILER_RT} ${LIBCPLUSPLUS}"
+
+TUNE_CCARGS:remove:toolchain-clang = "-meb"
+TUNE_CCARGS:remove:toolchain-clang = "-mel"
+TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", " -mbig-endian", " -mlittle-endian", d)}"
+
+# Clang does not yet support big.LITTLE performance tunes, so use the LITTLE for tunes
+TUNE_CCARGS:remove:toolchain-clang = "\
+    -mcpu=cortex-a57.cortex-a53${TUNE_CCARGS_MARCH_OPTS} \
+    -mcpu=cortex-a72.cortex-a53${TUNE_CCARGS_MARCH_OPTS} \
+    -mcpu=cortex-a15.cortex-a7${TUNE_CCARGS_MARCH_OPTS} \
+    -mcpu=cortex-a17.cortex-a7${TUNE_CCARGS_MARCH_OPTS} \
+    -mcpu=cortex-a72.cortex-a35${TUNE_CCARGS_MARCH_OPTS} \
+    -mcpu=cortex-a73.cortex-a53${TUNE_CCARGS_MARCH_OPTS} \
+    -mcpu=cortex-a75.cortex-a55${TUNE_CCARGS_MARCH_OPTS} \
+    -mcpu=cortex-a76.cortex-a55${TUNE_CCARGS_MARCH_OPTS}"
+TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa72-cortexa53 cortexa57-cortexa53 cortexa73-cortexa53", " -mcpu=cortex-a53${TUNE_CCARGS_MARCH_OPTS}", "", d)}"
+TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa15-cortexa7 cortexa17-cortexa7", " -mcpu=cortex-a7${TUNE_CCARGS_MARCH_OPTS}", "", d)}"
+TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa72-cortexa35", " -mcpu=cortex-a35${TUNE_CCARGS_MARCH_OPTS}", "", d)}"
+TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa75-cortexa55 cortexa76-cortexa55", " -mcpu=cortex-a55${TUNE_CCARGS_MARCH_OPTS}", "", d)}"
+
+# Workaround for https://github.com/llvm/llvm-project/issues/85699
+# needed for 64bit rpi3/rpi4 machines
+TUNE_CCARGS_MARCH_OPTS:append:toolchain-clang = "${@bb.utils.contains_any("DEFAULTTUNE", "cortexa72 cortexa53", "+nocrypto", "", d)}"
+
+# Clang does not support octeontx2 processor
+TUNE_CCARGS:remove:toolchain-clang = "-mcpu=octeontx2${TUNE_CCARGS_MARCH_OPTS}"
+
+# Reconcile some ppc anamolies
+TUNE_CCARGS:remove:toolchain-clang:powerpc = "-mhard-float -mno-spe"
+TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc64 = " -mlong-double-64"
+TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc64le = " -mlong-double-64"
+TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc = " -mlong-double-64"
+# usrmerge workaround
+TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains("DISTRO_FEATURES", "usrmerge", " --dyld-prefix=/usr", "", d)}"
+
+TUNE_CCARGS:append:toolchain-clang = " -Qunused-arguments"
+
+LDFLAGS:append:toolchain-clang:class-nativesdk:x86-64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-x86-64.so.2"
+LDFLAGS:append:toolchain-clang:class-nativesdk:x86 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux.so.2"
+LDFLAGS:append:toolchain-clang:class-nativesdk:aarch64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-aarch64.so.1"
+
+LDFLAGS:toolchain-clang:class-nativesdk = "${BUILDSDK_LDFLAGS} \
+                                           -Wl,-rpath-link,${STAGING_LIBDIR}/.. \
+                                           -Wl,-rpath,${libdir}/.. "
+
+# Enable lld globally"
+LDFLAGS:append:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=lld', '', d)}"
+
+# Remove gcc specific -fcanon-prefix-map option, added in gcc-13+
+# clang does not support it yet
+DEBUG_PREFIX_MAP:remove:toolchain-clang = "-fcanon-prefix-map"
+
+# choose between 'gcc' 'clang' an empty '' can be used as well
+TOOLCHAIN ??= "gcc"
+# choose between 'gnu' 'llvm'
+TC_CXX_RUNTIME ??= "gnu"
+# Using gcc or llvm runtime is only available when using clang for compiler
+#TC_CXX_RUNTIME:toolchain-gcc = "gnu"
+TC_CXX_RUNTIME:armeb = "gnu"
+TC_CXX_RUNTIME:armv5 = "gnu"
+
+TOOLCHAIN:class-native = "gcc"
+TOOLCHAIN:class-nativesdk = "gcc"
+TOOLCHAIN:class-cross-canadian = "gcc"
+TOOLCHAIN:class-crosssdk = "gcc"
+TOOLCHAIN:class-cross = "gcc"
+
+OVERRIDES =. "${@['', 'toolchain-${TOOLCHAIN}:']['${TOOLCHAIN}' != '']}"
+OVERRIDES =. "${@['', 'runtime-${TC_CXX_RUNTIME}:']['${TC_CXX_RUNTIME}' != '']}"
+OVERRIDES[vardepsexclude] += "TOOLCHAIN TC_CXX_RUNTIME"
+
+YOCTO_ALTERNATE_EXE_PATH:toolchain-clang:class-target = "${STAGING_BINDIR}/llvm-config"
+YOCTO_ALTERNATE_LIBDIR:toolchain-clang:class-target = "/${BASELIB}"
+
+#YOCTO_ALTERNATE_EXE_PATH:toolchain-clang:class-target[export] = "1"
+#YOCTO_ALTERNATE_LIBDIR:toolchain-clang:class-target[export] = "1"
+
+#DEPENDS:append:toolchain-clang:class-target = " clang-cross-${TARGET_ARCH} "
+#DEPENDS:remove:toolchain-clang:allarch = "clang-cross-${TARGET_ARCH}"
+
+def clang_base_deps(d):
+    ret = ""
+    if not d.getVar('INHIBIT_DEFAULT_DEPS', False):
+        if not oe.utils.inherits(d, 'allarch') :
+            ret += " ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/libc"
+            if (d.getVar('TC_CXX_RUNTIME').find('android') != -1):
+                ret += " ${MLPREFIX}libcxx"
+            else:
+                ret += " virtual/${TARGET_PREFIX}compilerlibs ${MLPREFIX}compiler-rt ${MLPREFIX}libcxx"
+    return ret
+
+BASE_DEFAULT_DEPS:append:class-target:toolchain-clang:class-target = " ${@clang_base_deps(d)}"
+BASE_DEFAULT_DEPS:append:class-native:toolchain-clang:runtime-llvm = " libcxx-native compiler-rt-native"
+BASE_DEFAULT_DEPS:append:class-nativesdk:toolchain-clang:runtime-llvm = " clang-native nativesdk-libcxx nativesdk-compiler-rt"
+
+# do_populate_sysroot needs STRIP
+POPULATESYSROOTDEPS:toolchain-clang:class-target = "${MLPREFIX}clang-cross-${TARGET_ARCH}:do_populate_sysroot"
+
+cmake_do_generate_toolchain_file:append:toolchain-clang () {
+    cat >> ${WORKDIR}/toolchain.cmake <<EOF
+set( CMAKE_CLANG_TIDY ${HOST_PREFIX}clang-tidy )
+EOF
+    sed -i 's/ -mmusl / /g' ${WORKDIR}/toolchain.cmake
+}
+
+# dump recipes which still use gcc
+#python __anonymous() {
+#    toolchain = d.getVar("TOOLCHAIN")
+#    if not toolchain or toolchain == "clang" or 'class-target' not in d.getVar('OVERRIDES').split(':'):
+#        return
+#    pkgn = d.getVar("PN")
+#    bb.warn("%s - %s" % (pkgn, toolchain))
+#}
author
#1 lore raw

PATCH 2/19 nonclangable.inc: Add recipe which can not be built with clang

Some need adjusting commandline variables and other parameters all get housed here

---
 meta/conf/distro/include/nonclangable.inc | 687 ++++++++++++++++++++++
 1 file changed, 687 insertions(+)
 create mode 100644 meta/conf/distro/include/nonclangable.inc
meta/conf/distro/include/nonclangable.inc new file +687 -0
new file mode 100644
index 00000000000..bb322447879
@@ -0,0 +1,687 @@
+
+TUNE_CCARGS:remove:toolchain-clang = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '-mbranch-protection=standard', '', d)}"
+
+# https://github.com/llvm/llvm-project/issues/78337
+TOOLCHAIN:pn-kernel-selftest = "gcc"
+
+# x86_64/musl build fails with
+# gtk4/4.12.5/build/gtk/libgtk-4.so.1: unsupported relocation type 37
+TOOLCHAIN:pn-gtk4:libc-musl:x86-64 = "gcc"
+
+TOOLCHAIN:pn-cpufrequtils = "gcc"
+
+TOOLCHAIN:pn-grub:genericx86-64 = "gcc"
+# | grub-mkimage: error: relocation 0x2b is not implemented yet.
+TOOLCHAIN:pn-grub-efi:aarch64 = "gcc"
+TOOLCHAIN:pn-grub-efi:riscv32 = "gcc"
+# clang-15 crashes
+TOOLCHAIN:pn-grub-efi:riscv64 = "gcc"
+TOOLCHAIN:pn-grub:riscv64 = "gcc"
+# | build-grub-module-verifier: error: search_label: unsupported relocation 0x108.
+TOOLCHAIN:pn-grub:aarch64 = "gcc"
+# crash embeds version of gdb which is not buildable with clang
+TOOLCHAIN:pn-crash = "gcc"
+# See https://github.com/llvm/llvm-project/issues/71925
+LIBCPLUSPLUS:pn-elfutils:toolchain-clang = "-stdlib=libstdc++"
+#| erl_bits.c:(.text+0xc2a): undefined reference to `__extendhfsf2'
+#| erl_bits.c:(.text+0x1bfa): undefined reference to `__truncsfhf2'
+#| clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
+# both riscv64 and x86-64
+TOOLCHAIN:pn-erlang = "gcc"
+
+# /mnt/a/yoe/build/tmp/work/cortexa7t2hf-neon-vfpv4-yoe-linux-gnueabi/firefox/60.1.0esr-r0/recipe-sysroot-native/usr/lib/clang/7.0.1/include/arm_neon.h:433:1: error: unknown type name 'inline'
+# __ai uint8x16_t vabdq_u8(uint8x16_t __p0, uint8x16_t __p1) {
+TOOLCHAIN:pn-firefox = "gcc"
+TOOLCHAIN:pn-gcc = "gcc"
+TOOLCHAIN:pn-gcc-runtime = "gcc"
+TOOLCHAIN:pn-gcc-sanitizers = "gcc"
+TOOLCHAIN:pn-glibc = "gcc"
+TOOLCHAIN:pn-glibc-initial = "gcc"
+TOOLCHAIN:pn-glibc-locale = "gcc"
+TOOLCHAIN:pn-glibc-mtrace = "gcc"
+TOOLCHAIN:pn-glibc-scripts = "gcc"
+TOOLCHAIN:pn-glibc-testsuite = "gcc"
+TOOLCHAIN:pn-glibc-y2038-tests = "gcc"
+
+#| prelink-rtld: error while loading shared libraries: ld.so.1
+#| /lib64/ld.so.1: No such file or directory
+TOOLCHAIN:pn-gobject-intospection:mips64 = "gcc"
+TOOLCHAIN:pn-avahi:mips64 = "gcc"
+
+# VLAs
+#| control.c:286:19: error: fields must have a constant size: 'variable length array in structure' extension will never be supported
+#|             __u32 buffer[cam->max_response_quads];
+#|                   ^
+#| 1 error generated.
+TOOLCHAIN:pn-libdc1394 = "gcc"
+
+# error: return address can be determined only for current frame
+TOOLCHAIN:pn-libexecinfo:mipsarch = "gcc"
+TOOLCHAIN:pn-libgcc = "gcc"
+TOOLCHAIN:pn-libgcc-initial = "gcc"
+TOOLCHAIN:pn-libgfortran = "gcc"
+TOOLCHAIN:pn-libssp-nonshared = "gcc"
+
+TOOLCHAIN:pn-m4:powerpc = "gcc"
+# clang does not have 64bit atomics on ppc
+TOOLCHAIN:pn-mesa:powerpc = "gcc"
+# clang fails with db.c:(.text+0x188): unsupported bss-plt -fPIC ifunc mmio_write64_be
+TOOLCHAIN:pn-rdma-core:powerpc = "gcc"
+# usermode qemu crashes when running binaries from clang + rust compiler on ppc32
+TOOLCHAIN:pn-librsvg:powerpc = "gcc"
+# variant-impl.hpp:309:36: error: 'is_variant' does not name a template but is followed by template arguments
+TOOLCHAIN:pn-omxplayer = "gcc"
+# error: return address can be determined only for current frame
+TOOLCHAIN:pn-openflow:mipsarch = "gcc"
+TOOLCHAIN:pn-openjdk-8 = "gcc"
+TOOLCHAIN:pn-openjre-8 = "gcc"
+TOOLCHAIN:pn-syslinux = "gcc"
+TOOLCHAIN:pn-systemtap = "gcc"
+# v4l-utils uses nested functions
+TOOLCHAIN:pn-v4l-utils = "gcc"
+# https://bugs.kde.org/show_bug.cgi?id=369723
+TOOLCHAIN:pn-valgrind = "gcc"
+
+TOOLCHAIN:pn-vboxguestdrivers = "gcc"
+# uses C++ which clang does not like
+TOOLCHAIN:pn-wvstreams = "gcc"
+TOOLCHAIN:pn-wvdial = "gcc"
+#
+#../../lib/libicui18n.so: undefined reference to `__atomic_fetch_sub_4'
+#../../lib/libicui18n.so: undefined reference to `__atomic_load_4'
+#../../lib/libicui18n.so: undefined reference to `__atomic_store_4'
+#../../lib/libicui18n.so: undefined reference to `__atomic_fetch_add_4'
+#
+TOOLCHAIN:pn-icu:armv4 = "gcc"
+TOOLCHAIN:pn-icu:armv5 = "gcc"
+
+#../../libgcrypt-1.6.5/mpi/mpih-div.c:98:3: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
+TOOLCHAIN:pn-libgcrypt:mips64 = "gcc"
+
+#recipe-sysroot/usr/include/mozjs-60/mozilla/Span.h:634:5: error: statement not allowed in constexpr function
+#|     MOZ_RELEASE_ASSERT(aStart <= len && (aLength == dynamic_extent ||
+#|     ^
+TOOLCHAIN:pn-polkit = "gcc"
+
+# ppp uses nested functions and gcc specific option e.g. --print-sysroot
+#
+TOOLCHAIN:pn-ppp = "gcc"
+
+#| ./ports/linux/pseudo_wrappers.c:80:14: error: use of unknown builtin '__builtin_apply' [-Wimplicit-function-declaration]
+#|         void *res = __builtin_apply((void (*)()) real_syscall, __builtin_apply_args(), sizeof(long) * 7);
+#|                     ^
+#| ./ports/linux/pseudo_wrappers.c:80:57: error: use of unknown builtin '__builtin_apply_args' [-Wimplicit-function-declaration]
+#|         void *res = __builtin_apply((void (*)()) real_syscall, __builtin_apply_args(), sizeof(long) * 7);
+TOOLCHAIN:pn-pseudo = "gcc"
+
+# mix_neon.c:179:9: error: invalid operand in inline asm: 'vld1.s32 ${0:h}, [$2]
+#      vld1.s32 ${1:h}, [$3] '
+TOOLCHAIN:pn-pulseaudio:armv7ve = "gcc"
+TOOLCHAIN:pn-pulseaudio:armv7a = "gcc"
+
+#| ./dsp/v4f_IIR2.h:554:12: error: no matching function for call to 'v4f_map'
+#|                                 a[5] = v4f_map<__builtin_cosf> (f);
+#|                                        ^~~~~~~~~~~~~~~~~~~~~~~
+TOOLCHAIN:pn-caps = "gcc"
+
+#| ../libffi-3.3-rc0/src/arm/sysv.S: Assembler messages:
+#| ../libffi-3.3-rc0/src/arm/sysv.S:131: Error: selected processor does not support `vldrle d0,[sp]' in ARM mode
+#| ../libffi-3.3-rc0/src/arm/sysv.S:132: Error: selected processor does not support `vldmgt sp,{d0-d7}' in ARM mode
+TOOLCHAIN:pn-libffi:armeb = "gcc"
+
+# rocksdb/rocksdb/util/crc32c_ppc_asm.S:9:10: fatal error: 'ppc-asm.h' file not found
+# #include <ppc-asm.h>
+# This header is only available with gcc-cross
+TOOLCHAIN:pn-mariadb:powerpc64le = "gcc"
+
+# OpenCV does not compile for ppc64 with clang due to VSX clashes with altivec.h from clang
+TOOLCHAIN:pn-opencv:powerpc64le = "gcc"
+# Ade is used by openCV and shared C++ runtime so we can not mix libstdc++ and libc++
+TOOLCHAIN:pn-ade:powerpc64le = "gcc"
+
+#| error: return address can be determined only for current frame
+#| error: return address can be determined only for current frame
+#| error: return address can be determined only for current frame
+TOOLCHAIN:pn-gcompat:mips = "gcc"
+
+# Fixes Clang induced linker crashes when using glibc 2.35+
+# mips-yoe-linux/mips-yoe-linux-ld: DWARF error: invalid or unhandled FORM value: 0x22
+# mips-yoe-linux-ld: Zend/asm/make_mips32_o32_elf_gas.o: CALL16 reloc at 0x28 not against global symbol
+# mips-yoe-linux/mips-yoe-linux-ld: BFD (GNU Binutils) 2.37.20210721 assertion fail ../../bfd/elfxx-mips.c:3614
+TOOLCHAIN:pn-php:mips = "gcc"
+
+# Workaround oe-core patching problem temporarily
+TOOLCHAIN:pn-rsync = "gcc"
+
+TOOLCHAIN:pn-u-boot-at91 = "gcc"
+TOOLCHAIN:pn-u-boot-fslc-mfgtool = "gcc"
+TOOLCHAIN:pn-u-boot-fslc-mxsboot = "gcc"
+TOOLCHAIN:pn-u-boot-fslc = "gcc"
+TOOLCHAIN:pn-u-boot-imx-mfgtool = "gcc"
+TOOLCHAIN:pn-u-boot-imx = "gcc"
+TOOLCHAIN:pn-u-boot-qoriq = "gcc"
+TOOLCHAIN:pn-u-boot-boundary = "gcc"
+TOOLCHAIN:pn-u-boot-script-boundary = "gcc"
+TOOLCHAIN:pn-u-boot-script-qoriq = "gcc"
+TOOLCHAIN:pn-u-boot-script-toradex = "gcc"
+TOOLCHAIN:pn-u-boot-kontron = "gcc"
+TOOLCHAIN:pn-u-boot-variscite = "gcc"
+TOOLCHAIN:pn-u-boot-toradex = "gcc"
+TOOLCHAIN:pn-u-boot-hardkernel = "gcc"
+TOOLCHAIN:pn-u-boot-starfive = "gcc"
+TOOLCHAIN:pn-u-boot-hardkernel = "gcc"
+TOOLCHAIN:pn-u-boot-nezha = "gcc"
+TOOLCHAIN:pn-u-boot-ti-mainline = "gcc"
+TOOLCHAIN:pn-u-boot-ti-staging = "gcc"
+TOOLCHAIN:pn-u-boot-splash = "gcc"
+TOOLCHAIN:pn-u-boot-coral = "gcc"
+
+# See https://github.com/kraj/meta-clang/issues/696
+TOOLCHAIN:pn-pixman:aarch64 = "gcc"
+# libomp needs to link in libatomic after itself when -fopenmp is used
+TOOLCHAIN:pn-pixman:mipsarcho32 = "gcc"
+# See https://github.com/llvm/llvm-project/issues/61412
+TOOLCHAIN:pn-frr:riscv64 = "gcc"
+TOOLCHAIN:pn-frr:riscv32 = "gcc"
+
+# Tegra stuff
+TOOLCHAIN:pn-standalone-mm-optee-tegra:tegra = "gcc"
+TOOLCHAIN:pn-edk2-firmware-tegra:tegra = "gcc"
+TOOLCHAIN:pn-optee-os-tadevkit:tegra = "gcc"
+TOOLCHAIN:pn-optee-nvsamples:tegra = "gcc"
+TOOLCHAIN:pn-optee-os:tegra = "gcc"
+TOOLCHAIN:pn-libgcc-for-nvcc:tegra = "gcc"
+TOOLCHAIN:pn-gcc-for-nvcc-runtime:tegra = "gcc"
+
+# Does not compile with clang 18
+#| core/arch/arm/include/arm64.h:392:1: error: expected writable system register or pstate
+#|   392 | DEFINE_U32_REG_READWRITE_FUNCS(fpcr)
+#|       | ^
+TOOLCHAIN:pn-optee-os:imx-nxp-bsp = "gcc"
+
+# Fails with clang-19+
+# Poco/PriorityDelegate.h:203:10: error: no member named '_pTarget' in 'PriorityDelegate<type-parameter-0-0, void, true>'
+TOOLCHAIN:pn-poco = "gcc"
+TOOLCHAIN:pn-netdata = "gcc"
+# Needs OMP and with clang openmp is not ported to rv32 yet
+TOOLCHAIN:pn-python3-drgn:riscv32 = "gcc"
+
+CFLAGS:append:pn-liboil:toolchain-clang:x86-64 = " -fheinous-gnu-extensions "
+
+# TOPDIR/build/tmp/work/core2-32-yoe-linux/gnu-efi/3.0.17-r0/gnu-efi-3.0.17//lib/ctors.S:11:41: error: expected the entry size
+# .section .init_array, "aM", @init_array
+#                                        ^
+CFLAGS:append:pn-gnu-efi:toolchain-clang = " -no-integrated-as"
+
+#../libffi-3.2.1/src/arm/sysv.S:363:2: error: invalid instruction, did you mean: fldmiax?
+# fldmiadgt ip, {d0-d7}
+CFLAGS:append:pn-libffi:mips64:toolchain-clang = " -no-integrated-as"
+
+# ../db-5.3.28/src/mutex/mut_tas.c:150:34: error: unknown directive
+#<inline asm>:9:2: note: instantiated into assembly here
+# .force_thumb
+#        ^
+#CFLAGS:append:pn-db:toolchain-clang = " -no-integrated-as"
+#
+#| ../../../DirectFB-1.7.7/lib/direct/armasm_memcpy.S:63:2: error: invalid instruction
+#|  ldmgeia r1!, {r3, r4, r12, lr}
+#|  ^
+CFLAGS:append:pn-directfb:toolchain-clang:arm = " -no-integrated-as"
+
+#| threads_pthread.c:(.text+0x372): undefined reference to `__atomic_is_lock_free'
+EXTRA_OECONF:pn-openssl:toolchain-clang:x86 = "-latomic"
+
+CFLAGS:append:pn-userland:toolchain-clang = " -no-integrated-as"
+
+# libjpeg-turbo-2.0.2/simd/mips/jsimd_dspr2.S
+# <instantiation>:13:5: error: invalid token in expression
+# .if $17 != 0
+# ^
+CFLAGS:append:pn-libjpeg-turbo:toolchain-clang:mipsarch = " -no-integrated-as"
+
+#| /tmp/x86-sse2-cdb148.s:207:9: error: ambiguous operand size for instruction 'sub'
+#|     sub SIZE, 64
+#|         ^~~~
+CFLAGS:append:pn-tinymembench:toolchain-clang:x86-64 = " -no-integrated-as"
+CFLAGS:append:pn-tinymembench:toolchain-clang:x86 = " -no-integrated-as"
+CFLAGS:append:pn-tinymembench:toolchain-clang:mipsarch = " -no-integrated-as"
+
+CFLAGS:append:pn-ne10:toolchain-clang:arm = " -no-integrated-as"
+CFLAGS:append:pn-libde265:toolchain-clang:arm = " -no-integrated-as"
+
+#2816:2: error: changed section type for .debug_frame, expected: 0x7000001E
+# .section .debug_frame,"",@progbits
+# ^
+#lj_vm.S:2890:2: error: changed section flags for .eh_frame, expected: 0x2
+# .section .eh_frame,"aw",@progbits
+# ^
+CFLAGS:append:pn-luajit:toolchain-clang:mips = " -no-integrated-as"
+
+# uftrace/0.15.2/git/arch/aarch64/dynamic.S:92:2: error: instruction requires: fp-armv8
+CFLAGS:append:pn-uftrace:toolchain-clang:aarch64 = " -no-integrated-as"
+
+#FAILED: libucontext_posix.so.1
+#clang-13: error: unable to execute command: Segmentation fault (core dumped)
+#clang-13: error: linker command failed due to signal (use -v to see invocation)
+CFLAGS:append:pn-libucontext:toolchain-clang:powerpc64le = " -no-integrated-as"
+
+# Generated asm file can not be compiled with clang assembler due to presence of .0 label
+# and its references
+#| aes-decrypt-internal-2.s:368:1: error: unexpected token at start of statement
+#| .0:
+#| ^
+CFLAGS:append:pn-nettle:toolchain-clang:powerpc64le = " -no-integrated-as"
+
+# include/gcc/arm/ck_pr.h:201:1: error: instruction requires: arm-mode
+#| CK_PR_DOUBLE_STORE(uint64_t, 64)
+#| ^
+#include/gcc/arm/ck_pr.h:192:6: note: expanded from macro 'CK_PR_DOUBLE_STORE'
+#|                          "strexd        %1, %3, [%2]\n"         \
+#|                           ^
+CFLAGS:append:pn-concurrencykit:toolchain-clang:arm = " -no-integrated-as"
+CFLAGS:append:pn-sysbench:toolchain-clang:arm = " -no-integrated-as"
+#error: expected absolute expression
+#.elseif (bpp == 24) && (numpix == 8)
+#        ^
+#<instantiation>:50:5: note: while in macro instantiation
+#    pixld chunk_size, mask_bpp, mask_basereg, MASK
+#    ^
+CFLAGS:append:pn-qtbase:toolchain-clang:arm = " -no-integrated-as"
+
+#../git/common/connection.c:154:55: error: comparison of integers of different signs: 'unsigned long' and 'int' [-Werror,-Wsign-compare]
+#        for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; cmsg = CMSG_NXTHDR(msg, cmsg)) {
+#                                                             ^~~~~~~~~~~~~~~~~~~~~~
+CFLAGS:append:pn-seatd:toolchain-clang = " -Wno-sign-compare"
+
+# -fno-tree-vrp is gcc specific
+CXXFLAGS:remove:pn-mozjs:toolchain-clang = "-fno-tree-vrp"
+CFLAGS:remove:pn-mozjs:toolchain-clang = "-fno-tree-vrp"
+
+CFLAGS:append:pn-ffmpeg:riscv64 = " -march=rv64gczbb"
+CFLAGS:append:pn-ffmpeg:riscv32 = " -march=rv32gczbb"
+
+# python3-lxml_5.0.0 onwards need this option with clang until the functions are fixes
+# | src/lxml/etree.c:246911:63: error: incompatible function pointer types passing 'void (void *, const xmlError *)' (aka 'void (void *, const struct _xmlError *)') to parameter of type 'xmlStructuredErrorFunc' (aka 'void (*
+#)(void *, struct _xmlError *)') [-Wincompatible-function-pointer-types]
+#|  246911 |     xmlSchematronSetValidStructuredErrors(__pyx_v_valid_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log));
+#|         |                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+CFLAGS:append:pn-python3-lxml:toolchain-clang = " -Wno-error=incompatible-function-pointer-types"
+# https://lists.openembedded.org/g/openembedded-devel/topic/103542151#108198
+CFLAGS:append:pn-python3-kivy:toolchain-clang = " -Wno-error=incompatible-function-pointer-types"
+
+# otherwise systemd efi fails to build
+# error: the 'sse' unit is not supported with this instruction set
+TUNE_CCARGS:remove:pn-systemd:toolchain-clang = "-mfpmath=sse"
+TUNE_CCARGS:remove:pn-systemd-boot:toolchain-clang = "-mfpmath=sse"
+
+TUNE_CCARGS:remove:pn-omxplayer:toolchain-clang = "-no-integrated-as"
+TUNE_CCARGS:remove:pn-nfs-utils:toolchain-clang = "-Qunused-arguments"
+
+# We want to error out when -msse option is used otherwise it enables sse on non-x86 arches
+TUNE_CCARGS:remove:pn-pipewire:toolchain-clang = "-Qunused-arguments"
+TUNE_CCARGS:remove:pn-tesseract:toolchain-clang = "-Qunused-arguments"
+TUNE_CCARGS:remove:pn-pulseaudio:toolchain-clang = "-Qunused-arguments"
+TUNE_CCARGS:remove:pn-btrfs-tools:toolchain-clang = "-Qunused-arguments"
+TUNE_CCARGS:append:pn-btrfs-tools:toolchain-clang = " -Werror=unused-command-line-argument"
+
+# Disable altivec on ppc32
+#/usr/include/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h:1345:32: error: use of undeclared identifier 'vec_sqrt'; did you mean 'vec_rsqrt'?
+#  BF16_TO_F32_UNARY_OP_WRAPPER(vec_sqrt, a);
+#                               ^~~~~~~~
+#                               vec_rsqrt
+TUNE_CCARGS:append:pn-ceres-solver:toolchain-clang:powerpc = " -mno-altivec"
+TUNE_CCARGS:append:pn-opencv:toolchain-clang:powerpc = " -mno-altivec"
+CXXFLAGS:append:pn-libeigen:toolchain-clang:powerpc = " -DEIGEN_ALTIVEC_DISABLE_MMA"
+
+# external/amber/src/src/amber.cc:53:41: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage]
+# vk-wrappers-1-0.inc:74:34: error: cast from 'PFN_vkVoidFunction' (aka 'void (*)()') to 'PFN_vkCmdEndRenderPass'
+# (aka 'void (*)(VkCommandBuffer_T *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
+CXXFLAGS:append:pn-opengl-es-cts:toolchain-clang = " -Wno-error=unsafe-buffer-usage -Wno-error=cast-function-type-strict"
+CXXFLAGS:append:pn-vulkan-cts:toolchain-clang = " -Wno-error=unsafe-buffer-usage -Wno-error=cast-function-type-strict"
+# Wno-error=overriding-option needed with clang-20
+# see https://github.com/jtv/libpqxx/issues/738 for deprecated-declarations ( not needed with clang19+ )
+CXXFLAGS:append:pn-vulkan-samples:toolchain-clang = " -Wno-error=overriding-option -Wno-error=deprecated-declarations"
+# Workaround for https://gitlab.gnome.org/GNOME/gtk/-/issues/6033
+CFLAGS:append:pn-gtk4:toolchain-clang = " -Wno-error=int-conversion"
+
+# usr/include/glib-2.0/glib/glib-autocleanups.h:49:1: error: cast from 'void (*)(void)' to 'GDestroyNotify'
+# (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
+CFLAGS:append:pn-pidgin-sipe:toolchain-clang = " -Wno-error=cast-function-type-strict"
+
+# 32bit builds of nodejs needs this warning to be disabled with clang16 until
+# v8 engine in nodejs moved beyong this commit
+# https://github.com/v8/v8/commit/d15d49b09dc7aef9edcc4cf6a0cb2b77a0db203f
+CXXFLAGS:append:pn-nodejs:toolchain-clang = " -Wno-error=enum-constexpr-conversion"
+# deps/TinyDeflate/gunzip.hh:1144:35: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
+CXXFLAGS:append:pn-doxygen:toolchain-clang = " -Wno-error=missing-template-arg-list-after-template-kw"
+
+#| /usr/src/debug/ruby/2.5.1-r0/build/../ruby-2.5.1/process.c:7073: undefined reference to `__mulodi4'
+#| clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
+COMPILER_RT:pn-ruby:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}"
+COMPILER_RT:pn-python3:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}"
+COMPILER_RT:pn-m4:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}"
+COMPILER_RT:pn-cpio:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}"
+COMPILER_RT:pn-openssh:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}"
+COMPILER_RT:pn-webkitgtk:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}"
+COMPILER_RT:pn-wpewebkit:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}"
+COMPILER_RT:pn-python3-numpy:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}"
+COMPILER_RT:pn-mongodb:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}"
+COMPILER_RT:remove:pn-m4:powerpc = "-rtlib=compiler-rt"
+COMPILER_RT:remove:pn-ruby:powerpc = "-rtlib=compiler-rt"
+COMPILER_RT:remove:pn-webkitgtk:powerpc = "-rtlib=compiler-rt"
+COMPILER_RT:remove:pn-m4:armeb = "-rtlib=compiler-rt"
+COMPILER_RT:remove:pn-ruby:armeb = "-rtlib=compiler-rt"
+COMPILER_RT:remove:pn-webkitgtk:armeb = "-rtlib=compiler-rt"
+# build/lib/libQt5Widgets.so: undefined reference to `__lshrti3'
+# __lshrti3 is missing in libgcc
+COMPILER_RT:pn-qtbase:toolchain-clang:riscv32 = "-rtlib=compiler-rt ${UNWINDLIB}"
+
+LDFLAGS:append:pn-qtwebengine:toolchain-clang:runtime-gnu:x86 = " -latomic"
+LDFLAGS:append:pn-qemu:toolchain-clang:x86 = " -latomic"
+# warning: <elfFile> has a LOAD segment with RWX permissions
+LDFLAGS:append:pn-ruby:toolchain-clang:powerpc = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '', ' -Wl,--no-warn-rwx-segment', d)}"
+LDFLAGS:append:pn-cairo:toolchain-clang:powerpc = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '', ' -Wl,--no-warn-rwx-segment', d)}"
+LDFLAGS:append:pn-systemd:toolchain-clang:powerpc = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '', ' -Wl,--no-warn-rwx-segment', d)}"
+
+# glibc is built with gcc and hence encodes some libgcc specific builtins which are not found
+# when doing static linking with clang using compiler-rt, so use libgcc
+# undefined reference to `__unordtf2'
+COMPILER_RT:pn-aufs-util:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc"
+COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc"
+COMPILER_RT:pn-tsocks:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc"
+COMPILER_RT:pn-libc-bench:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc"
+COMPILER_RT:pn-fmt:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc"
+COMPILER_RT:pn-fmt:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc"
+COMPILER_RT:pn-mybw:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc"
+COMPILER_RT:pn-mybw:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc"
+COMPILER_RT:pn-libc-bench:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc"
+COMPILER_RT:pn-mpich:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc"
+COMPILER_RT:pn-aufs-util:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc"
+COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc"
+COMPILER_RT:pn-tsocks:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc"
+# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot//usr/lib/libc.a(printf_fp.o): in function `__printf_fp_l':
+# | /usr/src/debug/glibc/2.35-r0/git/stdio-common/printf_fp.c:388: undefined reference to `__unordtf2'
+# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: /usr/src/debug/glibc/2.35-r0/git/stdio-common/printf_fp.c:388: undefined reference to `__unordtf2'
+# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: /usr/src/debug/glibc/2.35-r0/git/stdio-common/printf_fp.c:388: undefined reference to `__letf2'
+# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot//usr/lib/libc.a(printf_fphex.o): in function `__printf_fphex':
+# | /usr/src/debug/glibc/2.35-r0/git/stdio-common/../stdio-common/printf_fphex.c:206: undefined reference to `__unordtf2'
+# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: /usr/src/debug/glibc/2.35-r0/git/stdio-common/../stdio-common/printf_fphex.c:206: undefined reference to `__unordtf2'
+# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: /usr/src/debug/glibc/2.35-r0/git/stdio-common/../stdio-common/printf_fphex.c:206: undefined reference to `__letf2'
+# | x86_64-lmp-linux-clang -target x86_64-lmp-linux  -m64 -march=nehalem -mtune=generic -mfpmath=sse -msse4.2 -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -fstack-protector-strong  -O2 -D_F
+COMPILER_RT:pn-ostree:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc"
+COMPILER_RT:pn-ostree:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc"
+
+#(unwind.o): in function `__pthread_unwind':
+#/usr/src/debug/glibc/2.29-r0/git/nptl/unwind.c:121: undefined reference to `_Unwind_ForcedUnwind'
+#clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
+COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:arm = "--unwindlib=libgcc"
+
+# Does not compile with libc++ from clang 17+ anymore see
+# https://github.com/llvm/llvm-project/issues/63743
+LIBCPLUSPLUS:pn-apt:toolchain-clang = "-stdlib=libstdc++"
+
+# All following need to use libstdc++ with clang-19
+# see https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals
+LIBCPLUSPLUS:pn-pbzip2:toolchain-clang = "-stdlib=libstdc++"
+LIBCPLUSPLUS:pn-nlohmann-json:toolchain-clang = "-stdlib=libstdc++"
+LIBCPLUSPLUS:pn-paho-mqtt-cpp:toolchain-clang = "-stdlib=libstdc++"
+LIBCPLUSPLUS:pn-poco:toolchain-clang = "-stdlib=libstdc++"
+LIBCPLUSPLUS:pn-netdata:toolchain-clang = "-stdlib=libstdc++"
+LIBCPLUSPLUS:pn-cpp-netlib:toolchain-clang = "-stdlib=libstdc++"
+LIBCPLUSPLUS:pn-cpprest:toolchain-clang = "-stdlib=libstdc++"
+# See https://lists.openembedded.org/g/openembedded-devel/topic/meta_oe_patch_2_3/108964413
+LIBCPLUSPLUS:pn-tomlplusplus:toolchain-clang = "-stdlib=libstdc++"
+LIBCPLUSPLUS:pn-doxygen:toolchain-clang = "-stdlib=libstdc++"
+
+# Uses gcc for native tools, e.g. nsinstall and passes clang options which fails so
+# let same compiler ( gcc or clang) be native/cross compiler
+# | gcc: error: unrecognized command line option ‘-Qunused-arguments’
+BUILD_CC:pn-nss:toolchain-clang = "clang -rtlib=libgcc -unwindlib=none"
+
+# LTO
+# Seems to use symver ASMs see https://stackoverflow.com/questions/46304742/how-to-combine-lto-with-symbol-versioning
+# lib/puny_encode.c:136: multiple definition of `_idn2_punycode_encode'
+LTO:pn-libidn2:toolchain-clang = ""
+
+#libcairo.so: undefined reference to pthread_mutexattr_init [--no-allow-shlib-undefined]
+LTO:pn-cairo:toolchain-clang = ""
+
+# This works with gcc-ranlib wrapper only which expands $@ shell array,
+# but it will fail if RANLIB was set to <cross>-ranlib or
+# <cross>-llvn-ranlib has same behaviour
+RANLIB:append:pn-tcf-agent:toolchain-clang = " $@"
+
+# Subprocess output:mips-yoe-linux-llvm-objcopy: error: Link field value 22 in section .rel.dyn is not a symbol table
+# also seen on riscv64 and x86-64
+OBJCOPY:pn-linux-yocto:toolchain-clang = "${HOST_PREFIX}objcopy"
+OBJCOPY:pn-linux-yocto-dev:toolchain-clang = "${HOST_PREFIX}objcopy"
+OBJCOPY:pn-linux-yocto-rt:toolchain-clang = "${HOST_PREFIX}objcopy"
+OBJCOPY:pn-linux-variscite:toolchain-clang = "${HOST_PREFIX}objcopy"
+OBJCOPY:pn-linux-ti-staging:toolchain-clang = "${HOST_PREFIX}objcopy"
+OBJCOPY:pn-linux-raspberrypi:toolchain-clang = "${HOST_PREFIX}objcopy"
+OBJCOPY:pn-linux-starfive-dev:toolchain-clang = "${HOST_PREFIX}objcopy"
+OBJCOPY:pn-linux-nezha-dev:toolchain-clang = "${HOST_PREFIX}objcopy"
+OBJCOPY:pn-linux-hardkernel:toolchain-clang = "${HOST_PREFIX}objcopy"
+OBJCOPY:pn-linux-imx:toolchain-clang = "${HOST_PREFIX}objcopy"
+OBJCOPY:pn-linux-fslc:toolchain-clang = "${HOST_PREFIX}objcopy"
+OBJCOPY:pn-linux-fslc-imx:toolchain-clang = "${HOST_PREFIX}objcopy"
+OBJCOPY:pn-linux-fslc-lts:toolchain-clang = "${HOST_PREFIX}objcopy"
+OBJCOPY:pn-linux-at91:toolchain-clang = "${HOST_PREFIX}objcopy"
+OBJCOPY:pn-linux-linaro-qcomlt:toolchain-clang = "${HOST_PREFIX}objcopy"
+OBJCOPY:pn-linux-intel:toolchain-clang = "${HOST_PREFIX}objcopy"
+
+# see https://github.com/llvm/llvm-project/issues/53948
+OBJCOPY:pn-opensbi:toolchain-clang = "${HOST_PREFIX}objcopy"
+OBJCOPY:pn-libc-bench:toolchain-clang = "${HOST_PREFIX}objcopy"
+STRIP:pn-libc-bench:toolchain-clang = "${HOST_PREFIX}strip"
+OBJCOPY:pn-aufs-util:toolchain-clang = "${HOST_PREFIX}objcopy"
+STRIP:pn-aufs-util:toolchain-clang = "${HOST_PREFIX}strip"
+
+# Depend on GNU objcopy option missing in llvm-objcopy
+# llvm-objcopy: error: unknown argument '--section-alignment=512'
+OBJCOPY:pn-systemd-boot:toolchain-clang = "${HOST_PREFIX}objcopy"
+
+# See https://github.com/llvm/llvm-project/issues/53999
+STRIP:pn-go-helloworld:mips:toolchain-clang = "${HOST_PREFIX}strip"
+OBJCOPY:pn-go-helloworld:mips:toolchain-clang = "${HOST_PREFIX}objcopy"
+STRIP:pn-gosu:mips:toolchain-clang = "${HOST_PREFIX}strip"
+OBJCOPY:pn-gosu:mips:toolchain-clang = "${HOST_PREFIX}objcopy"
+
+# e.g. mips-yoe-linux-llvm-objcopy: error: Link field value 42 in section .rel.dyn is not a symbol table
+# e.g. aarch64-yoe-linux-llvm-objcopy: error: Link field value 35 in section .rela.plt is not a symbol table
+OBJCOPY:pn-mybw:toolchain-clang = "${HOST_PREFIX}objcopy"
+
+# Fails with llvm strip
+# i686-yoe-linux-llvm-strip: error: SHT_STRTAB string table section [index 9] is non-null terminated
+STRIP:pn-minio:toolchain-clang = "${HOST_PREFIX}strip"
+OBJCOPY:pn-minio:toolchain-clang = "${HOST_PREFIX}objcopy"
+
+# | aarch64-yoe-linux-llvm-objcopy: error: invalid output format: 'efi-app-aarch64'
+OBJCOPY:pn-gnu-efi:toolchain-clang = "${HOST_PREFIX}objcopy"
+
+# see https://github.com/llvm/llvm-project/issues/54213
+# Generates a bad libbsd.so linker stub and apps like bluelsa, mg, netcat-openbsd, android-tools
+# fails to link with libbsd
+OBJDUMP:pn-libbsd:mips:toolchain-clang = "${HOST_PREFIX}objdump"
+
+# With clang/lld it builds objects which gnu strip complains about
+# riscv64-yoe-linux-strip: /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/python3-matplotlib/3.5.3-r0/package/usr/lib/python3.10/site-packages/matplotlib/stTcyupd: not enough room for program headers, try linking with -N
+STRIP:pn-python3-matplotlib:toolchain-clang:riscv64 = "${HOST_PREFIX}llvm-strip"
+STRIP:pn-python3-matplotlib:toolchain-clang:riscv32 = "${HOST_PREFIX}llvm-strip"
+
+# Need OBJDUMP during do_package_qa which is set to llvm-objdump with meta-clang
+# it might work with GNU objdump since it falls back to one from build host
+DEPENDS:append:pn-linux-firmware:toolchain-clang = " clang-native"
+
+# Needs for solving fopenmp issues
+DEPENDS:append:pn-pixman:mips:toolchain-clang = " openmp"
+#| ../pixman-0.40.0/pixman/pixman-arm-neon-asm.S:3625:1: note: while in macro instantiation
+#| generate_bilinear_scanline_func pixman_scaled_bilinear_scanline_0565_0565_SRC_asm_neon, 0565, 0565, 1, 1, 28, BILINEAR_FLAG_UNROLL_4
+#| ^
+#| <instantiation>:134:1: error: unknown directive
+#| .endfunc
+#| ^
+CFLAGS:append:pn-pixman:arm:toolchain-clang = " -no-integrated-as"
+# <instantiation>:98:23: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
+#  vsetvli zero, zero, e16, m1
+CFLAGS:append:pn-dav1d:riscv64:toolchain-clang = " -no-integrated-as"
+
+# test_connectx segfaults with this option set to -fstack-protector-strong
+SECURITY_STACK_PROTECTOR:pn-lksctp-tools:toolchain-clang = ""
+
+# ERROR: babeltrace2-2.0.5-r0 do_package_qa: QA Issue: babeltrace2: ELF binary /usr/lib/babeltrace2/plugins/babeltrace-plugin-ctf.so has relocations in .text
+INSANE_SKIP:append:pn-babeltrace2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' textrel', '', d)}"
+
+LDFLAGS:append:pn-libidn2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-alsa-lib:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libmd:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libbsd:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-slang:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libgcrypt:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libxml2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-binutils:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libnss-mdns:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-pulseaudio:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-mesa:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-mesa-gl:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-mesa-pvr:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libnsl2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libnl:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libnftnl:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libtirpc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-ndctl:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+
+LDFLAGS:append:pn-zlib:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd -Wl,--undefined-version', '', d)}"
+LDFLAGS:remove:pn-zlib:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}"
+
+LDFLAGS:append:pn-qtbase:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+# | aarch64-yoe-linux-ld.lld: error: version script assignment of 'Qt_6.5' to symbol 'qt_version_tag' failed: symbol not defined
+LDFLAGS:append:pn-qtlanguageserver:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtserialport:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtimageformats:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtnetworkauth:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtsvg:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtshadertools:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtdeclarative:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtserialbus:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtwebsockets:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtlottie:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtspeech:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtcoap:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtsensors:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtquickdesigner-components:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtquicktimeline:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qt5compat:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qt3d:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtvirtualkeyboard:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtscxml:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtpositioning:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtdatavis3d:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtremoteobjects:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtopcua:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtcharts:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtconnectivity:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtwayland:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtgrpc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qthttpserver:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtmqtt:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtwebchannel:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtquick3d:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtlocation:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtwebengine:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtwebview:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtmultimedia:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtquick3dphysics:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtinterfaceframework:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qttools:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtdeviceutilities:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-qtpdf:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libxcrypt:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-popt:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-json-c:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libtalloc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libdevmapper:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libtdb:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libtevent:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-cryptsetup:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libgphoto2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libxklavier:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-lame:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-keyutils:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libcdio:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libva:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libbpf:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-npth:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-tbb:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-corosync:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libnetfilter-cttimeout:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-fuse3:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-tremor:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-flashrom:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-ipset:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-rdma-core:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-apitrace:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libkcapi:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-gtk-vnc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libnss-nis:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libva-initial:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-dante:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-basu:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-passwdqc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-pcp:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-multipath-tools:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-renderdoc:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libldb:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-samba:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libnvme:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-gnu-efi:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libffi:x86:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libffi:arm:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-elfutils:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-pmdk:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-libcgroup:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld sysvinit', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-kernel-selftest:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-openldap:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-liburing:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-frame:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+# | x86_64-yoe-linux-musl-ld.lld: error: version script assignment of 'global' to symbol 'pam_sm_chauthtok' failed: symbol not defined
+LDFLAGS:append:pn-wtmpdb:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+# arm-yoe-linux-gnueabi-ld.lld: error: version script assignment of 'global' to symbol 'pam_sm_chauthtok' failed: symbol not defined
+LDFLAGS:append:pn-util-linux:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+LDFLAGS:append:pn-util-linux-libuuid:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
+TUNE_CCARGS:remove:pn-kernel-selftest:toolchain-clang = "-mfpmath=sse"
+
+# Avoid's go linker crash as reported in https://github.com/golang/go/issues/61872
+# it happens when libstd.so is linked with lld for aarch64
+LDFLAGS:append:pn-go-runtime:toolchain-clang:aarch64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}"
+LDFLAGS:remove:pn-go-runtime:toolchain-clang:aarch64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}"
+LDFLAGS:append:pn-go-runtime:toolchain-clang:x86-64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}"
+LDFLAGS:remove:pn-go-runtime:toolchain-clang:x86-64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}"
+# See https://github.com/llvm/llvm-project/issues/65017
+LDFLAGS:append:pn-libfaketime:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}"
+LDFLAGS:remove:pn-libfaketime:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}"
+# arm-yoe-linux-gnueabi-ld.lld: error: version script assignment of 'global' to symbol 'readdir' failed: symbol not defined
+#| arm-yoe-linux-gnueabi-ld.lld: error: version script assignment of 'global' to symbol 'readdir_r' failed: symbol not defined
+#| arm-yoe-linux-gnueabi-clang: error: linker command failed with exit code 1 (use -v to see invocation) 
+LDFLAGS:append:pn-aufs-util:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}"
+LDFLAGS:remove:pn-aufs-util:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}"
+# | arm-yoe-linux-gnueabi-ld.lld: error: version script assignment of 'global' to symbol 'pam_sm_chauthtok' failed: symbol not defined
+LDFLAGS:append:pn-lastlog2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}"
+LDFLAGS:remove:pn-lastlog2:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}"
+LDFLAGS:remove:pn-python3-bcrypt:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld ptest', '-fuse-ld=lld', '', d)}"
+LDFLAGS:remove:pn-bluez5:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=lld', '', d)}"
+LDFLAGS:append:pn-bluez5:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}"
+
+LD:pn-gnu-efi:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '${HOST_PREFIX}ld.bfd${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}', '${HOST_PREFIX}ld${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}', d)}"
+LD:pn-libhugetlbfs:toolchain-clang = "${HOST_PREFIX}ld.bfd${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}"
+LD:pn-libunix-statgrab:toolchain-clang = "${CC}"
+
+TOOLCHAIN:pn-perf = "gcc"
+
+# See https://github.com/llvm/llvm-project/issues/108262
+SELECTED_OPTIMIZATION:remove:pn-libjxl:arm:toolchain-clang = "-O2"
+SELECTED_OPTIMIZATION:append:pn-libjxl:arm:toolchain-clang = " -Og"
+
+# qemu usermode crashes when using clang as system compiler but works with gcc
+# see https://patchwork.yoctoproject.org/project/oe-core/patch/[email protected]/
+GI_DATA_ENABLED:pn-vte:toolchain-clang:armv7ve = "False"
#2 lore raw

Re: [OE-core] [PATCH 02/19] nonclangable.inc: Add recipe which can not be built with clang

Quoted 8 lines · Khem Raj via lists.openembedded.org

Some need adjusting commandline variables and other parameters all get housed here

---
 meta/conf/distro/include/nonclangable.inc | 687 ++++++++++++++++++++++

 1 file changed, 687 insertions(+)

 create mode 100644 meta/conf/distro/include/nonclangable.inc

We should be able to add an include_all directive in the clang toolchain config which means these pieces can be split to the layers where the recipes belong rather than being central in core.

Cheers,

Richard

author
#3 lore raw

PATCH 3/19 nonscanable.inc: Includes recipes which can not be used with clang-scan

In reply to Khem Raj

clang-scan is a static code analyser that comes with clang/llvm collection but all recipes may not work out of box, so mention those recipes here so that if someone wants to enable it distro/image wide they can

---
 meta/conf/distro/include/nonscanable.inc | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 meta/conf/distro/include/nonscanable.inc
meta/conf/distro/include/nonscanable.inc new file +22 -0
new file mode 100644
index 00000000000..3cdc454e905
@@ -0,0 +1,22 @@
+SCAN_BUILD:pn-linux-libc-headers = ""
+SCAN_BUILD:pn-update-rc.d = ""
+SCAN_BUILD:pn-initscripts = ""
+SCAN_BUILD:pn-base-files = ""
+SCAN_BUILD:pn-os-release = ""
+SCAN_BUILD:pn-wireless-regdb = ""
+SCAN_BUILD:pn-tzdata = ""
+SCAN_BUILD:pn-qemuwrapper-cross = ""
+SCAN_BUILD:pn-depmodwrapper-cross = ""
+SCAN_BUILD:pn-bluez-firmware-rpidistro = ""
+SCAN_BUILD:pn-udev-rules-rpi = ""
+SCAN_BUILD:pn-shadow-securetty = ""
+SCAN_BUILD:pn-96boards-tools = ""
+SCAN_BUILD:pn-run-postinsts = ""
+SCAN_BUILD:pn-keymaps = ""
+SCAN_BUILD:pn-sysvinit-inittab = ""
+SCAN_BUILD:pn-pi-bluetooth = ""
+SCAN_BUILD:pn-rpi-config = ""
+SCAN_BUILD:pn-bcm2835-bootfiles = ""
+SCAN_BUILD:pn-autoconf-archive = ""
+SCAN_BUILD:pn-compiler-rt = ""
+SCAN_BUILD:pn-libcxx = ""
author
#4 lore raw

PATCH 4/19 scan-build.bbclass: Add class to enable clang static analyser

In reply to Khem Raj
---
 meta/classes-recipe/scan-build.bbclass | 60 ++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 meta/classes-recipe/scan-build.bbclass
meta/classes-recipe/scan-build.bbclass new file +60 -0
new file mode 100644
index 00000000000..e1a72de993e
@@ -0,0 +1,60 @@
+# Copyright (C) 2018 Khem Raj <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+EXTRA_ANALYZER_OPTIONS += "-analyze-headers"
+EXTRA_ANALYZER_OPTIONS += "--force-analyze-debug-code"
+SCAN_BUILD ??= "1"
+SCAN_BUILD:class-native = ""
+SCAN_BUILD:class-nativesdk = ""
+SCAN_BUILD:class-cross = ""
+SCAN_BUILD:class-crosssdk = ""
+SCAN_BUILD:class-cross-canadian = ""
+
+CLANG_SCAN_SERVER_IP ??= "0.0.0.0"
+CLANG_SCAN_PORT ??= "8181"
+SCAN_RESULTS_DIR ?= "${TMPDIR}/static-scan/${PN}"
+
+CCSCAN ?= "${HOST_PREFIX}${TOOLCHAIN}"
+CXXSCAN:toolchain-clang ?= "${HOST_PREFIX}clang++"
+CXXSCAN:toolchain-gcc ?= "${HOST_PREFIX}g++"
+
+do_scanbuild() {
+        rm -rf ${SCAN_RESULTS_DIR}
+        scan-build --use-cc ${CCSCAN} --use-c++ ${CXXSCAN} --analyzer-target ${HOST_SYS} --html-title ${BP} -o ${SCAN_RESULTS_DIR} ${EXTRA_ANALYZER_OPTIONS} ${MAKE} ${PARALLEL_MAKE} ${EXTRA_OEMAKE}
+}
+
+do_scanview() {
+        bbplain "================================================================"
+        bbplain "Starting scan-view server at: http://${CLANG_SCAN_SERVER_IP}:${CLANG_SCAN_PORT}"
+        bbplain "Use Ctrl-C to exit"
+        bbplain "================================================================"
+        scan-view --host ${CLANG_SCAN_SERVER_IP} --port ${CLANG_SCAN_PORT} --allow-all-hosts --no-browser ${SCAN_RESULTS_DIR}/*/
+}
+
+do_scanview[depends] += "${PN}:do_scanbuild"
+do_scanbuild[depends] += "clang-native:do_populate_sysroot"
+#do_scanbuild[cleandirs] += "${SCAN_RESULTS_DIR}"
+do_scanbuild[dirs] += "${B}"
+do_scanview[dirs] += "${SCAN_RESULTS_DIR}"
+#do_build[recrdeptask] += "do_scanbuild"
+
+do_scanbuild[doc] = "Build and scan static analysis data using clang"
+do_scanview[doc] = "Start a webserver to visualize static analysis data"
+
+addtask scanbuild after do_configure before do_compile
+addtask scanview after do_scanbuild
+python () {
+    # Remove scanbuild task when scanning is not enabled or recipe does not have do_configure
+    if not(d.getVar('SCAN_BUILD') == "1") or not(d.getVar('TOOLCHAIN') == "clang") or oe.utils.inherits(d, 'allarch'):
+        for i in ['do_scanbuild', 'do_scanview']:
+            bb.build.deltask(i, d)
+    else:
+        cflags = d.getVar('CFLAGS', False) + d.getVar('TARGET_CC_ARCH', False) + d.getVar('TOOLCHAIN_OPTIONS', False)
+        cxxflags = d.getVar('CXXFLAGS', False) + d.getVar('TARGET_CC_ARCH', False) + d.getVar('TOOLCHAIN_OPTIONS', False)
+        d.setVar('CFLAGS', cflags)
+        d.setVar('CXXFLAGS', cxxflags)
+        if oe.utils.inherits(d, 'autotools'):
+            cachedvar = d.getVar('CACHED_CONFIGUREVARS', False)
+            cachedvar = cachedvar + " scan-build " + " --analyzer-target " + d.getVar('HOST_SYS', False) + " --use-cc " + d.getVar('CCSCAN', False) + " --use-c++ " + d.getVar('CXXSCAN', False)
+            d.setVar('CACHED_CONFIGUREVARS', cachedvar)
+}
#5 lore raw

Re: [OE-core] [PATCH 04/19] scan-build.bbclass: Add class to enable clang static analyser

Quoted 5 lines · Khem Raj via lists.openembedded.org

---
 meta/classes-recipe/scan-build.bbclass | 60 ++++++++++++++++++++++++++

 1 file changed, 60 insertions(+)

 create mode 100644 meta/classes-recipe/scan-build.bbclass

I think this class can wait until later and shouldn't be part of the initial merge.

Cheers,

Richard

author
#6 lore raw

PATCH 5/19 clang-native.bbclass: Abstraction to enable clang as native compiler

In reply to Khem Raj

Some packages demand clang all the way, including for native pieces e.g. chromium, this helps to get that going

---
 meta/classes-recipe/clang-native.bbclass | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 meta/classes-recipe/clang-native.bbclass
meta/classes-recipe/clang-native.bbclass new file +24 -0
new file mode 100644
index 00000000000..a136deeee38
@@ -0,0 +1,24 @@
+# inherit this class if you would like to use clang to compile the native
+# version of your recipes instead of system compiler ( which is normally gcc )
+# on build machines
+# to use it add
+#
+# inherit clang-native
+#
+# to the concerned recipe via a bbappend or directly to recipe file
+#
+DEPENDS:append:runtime-llvm = " compiler-rt-native libcxx-native"
+# Use libcxx headers for native parts
+CXXFLAGS:append:runtime-llvm = " -stdlib=libc++"
+BUILD_CXXFLAGS:append:runtime-llvm = " -isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++"
+# Use libgcc for native parts
+LDFLAGS:append:runtime-llvm = " -stdlib=libc++ -rtlib=libgcc -unwindlib=libgcc"
+BUILD_LDFLAGS:append:runtime-llvm = " -stdlib=libc++ -rtlib=libgcc -unwindlib=libgcc"
+DEPENDS:append = " clang-native"
+BUILD_CC  = "${CCACHE}clang -isysroot=${STAGING_DIR_NATIVE}"
+BUILD_CXX = "${CCACHE}clang++ -isysroot=${STAGING_DIR_NATIVE}"
+BUILD_CPP = "${CCACHE}clang -isysroot=${STAGING_DIR_NATIVE} -E"
+BUILD_CCLD = "${CCACHE}clang"
+BUILD_RANLIB = "llvm-ranlib"
+BUILD_AR = "llvm-ar"
+BUILD_NM = "llvm-nm"
author
#7 lore raw

PATCH 6/19 cmake-native.bbclass: Abstraction to use cmake with native toolchains

In reply to Khem Raj

This would enable using OE built native toolchain e.g. clang-native to build cmake based native packages

---
 meta/classes-recipe/cmake-native.bbclass | 56 ++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 meta/classes-recipe/cmake-native.bbclass
meta/classes-recipe/cmake-native.bbclass new file +56 -0
new file mode 100644
index 00000000000..116cdd1a999
@@ -0,0 +1,56 @@
+# Native C/C++ compiler (without cpu arch/tune arguments)
+OECMAKE_NATIVE_C_COMPILER ?= "`echo ${BUILD_CC} | sed 's/^\([^ ]*\).*/\1/'`"
+OECMAKE_NATIVE_CXX_COMPILER ?= "`echo ${BUILD_CXX} | sed 's/^\([^ ]*\).*/\1/'`"
+OECMAKE_NATIVE_AR ?= "${BUILD_AR}"
+OECMAKE_NATIVE_RANLIB ?= "${BUILD_RANLIB}"
+OECMAKE_NATIVE_NM ?= "${BUILD_NM}"
+
+# Native compiler flags
+OECMAKE_NATIVE_C_FLAGS ?= "${BUILD_CC_ARCH} ${BUILD_CFLAGS}"
+OECMAKE_NATIVE_CXX_FLAGS ?= "${BUILD_CC_ARCH} ${BUILD_CXXFLAGS}"
+OECMAKE_NATIVE_C_FLAGS_RELEASE ?= "-DNDEBUG"
+OECMAKE_NATIVE_CXX_FLAGS_RELEASE ?= "-DNDEBUG"
+OECMAKE_NATIVE_C_LINK_FLAGS ?= "${BUILD_CC_ARCH} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS}"
+OECMAKE_NATIVE_CXX_LINK_FLAGS ?= "${BUILD_CC_ARCH} ${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}"
+BUILD_CXXFLAGS += "${BUILD_CC_ARCH}"
+BUILD_CFLAGS += "${BUILD_CC_ARCH}"
+
+do_generate_native_toolchain_file() {
+        cat > ${WORKDIR}/toolchain-native.cmake <<EOF
+set( CMAKE_SYSTEM_NAME `echo ${BUILD_OS} | sed -e 's/^./\u&/' -e 's/^\(Linux\).*/\1/'` )
+set( CMAKE_SYSTEM_PROCESSOR ${BUILD_ARCH} )
+set( CMAKE_C_COMPILER ${OECMAKE_NATIVE_C_COMPILER} )
+set( CMAKE_CXX_COMPILER ${OECMAKE_NATIVE_CXX_COMPILER} )
+set( CMAKE_ASM_COMPILER ${OECMAKE_NATIVE_C_COMPILER} )
+set( CMAKE_AR ${OECMAKE_NATIVE_AR} CACHE FILEPATH "Archiver" )
+set( CMAKE_RANLIB ${OECMAKE_NATIVE_RANLIB} CACHE FILEPATH "Archive Indexer" )
+set( CMAKE_NM ${OECMAKE_NATIVE_NM} CACHE FILEPATH "Symbol Lister" )
+set( CMAKE_C_FLAGS "${OECMAKE_NATIVE_C_FLAGS}" CACHE STRING "CFLAGS" )
+set( CMAKE_CXX_FLAGS "${OECMAKE_NATIVE_CXX_FLAGS}" CACHE STRING "CXXFLAGS" )
+set( CMAKE_ASM_FLAGS "${OECMAKE_NATIVE_C_FLAGS}" CACHE STRING "ASM FLAGS" )
+set( CMAKE_C_FLAGS_RELEASE "${OECMAKE_NATIVE_C_FLAGS_RELEASE}" CACHE STRING "Additional CFLAGS for release" )
+set( CMAKE_CXX_FLAGS_RELEASE "${OECMAKE_NATIVE_CXX_FLAGS_RELEASE}" CACHE STRING "Additional CXXFLAGS for release" )
+set( CMAKE_ASM_FLAGS_RELEASE "${OECMAKE_NATIVE_C_FLAGS_RELEASE}" CACHE STRING "Additional ASM FLAGS for release" )
+set( CMAKE_C_LINK_FLAGS "${OECMAKE_NATIVE_C_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
+set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_NATIVE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
+
+set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_NATIVE} )
+set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
+set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH )
+set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
+set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
+
+# Use native cmake modules
+list(APPEND CMAKE_MODULE_PATH "${STAGING_DATADIR_NATIVE}/cmake/Modules/")
+
+# add for non /usr/lib libdir, e.g. /usr/lib64
+set( CMAKE_LIBRARY_PATH ${STAGING_BASE_LIBDIR_NATIVE} ${STAGING_LIBDIR_NATIVE})
+
+# add include dir to implicit includes in case it differs from /usr/include
+list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES ${STAGING_INCDIR_NATIVE})
+list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES ${STAGING_INCDIR_NATIVE})
+
+EOF
+}
+
+addtask generate_native_toolchain_file after do_patch before do_configure
author
#8 lore raw

PATCH 7/19 clang: Migrate clang and related recipes from meta-clang

In reply to Khem Raj

This includes compiler, tools and runtime libraries, they are brought in together to avoid major rehashing due to their interdependence.

---
 .../clang/clang-cross-canadian_git.bb         |  36 ++
 .../recipes-devtools/clang/clang-cross_git.bb |  35 ++
 .../clang/clang-crosssdk_git.bb               |  34 ++
 meta/recipes-devtools/clang/clang.inc         |  24 +
 ...ibunwind-headers-when-LIBCXXABI_LIBU.patch |  60 +++
 ...-support-a-new-embedded-linux-target.patch | 309 ++++++++++++
 ...lify-cross-compilation.-Don-t-use-na.patch |  44 ++
 ...ryInfo-Undefine-libc-functions-if-th.patch |  90 ++++
 ...-env-override-of-exe-and-libdir-path.patch |  71 +++
 ...g-driver-Check-sysroot-for-ldso-path.patch |  75 +++
 ...tools.cpp-Add-lssp_nonshared-on-musl.patch |  32 ++
 ...08-clang-Prepend-trailing-to-sysroot.patch |  39 ++
 ...e-the-target-sysroot-for-compiler-ru.patch |  41 ++
 ...efine-releative-gcc-installation-dir.patch |  47 ++
 ...ad-and-ldl-along-with-lunwind-for-st.patch |  35 ++
 ...UTABLE-when-cross-compiling-for-nati.patch |  24 +
 ...3-Check-for-atomic-double-intrinsics.patch |  34 ++
 ...gure-for-packages-using-find_package.patch | 115 +++++
 ...ce-dir-location-for-cross-toolchains.patch |  42 ++
 ...-dyld-prefix-when-checking-sysroot-f.patch |  79 +++
 ...-clang-Use-python3-in-python-scripts.patch |  35 ++
 ...-Yocto-based-GCC-install-search-path.patch |  70 +++
 ...or-for-adding-OE-distro-vendor-names.patch |  32 ++
 ...ot-use-backtrace-APIs-on-non-glibc-l.patch |  68 +++
 ...iple-for-non-debian-multiarch-linux-.patch |  28 ++
 ...libunwind-Added-unw_backtrace-method.patch |  56 +++
 ...ot-use-install-relative-libc-headers.patch |  34 ++
 ...-Fix-lib-paths-for-OpenEmbedded-Host.patch |  79 +++
 ...ry-search-path-for-OpenEmbedded-Host.patch |  84 ++++
 ...0026-lldb-Link-with-libatomic-on-x86.patch |  33 ++
 ...ompiler-rt-Enable-__int128-for-ppc32.patch |  73 +++
 ...ot-use-cmake-infra-to-detect-libzstd.patch |  62 +++
 ...t-Fix-stat-struct-s-size-for-O32-ABI.patch |  44 ++
 ...f-_TIME_BITS-along-with-_FILE_OFFSET.patch |  43 ++
 ....cpp-ARMLibDirs-search-also-in-lib32.patch |  81 +++
 ...d-OE-specific-ABI-triple-for-N32-ABI.patch |  78 +++
 ...unwind.pc.in-and-llvm-config-scripts.patch |  90 ++++
 ...spect-LLVM_LIBDIR_SUFFIX-like-other-.patch |  92 ++++
 meta/recipes-devtools/clang/clang_git.bb      | 463 ++++++++++++++++++
 meta/recipes-devtools/clang/common-source.inc |  17 +
 meta/recipes-devtools/clang/common.inc        |  66 +++
 .../clang/compiler-rt-sanitizers_git.bb       | 123 +++++
 .../recipes-devtools/clang/compiler-rt_git.bb | 126 +++++
 meta/recipes-devtools/clang/libclc_git.bb     |  36 ++
 meta/recipes-devtools/clang/libcxx_git.bb     | 115 +++++
 .../clang/llvm-project-source.bb              |  12 +
 .../clang/llvm-project-source.inc             |  99 ++++
 .../clang/nativesdk-clang-glue.bb             |  36 ++
 meta/recipes-devtools/clang/openmp_git.bb     |  65 +++
 49 files changed, 3506 insertions(+)
 create mode 100644 meta/recipes-devtools/clang/clang-cross-canadian_git.bb
 create mode 100644 meta/recipes-devtools/clang/clang-cross_git.bb
 create mode 100644 meta/recipes-devtools/clang/clang-crosssdk_git.bb
 create mode 100644 meta/recipes-devtools/clang/clang.inc
 create mode 100644 meta/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0014-cmake-Fix-configure-for-packages-using-find_package.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0017-clang-Use-python3-in-python-scripts.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0018-For-x86_64-set-Yocto-based-GCC-install-search-path.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0019-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0020-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0021-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0022-libunwind-Added-unw_backtrace-method.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0023-clang-Do-not-use-install-relative-libc-headers.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0024-Fix-lib-paths-for-OpenEmbedded-Host.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0025-Correct-library-search-path-for-OpenEmbedded-Host.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0026-lldb-Link-with-libatomic-on-x86.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0027-compiler-rt-Enable-__int128-for-ppc32.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0028-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0029-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0030-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0031-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0032-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0033-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch
 create mode 100644 meta/recipes-devtools/clang/clang/0034-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch
 create mode 100644 meta/recipes-devtools/clang/clang_git.bb
 create mode 100644 meta/recipes-devtools/clang/common-source.inc
 create mode 100644 meta/recipes-devtools/clang/common.inc
 create mode 100644 meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb
 create mode 100644 meta/recipes-devtools/clang/compiler-rt_git.bb
 create mode 100644 meta/recipes-devtools/clang/libclc_git.bb
 create mode 100644 meta/recipes-devtools/clang/libcxx_git.bb
 create mode 100644 meta/recipes-devtools/clang/llvm-project-source.bb
 create mode 100644 meta/recipes-devtools/clang/llvm-project-source.inc
 create mode 100644 meta/recipes-devtools/clang/nativesdk-clang-glue.bb
 create mode 100644 meta/recipes-devtools/clang/openmp_git.bb
meta/recipes-devtools/clang/clang-cross-canadian_git.bb new file +36 -0
new file mode 100644
index 00000000000..33c33c4d443
@@ -0,0 +1,36 @@
+# Copyright (C) 2014 Khem Raj <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "Clang/LLVM based C/C++ compiler (cross-canadian for ${TARGET_ARCH} target)"
+HOMEPAGE = "http://clang.llvm.org/"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab"
+SECTION = "devel"
+
+PN = "clang-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+
+require clang.inc
+require common-source.inc
+inherit cross-canadian
+
+DEPENDS += "nativesdk-clang binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} virtual/${HOST_PREFIX}binutils virtual/nativesdk-libc"
+# We have to point gcc at a sysroot but we don't need to rebuild if this changes
+# e.g. we switch between different machines with different tunes.
+EXTRA_OECONF_PATHS[vardepsexclude] = "TUNE_PKGARCH"
+TARGET_ARCH[vardepsexclude] = "TUNE_ARCH"
+
+do_install() {
+        install -d ${D}${bindir}
+	for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata \
+            llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \
+            llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov
+	do
+		ln -sf ../$tool ${D}${bindir}/${TARGET_PREFIX}$tool
+	done
+}
+SSTATE_SCAN_FILES += "*-clang *-clang++ *-llvm-profdata *-llvm-ar \
+                      *-llvm-ranlib *-llvm-nm *-lld *-ld.lld *-llvm-as *-llvm-strip \
+                      *-llvm-objcopy *-llvm-objdump *-llvm-readelf *-llvm-addr2line \
+                      *-llvm-dwp *-llvm-size *-llvm-strings *-llvm-cov"
+do_install:append() {
+        cross_canadian_bindirlinks
+}
meta/recipes-devtools/clang/clang-cross_git.bb new file +35 -0
new file mode 100644
index 00000000000..8aee5cd8628
@@ -0,0 +1,35 @@
+# Copyright (C) 2014 Khem Raj <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "Cross compiler wrappers for LLVM based C/C++ compiler"
+HOMEPAGE = "http://clang.llvm.org/"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab"
+SECTION = "devel"
+
+PN = "clang-cross-${TARGET_ARCH}"
+
+require clang.inc
+require common-source.inc
+inherit cross
+DEPENDS += "clang-native virtual/${TARGET_PREFIX}binutils"
+
+do_install() {
+        install -d ${D}${bindir}
+	for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata \
+            llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \
+            llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov
+	do
+		ln -sf ../$tool ${D}${bindir}/${TARGET_PREFIX}$tool
+	done
+}
+SSTATE_SCAN_FILES += "*-clang *-clang++ *-llvm-profdata *-lld *-ld.lld \
+                      *-llvm-nm *-llvm-ar *-llvm-as *-llvm-ranlib *-llvm-strip \
+                      *-llvm-objcopy *-llvm-objdump *-llvm-readelf *-llvm-addr2line \
+                      *-llvm-dwp *-llvm-size *-llvm-strings *-llvm-cov"
+
+SYSROOT_PREPROCESS_FUNCS += "clangcross_sysroot_preprocess"
+
+clangcross_sysroot_preprocess () {
+        sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir}
+}
+PACKAGES = ""
meta/recipes-devtools/clang/clang-crosssdk_git.bb new file +34 -0
new file mode 100644
index 00000000000..e4b521d0d23
@@ -0,0 +1,34 @@
+# Copyright (C) 2014 Khem Raj <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "SDK Cross compiler wrappers for LLVM based C/C++ compiler"
+HOMEPAGE = "http://clang.llvm.org/"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab"
+SECTION = "devel"
+
+PN = "clang-crosssdk-${SDK_SYS}"
+
+require clang.inc
+require common-source.inc
+inherit crosssdk
+DEPENDS += "clang-native nativesdk-clang-glue virtual/${TARGET_PREFIX}binutils virtual/nativesdk-libc"
+
+do_install() {
+        install -d ${D}${bindir}
+	for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata \
+            llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \
+            llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov
+	do
+		ln -sf ../$tool ${D}${bindir}/${TARGET_PREFIX}$tool
+	done
+}
+SSTATE_SCAN_FILES += "*-clang *-clang++ *-llvm-profdata *-lld *-ld.lld \
+                      *-llvm-nm *-llvm-ar *-llvm-as *-llvm-ranlib *-llvm-strip \
+                      *-llvm-objcopy *-llvm-objdump *-llvm-readelf *-llvm-addr2line \
+                      *-llvm-dwp *-llvm-size *-llvm-strings *-llvm-cov"
+sysroot_stage_all () {
+        sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir}
+}
+
+PACKAGES = ""
+
meta/recipes-devtools/clang/clang.inc new file +24 -0
new file mode 100644
index 00000000000..3005acc7dd1
@@ -0,0 +1,24 @@
+LLVM_RELEASE = ""
+LLVM_DIR = "llvm${LLVM_RELEASE}"
+
+LLVM_HTTP ?= "https://github.com/llvm"
+
+MAJOR_VER = "19"
+MINOR_VER = "1"
+PATCH_VER = "3"
+# could be 'rcX' or 'git' or empty ( for release )
+VER_SUFFIX = ""
+
+PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}${VER_SUFFIX}"
+
+LLVMMD5SUM = "8a15a0759ef07f2682d2ba4b893c9afe"
+CLANGMD5SUM = "ff42885ed2ab98f1ecb8c1fc41205343"
+LLDMD5SUM = "ae7dc7c027b1fa89b5b013d391d3ee2b"
+LLDBMD5SUM = "2e0d44968471fcde980034dbb826bea9"
+
+LLVM_LIBDIR_SUFFIX="${@d.getVar('baselib').replace('lib', '')}"
+
+# set the default pigz thread
+export PIGZ = "-p ${@oe.utils.cpu_count(at_least=2)}"
+
+require common.inc
meta/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch new file +60 -0

60 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch new file +309 -0

309 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch new file +44 -0

44 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch new file +90 -0

90 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch new file +71 -0

71 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch new file +75 -0

75 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch new file +32 -0
new file mode 100644
index 00000000000..fc46b3ca1b1
@@ -0,0 +1,32 @@
+From 7875b568926bbec5b7e3312c55991723c917493e Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 19 May 2016 21:11:06 -0700
+Subject: [PATCH] clang: Driver/tools.cpp: Add -lssp_nonshared on musl
+
+musl driver will need to add ssp_nonshared for stack_check_local
+on the linker cmdline when using stack protector commands on
+compiler cmdline
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ clang/lib/Driver/ToolChains/Gnu.cpp | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
+index 5e9a655eaf82..3e301f2e1d95 100644
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -632,6 +632,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
+       if (IsIAMCU)
+         CmdArgs.push_back("-lgloss");
+ 
++      if (ToolChain.getTriple().isMusl() &&
++          (Args.hasArg(options::OPT_fstack_protector) ||
++          Args.hasArg(options::OPT_fstack_protector_strong) ||
++          Args.hasArg(options::OPT_fstack_protector_all))) {
++        CmdArgs.push_back("-lssp_nonshared");
++      }
+       if (IsStatic || IsStaticPIE)
+         CmdArgs.push_back("--end-group");
+       else
meta/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch new file +39 -0
new file mode 100644
index 00000000000..f21be08e2a2
@@ -0,0 +1,39 @@
+From 84c1650cac223a4578eb43c905fdfb30b617274e Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 16 Mar 2017 09:02:13 -0700
+Subject: [PATCH] clang: Prepend trailing '/' to sysroot
+
+This is needed to handle a case where clang
+isntall and target sysroot are perilously same
+
+e.g.
+
+sysroot = /mnt/clang/recipe-sysroot
+clang install = /mnt/clang/recipe-sysroot-native
+
+in this case it will mistakenly assume that
+clang is installed under the same sysroot dir
+and it will try to add relative ../lib paths
+to linker steps which would then be wrong
+since they will become relative to clang
+installation and not sysroot
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ clang/lib/Driver/ToolChains/Linux.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
+index e4f593e462d6..720bc136528b 100644
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -222,7 +222,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+   Multilibs = GCCInstallation.getMultilibs();
+   SelectedMultilibs.assign({GCCInstallation.getMultilib()});
+   llvm::Triple::ArchType Arch = Triple.getArch();
+-  std::string SysRoot = computeSysRoot();
++  std::string SysRoot = computeSysRoot() + "/";
+   ToolChain::path_list &PPaths = getProgramPaths();
+ 
+   Generic_GCC::PushPPaths(PPaths);
meta/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch new file +41 -0

41 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch new file +47 -0

47 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch new file +35 -0
new file mode 100644
index 00000000000..b5712d6b690
@@ -0,0 +1,35 @@
+From 08b05e4e835b6cb73c844e300dcc4eb4919d8154 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 31 Jul 2019 22:51:39 -0700
+Subject: [PATCH] clang: Add -lpthread and -ldl along with -lunwind for static
+ linking
+
+When doing static liking with --unwindlib=libunwind -static we encounter
+undefined symbols
+libunwind/src/RWMutex.hpp:68: undefined reference to `pthread_rwlock_wrlock'
+
+and
+
+libunwind/src/AddressSpace.hpp:597: undefined reference to `dladdr'
+
+therefore we need to link in libpthread and libdl to fill these symbols
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ clang/lib/Driver/ToolChains/CommonArgs.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
+index 019df16a909f..00d608c0c095 100644
+--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
++++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
+@@ -2183,6 +2183,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D,
+         CmdArgs.push_back("-lunwind");
+     } else if (LGT == LibGccType::StaticLibGcc) {
+       CmdArgs.push_back("-l:libunwind.a");
++      CmdArgs.push_back("-lpthread");
++      CmdArgs.push_back("-ldl");
+     } else if (LGT == LibGccType::SharedLibGcc) {
+       if (TC.getTriple().isOSCygMing())
+         CmdArgs.push_back("-l:libunwind.dll.a");
meta/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch new file +24 -0
new file mode 100644
index 00000000000..2086e0ad2f2
@@ -0,0 +1,24 @@
+From 322385b4a6109f3f53c3679d7a276ec0084dd7b6 Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <[email protected]>
+Date: Thu, 26 Dec 2019 12:56:16 -0800
+Subject: [PATCH] Pass PYTHON_EXECUTABLE when cross compiling for native build
+
+Upstream-Status: Pending
+Signed-off-by: Anuj Mittal <[email protected]>
+Signed-off-by: Khem Raj <[email protected]>
+---
+ llvm/cmake/modules/CrossCompile.cmake | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake
+index 39b4abaa0d93..a47afde7f85d 100644
+--- a/llvm/cmake/modules/CrossCompile.cmake
++++ b/llvm/cmake/modules/CrossCompile.cmake
+@@ -92,6 +92,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype)
+         -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}"
+         -DLLVM_INCLUDE_BENCHMARKS=OFF
+         -DLLVM_INCLUDE_TESTS=OFF
++        -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}"
+         ${build_type_flags} ${linker_flag} ${external_clang_dir} ${libc_flags}
+         ${ARGN}
+     WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD}
meta/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch new file +34 -0
new file mode 100644
index 00000000000..6db24a941a6
@@ -0,0 +1,34 @@
+From 2f41e0721f964677e8876b2c2f540836f426c83f Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Mon, 18 Nov 2019 17:00:29 -0800
+Subject: [PATCH] Check for atomic<double> intrinsics
+
+On some architectures e.g. x86/32bit gcc decides to inline calls to
+double atomic variables but clang does not and defers it to libatomic
+therefore detect if clang can use built-ins for atomic<double> if not
+then link libatomic, this helps building clangd for x86 on linux systems
+with gcc runtime
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ llvm/cmake/modules/CheckAtomic.cmake | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/llvm/cmake/modules/CheckAtomic.cmake b/llvm/cmake/modules/CheckAtomic.cmake
+index f11cadf39ff6..80a18a92956a 100644
+--- a/llvm/cmake/modules/CheckAtomic.cmake
++++ b/llvm/cmake/modules/CheckAtomic.cmake
+@@ -30,10 +30,11 @@ function(check_working_cxx_atomics64 varname)
+ #include <atomic>
+ #include <cstdint>
+ std::atomic<uint64_t> x (0);
++std::atomic<double> y (0);
+ int main() {
+   uint64_t i = x.load(std::memory_order_relaxed);
+   (void)i;
+-  return 0;
++  return int(y);
+ }
+ " ${varname})
+   set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
meta/recipes-devtools/clang/clang/0014-cmake-Fix-configure-for-packages-using-find_package.patch new file +115 -0

115 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch new file +42 -0

42 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch new file +79 -0

79 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0017-clang-Use-python3-in-python-scripts.patch new file +35 -0
new file mode 100644
index 00000000000..2631ba76933
@@ -0,0 +1,35 @@
+From 42acc8d6b252851b3f3cdae08bd9e1ed5a9c8935 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 14 Oct 2020 22:19:57 -0700
+Subject: [PATCH] clang: Use python3 in python scripts
+
+Some scripts ask for python, but they work fine with python3
+and in OE python symlink is not exposed to build, only python3 is
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ .../find-all-symbols/tool/run-find-all-symbols.py               | 2 +-
+ clang/tools/scan-view/bin/scan-view                             | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
+index 471dbf8c110b..f98385dc6651 100755
+--- a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
++++ b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ #
+ # =- run-find-all-symbols.py - Parallel find-all-symbols runner -*- python  -*-=#
+ #
+diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view
+index d01aebb4029a..f3375804654d 100755
+--- a/clang/tools/scan-view/bin/scan-view
++++ b/clang/tools/scan-view/bin/scan-view
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ 
+ from __future__ import print_function
+ 
meta/recipes-devtools/clang/clang/0018-For-x86_64-set-Yocto-based-GCC-install-search-path.patch new file +70 -0

70 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0019-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch new file +32 -0
new file mode 100644
index 00000000000..06b8ffd1705
@@ -0,0 +1,32 @@
+From a1ae883e90cb9554e10d24277a955fb0660e85a1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 11 Feb 2021 16:42:49 -0800
+Subject: [PATCH] llvm: Insert anchor for adding OE distro vendor names
+
+This helps in making right detection for OE built gcc toolchains
+
+The //CLANG_EXTRA_OE_VENDORS_CASES string is replaced with list of
+additional Ceses based on CLANG_EXTRA_OE_VENDORS variable in
+recipes-devtools/clang/llvm-project-source.inc:add_distro_vendor()
+
+Upstream-Status: Inappropriate [OE-specific]
+
+Signed-off-by: Khem Raj <[email protected]>
+Signed-off-by: Martin Jansa <[email protected]>
+---
+ llvm/lib/TargetParser/Triple.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp
+index 21d6c74b5956..32adf92c47bf 100644
+--- a/llvm/lib/TargetParser/Triple.cpp
++++ b/llvm/lib/TargetParser/Triple.cpp
+@@ -639,7 +639,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
+     .Case("amd", Triple::AMD)
+     .Case("mesa", Triple::Mesa)
+     .Case("suse", Triple::SUSE)
+-    .Case("oe", Triple::OpenEmbedded)
++    .Case("oe", Triple::OpenEmbedded)//CLANG_EXTRA_OE_VENDORS_CASES
+     .Default(Triple::UnknownVendor);
+ }
+ 
meta/recipes-devtools/clang/clang/0020-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch new file +68 -0

68 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0021-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch new file +28 -0
new file mode 100644
index 00000000000..b33a9f4c592
@@ -0,0 +1,28 @@
+From 9a336eeaa8f8d62057802a98e249df695befa6b6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 19 May 2021 17:56:03 -0700
+Subject: [PATCH] clang: Fix x86 triple for non-debian multiarch linux distros
+
+OpenEmbedded does not hardcode mutli-arch like debian therefore ensure
+that it still uses the proper tuple
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ clang/lib/Driver/ToolChains/Linux.cpp | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
+index b3a399187ec3..f39c771798a8 100644
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -715,6 +715,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
+       GCCInstallation.getTriple().getArch() == llvm::Triple::x86
+           ? "i386-linux-gnu"
+           : TripleStr;
++  // OpenEmbedded does not hardcode the triple to i386-linux-gnu like debian
++  if (GCCInstallation.getTriple().getVendor() == llvm::Triple::OpenEmbedded)
++	  DebianMultiarch = TripleStr;
+ 
+   // Try generic GCC detection first.
+   if (Generic_GCC::addGCCLibStdCxxIncludePaths(DriverArgs, CC1Args,
meta/recipes-devtools/clang/clang/0022-libunwind-Added-unw_backtrace-method.patch new file +56 -0

56 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0023-clang-Do-not-use-install-relative-libc-headers.patch new file +34 -0
new file mode 100644
index 00000000000..bac9d105c18
@@ -0,0 +1,34 @@
+From 081655795d08178e20bcfbaef5dab4a97230f095 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 11 Aug 2021 18:37:11 -0700
+Subject: [PATCH] clang: Do not use install relative libc++ headers
+
+In OE we use same clang for native and cross builds, therefore we need
+to ensure that native sysroot install of libc++ is not searched for
+headers when doing cross compile instead it searches the target sysroot
+this is especially troublesome when libcxx-native is staged along with
+libcxx e.g. chromium
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ clang/lib/Driver/ToolChains/Gnu.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
+index e05dd30c3f89..d9efd09d9da6 100644
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -3316,8 +3316,11 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
+   // incompatible with the NDK libraries.
+   SmallString<128> DriverIncludeDir(getDriver().Dir);
+   llvm::sys::path::append(DriverIncludeDir, "..", "include");
++
++  // do not add it when --sysroot is specified, since it would expect
++  // libc++ headers from sysroot and not relative to compiler install location
+   if (AddIncludePath(DriverIncludeDir,
+-                     /*TargetDirRequired=*/getTriple().isAndroid()))
++                     /*TargetDirRequired=*/getTriple().isAndroid() | !computeSysRoot().empty()))
+     return;
+   // If this is a development, non-installed, clang, libcxx will
+   // not be found at ../include/c++ but it likely to be found at
meta/recipes-devtools/clang/clang/0024-Fix-lib-paths-for-OpenEmbedded-Host.patch new file +79 -0

79 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0025-Correct-library-search-path-for-OpenEmbedded-Host.patch new file +84 -0

84 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0026-lldb-Link-with-libatomic-on-x86.patch new file +33 -0
new file mode 100644
index 00000000000..275a7c68381
@@ -0,0 +1,33 @@
+From d395cc2696d62d7d3448bc9a90f7697cf60e6273 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 8 Feb 2022 01:31:26 -0800
+Subject: [PATCH] lldb: Link with libatomic on x86
+
+cmake atomic check is not sufficient for i686 target where clang14 still
+generates __atomic_store calls but the check does not entail this
+function and happily thinks that compiler can resolve all atomic via intrinsics
+on i686, but thats not the case, ideally the check for determining
+atomic operation should be make more robust but until then lets ask to
+link with libatomic on i686/linux
+
+Upstream-Status: Inappropriate [OE-Specific]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ lldb/source/Utility/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt
+index e9954d66cd1a..f36f1c9e9d28 100644
+--- a/lldb/source/Utility/CMakeLists.txt
++++ b/lldb/source/Utility/CMakeLists.txt
+@@ -19,6 +19,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows")
+   list(APPEND LLDB_SYSTEM_LIBS ws2_32 rpcrt4)
+ endif ()
+ 
++if (CMAKE_SYSTEM_PROCESSOR MATCHES "i686" AND CMAKE_SYSTEM_NAME MATCHES "Linux")
++    list(APPEND LLDB_SYSTEM_LIBS atomic)
++endif()
++
+ if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB )
+     list(APPEND LLDB_SYSTEM_LIBS atomic)
+ endif()
meta/recipes-devtools/clang/clang/0027-compiler-rt-Enable-__int128-for-ppc32.patch new file +73 -0

73 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0028-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch new file +62 -0

62 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0029-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch new file +44 -0

44 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0030-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch new file +43 -0

43 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0031-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch new file +81 -0

81 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0032-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch new file +78 -0

78 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0033-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch new file +90 -0

90 lines not on this page · raw message

meta/recipes-devtools/clang/clang/0034-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch new file +92 -0

92 lines not on this page · raw message

meta/recipes-devtools/clang/clang_git.bb new file +463 -0

463 lines not on this page · raw message

meta/recipes-devtools/clang/common-source.inc new file +17 -0
new file mode 100644
index 00000000000..d8a0f68175c
@@ -0,0 +1,17 @@
+do_fetch() {
+        :
+}
+do_fetch[noexec] = "1"
+deltask do_unpack
+deltask do_patch
+
+SRC_URI = ""
+
+do_configure[depends] += "llvm-project-source-${PV}:do_preconfigure"
+do_populate_lic[depends] += "llvm-project-source-${PV}:do_unpack"
+do_create_spdx[depends] += "llvm-project-source-${PV}:do_preconfigure"
+
+# spdx shared workdir detection fails as not WORKDIR is altered but S and B
+# return always true to fix that
+def is_work_shared_spdx(d):
+    return True
meta/recipes-devtools/clang/common.inc new file +66 -0

66 lines not on this page · raw message

meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb new file +123 -0

106 lines not on this page · raw message

meta/recipes-devtools/clang/compiler-rt_git.bb new file +126 -0

126 lines not on this page · raw message

meta/recipes-devtools/clang/libclc_git.bb new file +36 -0
new file mode 100644
index 00000000000..16ab8332138

Lines of this file are not shown. View the raw message.

meta/recipes-devtools/clang/libcxx_git.bb new file +115 -0

115 lines not on this page · raw message

meta/recipes-devtools/clang/llvm-project-source.bb new file +12 -0
new file mode 100644
index 00000000000..c1cd8877ab8

Lines of this file are not shown. View the raw message.

meta/recipes-devtools/clang/llvm-project-source.inc new file +99 -0

99 lines not on this page · raw message

meta/recipes-devtools/clang/nativesdk-clang-glue.bb new file +36 -0
new file mode 100644
index 00000000000..a0b93740845

Lines of this file are not shown. View the raw message.

meta/recipes-devtools/clang/openmp_git.bb new file +65 -0

65 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

#9 lore raw

Re: [OE-core] [PATCH 07/19] clang: Migrate clang and related recipes from meta-clang

Quoted 97 lines · Khem Raj via lists.openembedded.org

This includes compiler, tools and runtime libraries, they are brought in together to avoid major rehashing due to their interdependence.

---
 .../clang/clang-cross-canadian_git.bb         |  36 ++ .../recipes-devtools/clang/clang-cross_git.bb |  35 ++ .../clang/clang-crosssdk_git.bb               |  34 ++ meta/recipes-devtools/clang/clang.inc         |  24 +

 ...ibunwind-headers-when-LIBCXXABI_LIBU.patch |  60 +++
 ...-support-a-new-embedded-linux-target.patch | 309 ++++++++++++
 ...lify-cross-compilation.-Don-t-use-na.patch |  44 ++
 ...ryInfo-Undefine-libc-functions-if-th.patch |  90 ++++
 ...-env-override-of-exe-and-libdir-path.patch |  71 +++
 ...g-driver-Check-sysroot-for-ldso-path.patch |  75 +++
 ...tools.cpp-Add-lssp_nonshared-on-musl.patch |  32 ++
 ...08-clang-Prepend-trailing-to-sysroot.patch |  39 ++
 ...e-the-target-sysroot-for-compiler-ru.patch |  41 ++
 ...efine-releative-gcc-installation-dir.patch |  47 ++
 ...ad-and-ldl-along-with-lunwind-for-st.patch |  35 ++
 ...UTABLE-when-cross-compiling-for-nati.patch |  24 +
 ...3-Check-for-atomic-double-intrinsics.patch |  34 ++
 ...gure-for-packages-using-find_package.patch | 115 +++++
 ...ce-dir-location-for-cross-toolchains.patch |  42 ++
 ...-dyld-prefix-when-checking-sysroot-f.patch |  79 +++
 ...-clang-Use-python3-in-python-scripts.patch |  35 ++
 ...-Yocto-based-GCC-install-search-path.patch |  70 +++
 ...or-for-adding-OE-distro-vendor-names.patch |  32 ++
 ...ot-use-backtrace-APIs-on-non-glibc-l.patch |  68 +++
 ...iple-for-non-debian-multiarch-linux-.patch |  28 ++
 ...libunwind-Added-unw_backtrace-method.patch |  56 +++
 ...ot-use-install-relative-libc-headers.patch |  34 ++
 ...-Fix-lib-paths-for-OpenEmbedded-Host.patch |  79 +++
 ...ry-search-path-for-OpenEmbedded-Host.patch |  84 ++++
 ...0026-lldb-Link-with-libatomic-on-x86.patch |  33 ++
 ...ompiler-rt-Enable-__int128-for-ppc32.patch |  73 +++
 ...ot-use-cmake-infra-to-detect-libzstd.patch |  62 +++
 ...t-Fix-stat-struct-s-size-for-O32-ABI.patch |  44 ++
 ...f-_TIME_BITS-along-with-_FILE_OFFSET.patch |  43 ++
 ....cpp-ARMLibDirs-search-also-in-lib32.patch |  81 +++
 ...d-OE-specific-ABI-triple-for-N32-ABI.patch |  78 +++
 ...unwind.pc.in-and-llvm-config-scripts.patch |  90 ++++
 ...spect-LLVM_LIBDIR_SUFFIX-like-other-.patch |  92 ++++

 meta/recipes-devtools/clang/clang_git.bb      | 463 ++++++++++++++++++ meta/recipes-devtools/clang/common-source.inc |  17 + meta/recipes-devtools/clang/common.inc        |  66 +++ .../clang/compiler-rt-sanitizers_git.bb       | 123 +++++ .../recipes-devtools/clang/compiler-rt_git.bb | 126 +++++ meta/recipes-devtools/clang/libclc_git.bb     |  36 ++ meta/recipes-devtools/clang/libcxx_git.bb     | 115 +++++ .../clang/llvm-project-source.bb              |  12 + .../clang/llvm-project-source.inc             |  99 ++++ .../clang/nativesdk-clang-glue.bb             |  36 ++ meta/recipes-devtools/clang/openmp_git.bb     |  65 +++

 49 files changed, 3506 insertions(+)

 create mode 100644 meta/recipes-devtools/clang/clang-cross-canadian_git.bb
 create mode 100644 meta/recipes-devtools/clang/clang-cross_git.bb
 create mode 100644 meta/recipes-devtools/clang/clang-crosssdk_git.bb
 create mode 100644 meta/recipes-devtools/clang/clang.inc
 create mode 100644 meta/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch create mode 100644 meta/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch create mode 100644 meta/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch create mode 100644 meta/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch create mode 100644 meta/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch create mode 100644 meta/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch create mode 100644 meta/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch create mode 100644 meta/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch create mode 100644 meta/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch create mode 100644 meta/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch create mode 100644 meta/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch create mode 100644 meta/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch create mode 100644 meta/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch create mode 100644 meta/recipes-devtools/clang/clang/0014-cmake-Fix-configure-for-packages-using-find_package.patch create mode 100644 meta/recipes-devtools/clang/clang/0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch create mode 100644 meta/recipes-devtools/clang/clang/0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch create mode 100644 meta/recipes-devtools/clang/clang/0017-clang-Use-python3-in-python-scripts.patch create mode 100644 meta/recipes-devtools/clang/clang/0018-For-x86_64-set-Yocto-based-GCC-install-search-path.patch create mode 100644 meta/recipes-devtools/clang/clang/0019-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch create mode 100644 meta/recipes-devtools/clang/clang/0020-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch create mode 100644 meta/recipes-devtools/clang/clang/0021-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch create mode 100644 meta/recipes-devtools/clang/clang/0022-libunwind-Added-unw_backtrace-method.patch create mode 100644 meta/recipes-devtools/clang/clang/0023-clang-Do-not-use-install-relative-libc-headers.patch create mode 100644 meta/recipes-devtools/clang/clang/0024-Fix-lib-paths-for-OpenEmbedded-Host.patch create mode 100644 meta/recipes-devtools/clang/clang/0025-Correct-library-search-path-for-OpenEmbedded-Host.patch create mode 100644 meta/recipes-devtools/clang/clang/0026-lldb-Link-with-libatomic-on-x86.patch create mode 100644 meta/recipes-devtools/clang/clang/0027-compiler-rt-Enable-__int128-for-ppc32.patch create mode 100644 meta/recipes-devtools/clang/clang/0028-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch create mode 100644 meta/recipes-devtools/clang/clang/0029-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch create mode 100644 meta/recipes-devtools/clang/clang/0030-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch create mode 100644 meta/recipes-devtools/clang/clang/0031-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch create mode 100644 meta/recipes-devtools/clang/clang/0032-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch create mode 100644 meta/recipes-devtools/clang/clang/0033-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch create mode 100644 meta/recipes-devtools/clang/clang/0034-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch create mode 100644 meta/recipes-devtools/clang/clang_git.bb
 create mode 100644 meta/recipes-devtools/clang/common-source.inc
 create mode 100644 meta/recipes-devtools/clang/common.inc

Quoted 8 lines

 create mode 100644 meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb create mode 100644 meta/recipes-devtools/clang/compiler-rt_git.bb create mode 100644 meta/recipes-devtools/clang/libclc_git.bb create mode 100644 meta/recipes-devtools/clang/libcxx_git.bb create mode 100644 meta/recipes-devtools/clang/llvm-project-source.bb create mode 100644 meta/recipes-devtools/clang/llvm-project-source.inc create mode 100644 meta/recipes-devtools/clang/nativesdk-clang-glue.bb create mode 100644 meta/recipes-devtools/clang/openmp_git.bb

One of the first questions that will be asked are what is the status/plan for the 34 patches here? Can we update the patch descriptions and status to be better than "Pending"? I'd like ideally like a plan about how we could engage with upstream to reduce this queue. I have made an effort to clean up the gcc ones and others in core.

Cheers,

Richard

author
#10 lore raw

PATCH 8/19 clang/recipes: Add missing SUMMARY field

In reply to Khem Raj

Enhance description while here

---
 .../clang/clang-cross-canadian_git.bb                 |  2 +-
 meta/recipes-devtools/clang/clang-cross_git.bb        |  2 +-
 meta/recipes-devtools/clang/clang-crosssdk_git.bb     |  2 +-
 meta/recipes-devtools/clang/clang_git.bb              | 11 ++++++++++-
 .../clang/compiler-rt-sanitizers_git.bb               |  4 +++-
 meta/recipes-devtools/clang/compiler-rt_git.bb        |  6 +++++-
 meta/recipes-devtools/clang/libclc_git.bb             |  2 +-
 meta/recipes-devtools/clang/libcxx_git.bb             |  2 +-
 meta/recipes-devtools/clang/nativesdk-clang-glue.bb   |  2 +-
 meta/recipes-devtools/clang/openmp_git.bb             |  2 +-
 10 files changed, 25 insertions(+), 10 deletions(-)
meta/recipes-devtools/clang/clang-cross-canadian_git.bb +1 -1
index 33c33c4d443..f327a1275e7 100644
@@ -1,7 +1,7 @@
 # Copyright (C) 2014 Khem Raj <[email protected]>
 # Released under the MIT license (see COPYING.MIT for the terms)
 
-DESCRIPTION = "Clang/LLVM based C/C++ compiler (cross-canadian for ${TARGET_ARCH} target)"
+SUMMARY = "Clang/LLVM based C/C++ compiler (cross-canadian for ${TARGET_ARCH} target)"
 HOMEPAGE = "http://clang.llvm.org/"
 LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab"
 SECTION = "devel"
meta/recipes-devtools/clang/clang-cross_git.bb +1 -1
index 8aee5cd8628..a0c215e4dfb 100644
@@ -1,7 +1,7 @@
 # Copyright (C) 2014 Khem Raj <[email protected]>
 # Released under the MIT license (see COPYING.MIT for the terms)
 
-DESCRIPTION = "Cross compiler wrappers for LLVM based C/C++ compiler"
+SUMMARY = "Cross compiler wrappers for LLVM based C/C++ compiler"
 HOMEPAGE = "http://clang.llvm.org/"
 LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab"
 SECTION = "devel"
meta/recipes-devtools/clang/clang-crosssdk_git.bb +1 -1
index e4b521d0d23..913c49ac740 100644
@@ -1,7 +1,7 @@
 # Copyright (C) 2014 Khem Raj <[email protected]>
 # Released under the MIT license (see COPYING.MIT for the terms)
 
-DESCRIPTION = "SDK Cross compiler wrappers for LLVM based C/C++ compiler"
+SUMMARY = "SDK Cross compiler wrappers for LLVM based C/C++ compiler"
 HOMEPAGE = "http://clang.llvm.org/"
 LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab"
 SECTION = "devel"
meta/recipes-devtools/clang/clang_git.bb +10 -1
index c2b6f272d8f..1ad40f2fcff 100644
@@ -1,7 +1,16 @@
 # Copyright (C) 2014 Khem Raj <[email protected]>
 # Released under the MIT license (see COPYING.MIT for the terms)
 
-DESCRIPTION = "LLVM based C/C++ compiler"
+SUMMARY = "LLVM based C/C++ compiler"
+DESCRIPTION = "Clang is an LLVM based C/C++/Objective-C compiler, \
+                which aims to deliver amazingly fast compiles, \
+                extremely useful error and warning messages and \
+                to provide a platform for building great source \
+                level tools. The Clang Static Analyzer and \
+                clang-tidy are tools that automatically find bugs \
+                in your code, and are great examples of the sort \
+                of tools that can be built using the Clang frontend \
+                as a library to parse C/C++ code"
 HOMEPAGE = "http://clang.llvm.org/"
 SECTION = "devel"
 
meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb +3 -1
index db484683af4..acd5516a8d1 100644
@@ -1,7 +1,9 @@
 # Copyright (C) 2021 Khem Raj <[email protected]>
 # Released under the MIT license (see COPYING.MIT for the terms)
 
-DESCRIPTION = "LLVM based C/C++ compiler Runtime"
+SUMMARY = "LLVM based C/C++ compiler Sanitizers Runtime"
+DESCRIPTION = "Runtime libraries that are required \
+				to run the code with sanitizer instrumentation"
 HOMEPAGE = "http://compiler-rt.llvm.org/"
 SECTION = "base"
 
meta/recipes-devtools/clang/compiler-rt_git.bb +5 -1
index a6f6db3cc73..080e53b93d5 100644
@@ -1,7 +1,11 @@
 # Copyright (C) 2015 Khem Raj <[email protected]>
 # Released under the MIT license (see COPYING.MIT for the terms)
 
-DESCRIPTION = "LLVM based C/C++ compiler Runtime"
+SUMMARY = "LLVM based C/C++ compiler Runtime"
+DESCRIPTIOM = "Simple builtin library that provides an \
+				implementation of the low-level target-specific \
+				hooks required by code generation and other runtime \
+				components"
 HOMEPAGE = "http://compiler-rt.llvm.org/"
 SECTION = "base"
 
meta/recipes-devtools/clang/libclc_git.bb +1 -1
index 16ab8332138..0d43133281f 100644
@@ -1,4 +1,4 @@
-DESCRIPTION = "LLVM based OpenCL runtime support library"
+SUMMARY = "Implementation of the library requirements of the OpenCL 1.1+ C programming language"
 HOMEPAGE = "http://libclc.llvm.org/"
 SECTION = "libs"
 
meta/recipes-devtools/clang/libcxx_git.bb +1 -1
index a2a67880a8b..c7f3a77ca94 100644
@@ -1,7 +1,7 @@
 # Copyright (C) 2015 Khem Raj <[email protected]>
 # Released under the MIT license (see COPYING.MIT for the terms)
 
-DESCRIPTION = "libc++ is a new implementation of the C++ standard library, targeting C++11"
+SUMMARY = "libc++ is a new implementation of the C++ standard library, targeting C++11 and above"
 HOMEPAGE = "http://libcxx.llvm.org/"
 SECTION = "base"
 
meta/recipes-devtools/clang/nativesdk-clang-glue.bb +1 -1
index a0b93740845..8e5622f6c18 100644
@@ -1,7 +1,7 @@
 # Copyright (C) 2014 Khem Raj <[email protected]>
 # Released under the MIT license (see COPYING.MIT for the terms)
 
-DESCRIPTION = "SDK Cross compiler wrappers for LLVM based C/C++ compiler"
+SUMMARY = "SDK Cross compiler wrappers for LLVM based C/C++ compiler"
 HOMEPAGE = "http://clang.llvm.org/"
 LICENSE = "Apache-2.0-with-LLVM-exception"
 LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab"
meta/recipes-devtools/clang/openmp_git.bb +1 -1
index 34f6e4ab9e5..549df0e7684 100644
@@ -1,7 +1,7 @@
 # Copyright (C) 2017 Khem Raj <[email protected]>
 # Released under the MIT license (see COPYING.MIT for the terms)
 
-DESCRIPTION = "LLVM based C/C++ compiler Runtime"
+SUMMARY = "LLVM OpenMP compiler Runtime"
 HOMEPAGE = "https://openmp.llvm.org/"
 SECTION = "libs"
 
#11 lore raw

Re: [OE-core] [PATCH 08/19] clang/recipes: Add missing SUMMARY field

Quoted 14 lines · Khem Raj via lists.openembedded.org

Enhance description while here

---
 .../clang/clang-cross-canadian_git.bb                 |  2 +- meta/recipes-devtools/clang/clang-cross_git.bb        |  2 +- meta/recipes-devtools/clang/clang-crosssdk_git.bb     |  2 +- meta/recipes-devtools/clang/clang_git.bb              | 11 ++++++++++- .../clang/compiler-rt-sanitizers_git.bb               |  4 +++- meta/recipes-devtools/clang/compiler-rt_git.bb        |  6 +++++- meta/recipes-devtools/clang/libclc_git.bb             |  2 +- meta/recipes-devtools/clang/libcxx_git.bb             |  2 +- meta/recipes-devtools/clang/nativesdk-clang-glue.bb   |  2 +- meta/recipes-devtools/clang/openmp_git.bb             |  2 +-

Quoted 1 line
 10 files changed, 25 insertions(+), 10 deletions(-)

This can probably be merged into the recipes in meta-clang so it would just be part of the recipe merge in future?

Cheers,

Richard

author
#12 lore raw

PATCH 9/19 llvm: Delete

In reply to Khem Raj

clang recipes would PROVIDE and RPROVIDE llvm

---
 ...r-sort-ClassInfo-lists-by-name-as-we.patch |  31 ---
 ...-llvm-allow-env-override-of-exe-path.patch |  37 ----
 meta/recipes-devtools/llvm/llvm/llvm-config   |  51 -----
 meta/recipes-devtools/llvm/llvm_19.1.2.bb     | 179 ------------------
 4 files changed, 298 deletions(-)
 delete mode 100644 meta/recipes-devtools/llvm/llvm/0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch
 delete mode 100644 meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch
 delete mode 100644 meta/recipes-devtools/llvm/llvm/llvm-config
 delete mode 100644 meta/recipes-devtools/llvm/llvm_19.1.2.bb
meta/recipes-devtools/llvm/llvm/0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch deleted +0 -31
deleted file mode 100644
index a5c53b66574..00000000000
@@ -1,31 +0,0 @@
-From 3b30a9bda88374e8f03bf96e972aee5bd214b98b Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <[email protected]>
-Date: Fri, 27 Nov 2020 10:11:08 +0000
-Subject: [PATCH] AsmMatcherEmitter: sort ClassInfo lists by name as well
-
-Otherwise, there are instances which are identical in
-every other field and therefore sort non-reproducibly
-(which breaks binary and source reproducibiliy).
-
-Upstream-Status: Submitted [https://reviews.llvm.org/D97477]
-Signed-off-by: Alexander Kanavin <[email protected]>
----
- llvm/utils/TableGen/AsmMatcherEmitter.cpp | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
-index 73724e662f9e..1ca9c73415db 100644
---- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp
-+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
-@@ -361,7 +361,10 @@ public:
-     // name of a class shouldn't be significant. However, some of the backends
-     // accidentally rely on this behaviour, so it will have to stay like this
-     // until they are fixed.
--    return ValueName < RHS.ValueName;
-+    if (ValueName != RHS.ValueName)
-+        return ValueName < RHS.ValueName;
-+    // All else being equal, we should sort by name, for source and binary reproducibility
-+    return Name < RHS.Name;
-   }
- };
- 
meta/recipes-devtools/llvm/llvm/0007-llvm-allow-env-override-of-exe-path.patch deleted +0 -37
deleted file mode 100644
index add38b3bb4d..00000000000
@@ -1,37 +0,0 @@
-From 588a8694c6540e31140c7e242bfb5e279d6ca08c Mon Sep 17 00:00:00 2001
-From: Martin Kelly <[email protected]>
-Date: Fri, 19 May 2017 00:22:57 -0700
-Subject: [PATCH] llvm: allow env override of exe and libdir path
-
-When using a native llvm-config from inside a sysroot, we need llvm-config to
-return the libraries, include directories, etc. from inside the sysroot rather
-than from the native sysroot. Thus provide an env override for calling
-llvm-config from a target sysroot.
-
-Upstream-Status: Inappropriate [OE-specific]
-
-Signed-off-by: Martin Kelly <[email protected]>
-Signed-off-by: Khem Raj <[email protected]>
----
- llvm/tools/llvm-config/llvm-config.cpp | 25 +++++++++++++++++++------
- 1 file changed, 19 insertions(+), 6 deletions(-)
-
-diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
-index e86eb2b44b10..7b2abf318dbe 100644
---- a/llvm/tools/llvm-config/llvm-config.cpp
-+++ b/llvm/tools/llvm-config/llvm-config.cpp
-@@ -246,6 +246,13 @@ Typical components:\n\
- 
- /// Compute the path to the main executable.
- std::string GetExecutablePath(const char *Argv0) {
-+  // Hack for Yocto: we need to override the root path when we are using
-+  // llvm-config from within a target sysroot.
-+  const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH");
-+  if (Sysroot != nullptr) {
-+    return Sysroot;
-+  }
-+
-   // This just needs to be some symbol in the binary; C++ doesn't
-   // allow taking the address of ::main however.
-   void *P = (void *)(intptr_t)GetExecutablePath;
- 
meta/recipes-devtools/llvm/llvm/llvm-config deleted +0 -51

51 lines not on this page · raw message

meta/recipes-devtools/llvm/llvm_19.1.2.bb deleted +0 -179

179 lines not on this page · raw message

author
#13 lore raw

PATCH 10/19 spirv-llvm-translator: Add recipe

In reply to Khem Raj

Bring it from meta-clang

---
 .../spirv-llvm-translator_git.bb              | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 meta/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb
meta/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb new file +37 -0
new file mode 100644
index 00000000000..204d472dac1
@@ -0,0 +1,37 @@
+SUMMARY = "A tool and a library for bi-directional translation between SPIR-V and LLVM IR"
+HOMEPAGE = "https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
+LICENSE = "NCSA"
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=47e311aa9caedd1b3abf098bd7814d1d"
+
+BRANCH = "llvm_release_190"
+SRC_URI = "git://github.com/KhronosGroup/SPIRV-LLVM-Translator;protocol=https;branch=${BRANCH} \
+           git://github.com/KhronosGroup/SPIRV-Headers;protocol=https;destsuffix=git/SPIRV-Headers;name=headers;branch=main \
+          "
+
+PV = "19.1.0+git"
+SRCREV = "d65c25a166531b2efb744358ad1dc5283e1cc72f"
+SRCREV_headers = "efb6b4099ddb8fa60f62956dee592c4b94ec6a49"
+
+SRCREV_FORMAT = "default_headers"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "spirv-tools clang"
+
+inherit cmake pkgconfig python3native
+
+# Specify any options you want to pass to cmake using EXTRA_OECMAKE:
+# for CMAKE_SHARED_LIBS=OFF see https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/1868
+EXTRA_OECMAKE = "\
+        -DBUILD_SHARED_LIBS=OFF \
+        -DCMAKE_BUILD_TYPE=Release \
+        -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
+        -DCMAKE_SKIP_RPATH=ON \
+        -DLLVM_EXTERNAL_LIT=lit \
+        -DLLVM_INCLUDE_TESTS=ON \
+        -Wno-dev \
+        -DCCACHE_ALLOWED=FALSE \
+        -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${S}/SPIRV-Headers \
+"
+
+BBCLASSEXTEND = "native nativesdk"
author
#14 lore raw

PATCH 11/19 multilib.conf: Add llvm-project-source recipe to NON_MULTILIB_RECIPES

In reply to Khem Raj

llvm sourcebase is large and like gcc, it reuses same source tree to build all recipes using clang+llvm sourcebase

---
 meta/conf/multilib.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/multilib.conf +1 -1
index 7bdfcd56aaa..a47eb27458b 100644
@@ -24,4 +24,4 @@ OPKG_ARGS:append = " --force-maintainer --force-overwrite"
 
 # These recipes don't need multilib variants, the ${BPN} PROVDES/RPROVDES
 # ${MLPREFIX}${BPN}
-NON_MULTILIB_RECIPES = "grub grub-efi make-mod-scripts ovmf u-boot gcc-source"
+NON_MULTILIB_RECIPES = "grub grub-efi make-mod-scripts ovmf u-boot gcc-source llvm-project-source"
author
#15 lore raw

PATCH 12/19 distro/defaultsetup: Inherit clang, nonclangable, and nonscanable

In reply to Khem Raj

This ensures that when TOOLCHAIN = "clang" then the right tweaks are added for recipes to either work with clang or fallback to use gcc

---
 meta/conf/distro/defaultsetup.conf | 3 +++
 1 file changed, 3 insertions(+)
meta/conf/distro/defaultsetup.conf +3 -0
index e6369dcec4b..7a40efe86ce 100644
@@ -5,6 +5,9 @@ include conf/distro/include/maintainers.inc
 include conf/distro/include/time64.inc
 require conf/distro/include/tcmode-${TCMODE}.inc
 require conf/distro/include/tclibc-${TCLIBC}.inc
+require conf/distro/include/clang.inc
+require conf/distro/include/nonclangable.inc
+require conf/distro/include/nonscanable.inc
 
 require conf/distro/include/uninative-flags.inc
 
author
#16 lore raw

PATCH 13/19 maintainers.inc: Add myself as maintainer for clang family of recipes

In reply to Khem Raj
---
 meta/conf/distro/include/maintainers.inc | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
meta/conf/distro/include/maintainers.inc +12 -1
index 7aafa7a2d14..f3ae74423a1 100644
@@ -96,8 +96,14 @@ RECIPE_MAINTAINER:pn-cantarell-fonts = "Alexander Kanavin <[email protected]
 RECIPE_MAINTAINER:pn-ccache = "Robert Yang <[email protected]>"
 RECIPE_MAINTAINER:pn-cdrtools-native = "Yi Zhao <[email protected]>"
 RECIPE_MAINTAINER:pn-chrpath = "Yi Zhao <[email protected]>"
+RECIPE_MAINTAINER:pn-clang = "Khem Raj <[email protected]>"
+RECIPE_MAINTAINER:pn-clang-cross-${TARGET_ARCH} = "Khem Raj <[email protected]>"
+RECIPE_MAINTAINER:pn-clang-cross-canadian-${TRANSLATED_TARGET_ARCH} = "Khem Raj <[email protected]>"
+RECIPE_MAINTAINER:pn-clang-crosssdk-${SDK_SYS} = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-cmake = "Unassigned <[email protected]>"
 RECIPE_MAINTAINER:pn-cmake-native = "Unassigned <[email protected]>"
+RECIPE_MAINTAINER:pn-compiler-rt = "Khem Raj <[email protected]>"
+RECIPE_MAINTAINER:pn-compiler-rt-sanitizers = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-connman = "Changhyeok Bae <[email protected]>"
 RECIPE_MAINTAINER:pn-connman-conf = "Ross Burton <[email protected]>"
 RECIPE_MAINTAINER:pn-connman-gnome = "Ross Burton <[email protected]>"
@@ -320,8 +326,10 @@ RECIPE_MAINTAINER:pn-libcap-ng = "Yi Zhao <[email protected]>"
 RECIPE_MAINTAINER:pn-libcap-ng-python = "Yi Zhao <[email protected]>"
 RECIPE_MAINTAINER:pn-libcgroup = "Alexander Kanavin <[email protected]>"
 RECIPE_MAINTAINER:pn-libcheck = "Yi Zhao <[email protected]>"
+RECIPE_MAINTAINER:pn-libclc = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-libcomps = "Alexander Kanavin <[email protected]>"
 RECIPE_MAINTAINER:pn-libconvert-asn1-perl = "Tim Orling <[email protected]>"
+RECIPE_MAINTAINER:pn-libcxx = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-libdaemon = "Alexander Kanavin <[email protected]>"
 RECIPE_MAINTAINER:pn-libdazzle = "Alexander Kanavin <[email protected]>"
 RECIPE_MAINTAINER:pn-libdnf = "Alexander Kanavin <[email protected]>"
@@ -469,7 +477,7 @@ RECIPE_MAINTAINER:pn-linux-yocto = "Bruce Ashfield <[email protected]>"
 RECIPE_MAINTAINER:pn-linux-yocto-dev = "Bruce Ashfield <[email protected]>"
 RECIPE_MAINTAINER:pn-linux-yocto-rt = "Bruce Ashfield <[email protected]>"
 RECIPE_MAINTAINER:pn-linux-yocto-tiny = "Bruce Ashfield <[email protected]>"
-RECIPE_MAINTAINER:pn-llvm = "Khem Raj <[email protected]>"
+RECIPE_MAINTAINER:pn-llvm-project-source-19.1.3 = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-logrotate = "Yi Zhao <[email protected]>"
 RECIPE_MAINTAINER:pn-log4cplus = "Unassigned <[email protected]>"
 RECIPE_MAINTAINER:pn-lrzsz = "Anuj Mittal <[email protected]>"
@@ -537,6 +545,7 @@ RECIPE_MAINTAINER:pn-musl-obstack = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-musl-utils = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-nasm = "Richard Purdie <[email protected]>"
 RECIPE_MAINTAINER:pn-nativesdk-buildtools-perl-dummy = "Richard Purdie <[email protected]>"
+RECIPE_MAINTAINER:pn-nativesdk-clang-glue = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-nativesdk-icecc-toolchain = "Joshua Watt <[email protected]>"
 RECIPE_MAINTAINER:pn-nativesdk-libtool = "Richard Purdie <[email protected]>"
 RECIPE_MAINTAINER:pn-nativesdk-packagegroup-sdk-host = "Ross Burton <[email protected]>"
@@ -556,6 +565,7 @@ RECIPE_MAINTAINER:pn-npth = "Alexander Kanavin <[email protected]>"
 RECIPE_MAINTAINER:pn-nss-myhostname = "Anuj Mittal <[email protected]>"
 RECIPE_MAINTAINER:pn-numactl = "Richard Purdie <[email protected]>"
 RECIPE_MAINTAINER:pn-ofono = "Ross Burton <[email protected]>"
+RECIPE_MAINTAINER:pn-openmp = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-opensbi = "Thomas Perrot <[email protected]>"
 RECIPE_MAINTAINER:pn-openssh = "Unassigned <[email protected]>"
 RECIPE_MAINTAINER:pn-openssl = "Alexander Kanavin <[email protected]>"
@@ -775,6 +785,7 @@ RECIPE_MAINTAINER:pn-socat = "Hongxu Jia <[email protected]>"
 RECIPE_MAINTAINER:pn-speex = "Michael Opdenacker <[email protected]>"
 RECIPE_MAINTAINER:pn-speexdsp = "Michael Opdenacker <[email protected]>"
 RECIPE_MAINTAINER:pn-spirv-headers = "Jose Quaresma <[email protected]>"
+RECIPE_MAINTAINER:pn-spirv-llvm-translator = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-spirv-tools = "Jose Quaresma <[email protected]>"
 RECIPE_MAINTAINER:pn-sqlite3 = "Anuj Mittal <[email protected]>"
 RECIPE_MAINTAINER:pn-squashfs-tools = "Robert Yang <[email protected]>"
author
#17 lore raw

PATCH 14/19 clang: PROVIDE llvm-native and llvm

In reply to Khem Raj

Now that clang is providing llvm as well, it should keep existing demands on llvm recipe

---
 meta/recipes-devtools/clang/clang_git.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-devtools/clang/clang_git.bb +3 -0
index 1ad40f2fcff..56b569fa73a 100644
@@ -303,6 +303,9 @@ do_install:append:class-nativesdk () {
     sed -i -e 's,${B},,g' ${D}${libdir}/cmake/llvm/LLVMConfig.cmake
 }
 
+PROVIDES:append:class-native = " llvm-native"
+PROVIDES:append:class-target = " llvm"
+
 PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools \
              libclang lldb lldb-server liblldb llvm-linker-tools"
 
author
#18 lore raw

PATCH 15/19 rpm: Use gcc to compile always

In reply to Khem Raj

openMP is LLVM implementation which is used by clang for openmp runtime but it ends up with reproducibility bug in clang, until its fixed lets always use gcc

---
 meta/recipes-devtools/rpm/rpm_4.19.1.1.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-devtools/rpm/rpm_4.19.1.1.bb +4 -0
index 93303237973..d75106aabea 100644
@@ -49,6 +49,10 @@ S = "${WORKDIR}/git"
 DEPENDS = "lua libgcrypt file popt xz bzip2 elfutils python3 sqlite3 zstd"
 DEPENDS:append:class-native = " file-replacement-native bzip2-replacement-native"
 
+# clang needs libomp which ends up with buildpaths in binaries debug info
+# see https://github.com/llvm/llvm-project/issues/82541
+TOOLCHAIN = "gcc"
+
 EXTRA_OECMAKE:append = " -D__CURL:FILEPATH=curl"
 EXTRA_OECMAKE:append:libc-musl = " -DENABLE_NLS=OFF -DENABLE_OPENMP=OFF"
 
author
#19 lore raw

PATCH 16/19 sdks: Add clang toolchain to SDKs

In reply to Khem Raj

Use SDK_TOOLCHAINS_LANGS to tether clang toolchain into SDKs

---
 documentation/ref-manual/variables.rst         |  2 +-
 meta/classes-recipe/populate_sdk_base.bbclass  |  2 ++
 .../packagegroup-clang-cross-canadian.bb       | 18 ++++++++++++++++++
 .../packagegroup-clang-sdk-target.bb           | 15 +++++++++++++++
 .../packagegroup-core-buildessential.bb        |  5 +++++
 .../packagegroups/packagegroup-core-sdk.bb     |  1 +
 6 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/packagegroups/packagegroup-clang-cross-canadian.bb
 create mode 100644 meta/recipes-core/packagegroups/packagegroup-clang-sdk-target.bb
documentation/ref-manual/variables.rst +1 -1
index 07ed143ac56..77dbe2814cb 100644
@@ -7715,7 +7715,7 @@ system and gives an overview of their function and contents.
 
    :term:`SDK_TOOLCHAIN_LANGS`
       Specifies programming languages to support in the SDK, as a
-      space-separated list. Currently supported items are ``rust`` and ``go``.
+      space-separated list. Currently supported items are ``clang``, ``rust`` and ``go``.
 
    :term:`SDK_UPDATE_URL`
       An optional URL for an update server for the extensible SDK. If set,
meta/classes-recipe/populate_sdk_base.bbclass +2 -0
index 031c65f05f3..68a772c3bd2 100644
@@ -64,12 +64,14 @@ SDK_TOOLCHAIN_LANGS:remove:mipsarchn32 = "rust"
 TOOLCHAIN_HOST_TASK ?= " \
     nativesdk-packagegroup-sdk-host \
     packagegroup-cross-canadian-${MACHINE} \
+    ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'clang', 'packagegroup-clang-cross-canadian-${MACHINE}', '', d)} \
     ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go', 'packagegroup-go-cross-canadian-${MACHINE}', '', d)} \
     ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust', 'packagegroup-rust-cross-canadian-${MACHINE}', '', d)} \
 "
 TOOLCHAIN_HOST_TASK_ATTEMPTONLY ?= ""
 TOOLCHAIN_TARGET_TASK ?= " \
     ${@multilib_pkg_extend(d, 'packagegroup-core-standalone-sdk-target')} \
+    ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'clang', multilib_pkg_extend(d, 'packagegroup-clang-sdk-target'), '', d)} \
     ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go', multilib_pkg_extend(d, 'packagegroup-go-sdk-target'), '', d)} \
     ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust', multilib_pkg_extend(d, 'libstd-rs'), '', d)} \
     target-sdk-provides-dummy \
meta/recipes-core/packagegroups/packagegroup-clang-cross-canadian.bb new file +18 -0
new file mode 100644
index 00000000000..2a6303cc824
@@ -0,0 +1,18 @@
+SUMMARY = "Host SDK package for Clang cross canadian toolchain"
+PN = "packagegroup-clang-cross-canadian-${MACHINE}"
+
+inherit cross-canadian packagegroup
+
+PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
+
+CLANG="clang-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+
+RDEPENDS:${PN} = " \
+    ${@all_multilib_tune_values(d, 'CLANG')} \
+    nativesdk-binutils \
+    nativesdk-clang \
+    nativesdk-glibc-dev \
+    nativesdk-libgcc-dev \
+    nativesdk-compiler-rt-dev \
+    nativesdk-libcxx-dev \
+"
meta/recipes-core/packagegroups/packagegroup-clang-sdk-target.bb new file +15 -0
new file mode 100644
index 00000000000..2b30642427c
@@ -0,0 +1,15 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+SUMMARY = "Target packages for the Clang SDK"
+
+inherit packagegroup
+
+RDEPENDS:${PN} = " \
+    clang \
+    libcxx \
+    compiler-rt \
+"
meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb +5 -0
index 2cd67ad05f8..d140f1f54af 100644
@@ -29,3 +29,8 @@ RDEPENDS:packagegroup-core-buildessential = "\
     pkgconfig \
     "
 
+RDEPENDS:packagegroup-core-buildessential:append:toolchain-clang = "\
+    clang \
+    libcxx \
+    compiler-rt \
+    "
meta/recipes-core/packagegroups/packagegroup-core-sdk.bb +1 -0
index 84e1a41d9a0..c2385a97b44 100644
@@ -30,6 +30,7 @@ RDEPENDS:packagegroup-core-sdk = "\
     tcl \
     ${@bb.utils.contains('TARGET_TOOLCHAIN_LANGS', 'go', 'packagegroup-go-sdk-target', '', d)} \
     ${@bb.utils.contains('TARGET_TOOLCHAIN_LANGS', 'rust', 'packagegroup-rust-sdk-target', '', d)} \
+    ${@bb.utils.contains('TARGET_TOOLCHAIN_LANGS', 'clang', 'packagegroup-clang-sdk-target', '', d)} \
 "
 
 SANITIZERS = "libasan-dev libubsan-dev"
#20 lore raw

Re: [OE-core] [PATCH 16/19] sdks: Add clang toolchain to SDKs

Quoted 4 lines · Khem Raj

Use SDK_TOOLCHAINS_LANGS to tether clang toolchain into SDKs

---

Hi Khem,

Thanks for your patches, but I believe there is an issue with this one:
it modifies files in both openembedded-core and yocto-docs.

Could you provide the documentation modification as a separate commit ?

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author
#21 lore raw

Re: [OE-core] [PATCH 16/19] sdks: Add clang toolchain to SDKs

Quoted 6 lines · Mathieu Dubois-Briand
Quoted 4 lines · Khem Raj

Use SDK_TOOLCHAINS_LANGS to tether clang toolchain into SDKs

---

Quoted 6 lines

Hi Khem,

Thanks for your patches, but I believe there is an issue with this one:
it modifies files in both openembedded-core and yocto-docs.

Could you provide the documentation modification as a separate commit ?

Thanks for reporting this. Will push into control tree soon

Quoted 7 lines

--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

author
#22 lore raw

PATCH 17/19 toolchain-scripts.bbclass: Add env variables in SDK to use clang/clang++

In reply to Khem Raj

Make CLANGCC/CLANGCXX/CLANG_TIDY available in SDK

---
 meta/classes-recipe/toolchain-scripts.bbclass | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
meta/classes-recipe/toolchain-scripts.bbclass +15 -1
index b59a295abcc..f17905d5284 100644
@@ -11,6 +11,17 @@ inherit toolchain-scripts-base siteinfo kernel-arch
 REAL_MULTIMACH_TARGET_SYS ?= "${MULTIMACH_TARGET_SYS}"
 TARGET_CC_ARCH:append:libc-musl = " -mmusl"
 
+# Adjustments for clang in SDK
+export TARGET_CLANGCC_ARCH = "${TARGET_CC_ARCH}"
+TARGET_CLANGCC_ARCH:remove = "-mthumb-interwork"
+TARGET_CLANGCC_ARCH:remove = "-mmusl"
+TARGET_CLANGCC_ARCH:remove = "-muclibc"
+TARGET_CLANGCC_ARCH:remove = "-meb"
+TARGET_CLANGCC_ARCH:remove = "-mel"
+TARGET_CLANGCC_ARCH:append = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", " -mbig-endian", " -mlittle-endian", d)}"
+TARGET_CLANGCC_ARCH:remove:powerpc = "-mhard-float"
+TARGET_CLANGCC_ARCH:remove:powerpc = "-mno-spe"
+
 # default debug prefix map isn't valid in the SDK
 DEBUG_PREFIX_MAP = ""
 
@@ -147,7 +158,10 @@ toolchain_shared_env_script () {
 	echo 'export ARCH=${ARCH}' >> $script
 	echo 'export CROSS_COMPILE=${TARGET_PREFIX}' >> $script
 	echo 'export OECORE_TUNE_CCARGS="${TUNE_CCARGS}"' >> $script
-
+	echo 'export CLANGCC="${TARGET_PREFIX}clang --target=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
+    echo 'export CLANGCXX="${TARGET_PREFIX}clang++ --target=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
+    echo 'export CLANGCPP="${TARGET_PREFIX}clang -E --target=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
+    echo 'export CLANG_TIDY_EXE="${TARGET_PREFIX}clang-tidy"' >> $script
     cat >> $script <<EOF
 
 # Append environment subscripts
author
#23 lore raw

PATCH 18/19 mesa: update 24.0.7 -> 24.2.2

In reply to Khem Raj

From: Markus Volk <[email protected]>

- Remove patches that have been merged upstream
- Remove 0001-Revert-meson-do-not-pull-in-clc-for-clover.patch. Issue was fixed upstream
- Update 0001-freedreno-don-t-encode-build-path-into-binaries.patch
- Use 'enabled/disabled' for glvnd instead of deprecated 'true/false'
- swrast gallium driver has been split into 'softpipe' and 'llvmpipe'. The use of 'swrast' has been deprecated.
[https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-24.2.2/meson.build#L171]
- Add package for libgallium and install
- Add python3-pyyaml-native dependency
- Limit intel_clc to x86-64
- Remove OPENCL_NATIVE variable. The according option has been removed
from meson_options.txt.
- Meanwhile theres an install option for intel_clc. Use it instead of manual install
- intel 'iris' and intel 'vulkan' drivers require opencl and thus need meta-clang layer
[https://gitlab.freedesktop.org/mesa/mesa/-/issues/11141]
- Remove gallium kmsro option. This is set depending on 'system_has_kms_drm'
[https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-24.2.2/meson.build#L206]
- Add vulkan support for older intel graphics

Note: 'kmsro' needs to be removed from mesa.bbappend in meta-raspberrypi

---
 ...-meson-do-not-pull-in-clc-for-clover.patch | 53 --------------
 ...lude-missing-llvm-IR-header-Module.h.patch | 41 -----------
 .../0001-drisw-fix-build-without-dri3.patch   | 58 ---------------
 ...on-t-encode-build-path-into-binaries.patch | 71 +++++++++++++++----
 ...on-t-try-zink-if-not-enabled-in-mesa.patch | 42 -----------
 meta/recipes-graphics/mesa/mesa.inc           | 49 +++++--------
 6 files changed, 77 insertions(+), 237 deletions(-)
 delete mode 100644 meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch
 delete mode 100644 meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch
 delete mode 100644 meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch
 delete mode 100644 meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch
meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch deleted +0 -53
deleted file mode 100644
index 1711e22585a..00000000000
@@ -1,53 +0,0 @@
-From 051f41beda540f0ae77b341db01a6de83c9e938a Mon Sep 17 00:00:00 2001
-From: Markus Volk <[email protected]>
-Date: Fri, 8 Mar 2024 15:53:11 +0100
-Subject: [PATCH] Revert "meson: do not pull in clc for clover"
-
-This reverts commit 815a6647eb1383e9dc704ffcc266d85f3b13338a.
-Upstream-Status: Inappropriate [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27783/diffs?commit_id=a976f2c9f0c07f9e06cc9affd9124b45bc60c2bd]
-
-Once the merge request above was added, it will only be possible to provide opencl spir-v with gallium-rusticl=true. This is not yet supported in the mesa recipe.
-For now reverting this commit allows to still use clover with opencl-spirv, which would otherwise be broken starting from mesa 24.0.2.
-
-After it was merged, this patch needs to be removed and rusticl support will be required
-
-Signed-off-by: Markus Volk <[email protected]>
----
- meson.build              | 3 ++-
- src/compiler/meson.build | 2 +-
- 2 files changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/meson.build b/meson.build
-index 2db6185..741b5d1 100644
---- a/meson.build
-+++ b/meson.build
-@@ -813,6 +813,7 @@ if _opencl != 'disabled'
-     error('The Clover OpenCL state tracker requires rtti')
-   endif
- 
-+  with_clc = true
-   with_gallium_opencl = true
-   with_opencl_icd = _opencl == 'icd'
- else
-@@ -837,7 +838,7 @@ if with_gallium_rusticl
- endif
- 
- dep_clc = null_dep
--if with_gallium_opencl or with_clc
-+if with_clc
-   dep_clc = dependency('libclc')
- endif
- 
-diff --git a/src/compiler/meson.build b/src/compiler/meson.build
-index 8d73544..1dae56d 100644
---- a/src/compiler/meson.build
-+++ b/src/compiler/meson.build
-@@ -79,7 +79,7 @@ subdir('nir')
- 
- subdir('spirv')
- 
--if with_clc
-+if with_opencl_spirv
-   subdir('clc')
- endif
- if with_gallium
meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch deleted +0 -41

41 lines not on this page · raw message

meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch deleted +0 -58

58 lines not on this page · raw message

meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +58 -13

113 lines not on this page · raw message

meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch deleted +0 -42

42 lines not on this page · raw message

meta/recipes-graphics/mesa/mesa.inc +19 -30

130 lines not on this page · raw message

#24 lore raw

Re: [OE-core] [PATCH 18/19] mesa: update 24.0.7 -> 24.2.2

This update was as well done with the assumption that clang is not in core, and so disables Intel iris driver (e.g. all modern intel graphics). I'd say leave it out too; we'll get back to it after clang lands.

Alex

Quoted 530 lines · Khem Raj via lists.openembedded.org

From: Markus Volk <[email protected]>

- Remove patches that have been merged upstream
- Remove 0001-Revert-meson-do-not-pull-in-clc-for-clover.patch. Issue was fixed upstream
- Update 0001-freedreno-don-t-encode-build-path-into-binaries.patch
- Use 'enabled/disabled' for glvnd instead of deprecated 'true/false'
- swrast gallium driver has been split into 'softpipe' and 'llvmpipe'. The use of 'swrast' has been deprecated.
[https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-24.2.2/meson.build#L171]
- Add package for libgallium and install
- Add python3-pyyaml-native dependency
- Limit intel_clc to x86-64
- Remove OPENCL_NATIVE variable. The according option has been removed
from meson_options.txt.
- Meanwhile theres an install option for intel_clc. Use it instead of manual install
- intel 'iris' and intel 'vulkan' drivers require opencl and thus need meta-clang layer
[https://gitlab.freedesktop.org/mesa/mesa/-/issues/11141]
- Remove gallium kmsro option. This is set depending on 'system_has_kms_drm'
[https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-24.2.2/meson.build#L206]
- Add vulkan support for older intel graphics

Note: 'kmsro' needs to be removed from mesa.bbappend in meta-raspberrypi

---
 ...-meson-do-not-pull-in-clc-for-clover.patch | 53 --------------
 ...lude-missing-llvm-IR-header-Module.h.patch | 41 -----------
 .../0001-drisw-fix-build-without-dri3.patch   | 58 ---------------
 ...on-t-encode-build-path-into-binaries.patch | 71 +++++++++++++++----
 ...on-t-try-zink-if-not-enabled-in-mesa.patch | 42 -----------
 meta/recipes-graphics/mesa/mesa.inc           | 49 +++++--------
 6 files changed, 77 insertions(+), 237 deletions(-)
 delete mode 100644 meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch
 delete mode 100644 meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch
 delete mode 100644 meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch
 delete mode 100644 meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch
meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch deleted +0 -53
deleted file mode 100644
index 1711e22585a..00000000000
@@ -1,53 +0,0 @@
-From 051f41beda540f0ae77b341db01a6de83c9e938a Mon Sep 17 00:00:00 2001
-From: Markus Volk <[email protected]>
-Date: Fri, 8 Mar 2024 15:53:11 +0100
-Subject: [PATCH] Revert "meson: do not pull in clc for clover"
-
-This reverts commit 815a6647eb1383e9dc704ffcc266d85f3b13338a.
-Upstream-Status: Inappropriate [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27783/diffs?commit_id=a976f2c9f0c07f9e06cc9affd9124b45bc60c2bd]
-
-Once the merge request above was added, it will only be possible to provide opencl spir-v with gallium-rusticl=true. This is not yet supported in the mesa recipe.
-For now reverting this commit allows to still use clover with opencl-spirv, which would otherwise be broken starting from mesa 24.0.2.
-
-After it was merged, this patch needs to be removed and rusticl support will be required
-
-Signed-off-by: Markus Volk <[email protected]>
----
- meson.build              | 3 ++-
- src/compiler/meson.build | 2 +-
- 2 files changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/meson.build b/meson.build
-index 2db6185..741b5d1 100644
---- a/meson.build
-+++ b/meson.build
-@@ -813,6 +813,7 @@ if _opencl != 'disabled'
-     error('The Clover OpenCL state tracker requires rtti')
-   endif
-
-+  with_clc = true
-   with_gallium_opencl = true
-   with_opencl_icd = _opencl == 'icd'
- else
-@@ -837,7 +838,7 @@ if with_gallium_rusticl
- endif
-
- dep_clc = null_dep
--if with_gallium_opencl or with_clc
-+if with_clc
-   dep_clc = dependency('libclc')
- endif
-
-diff --git a/src/compiler/meson.build b/src/compiler/meson.build
-index 8d73544..1dae56d 100644
---- a/src/compiler/meson.build
-+++ b/src/compiler/meson.build
-@@ -79,7 +79,7 @@ subdir('nir')
-
- subdir('spirv')
-
--if with_clc
-+if with_opencl_spirv
-   subdir('clc')
- endif
- if with_gallium
meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch deleted +0 -41
deleted file mode 100644
index 82ad88a079c..00000000000
@@ -1,41 +0,0 @@
-From 777d69cf15b80ab1f109a4936d6e4801c4b0e0f3 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Mon, 1 Jul 2024 23:09:29 -0700
-Subject: [PATCH] amd: Include missing llvm IR header Module.h
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-With LLVM-19, Module.h header is not being pulled, which results in
-compile errors e.g.
-
-src/amd/llvm/ac_llvm_helper.cpp:102:10: error: no matching function for call to ‘unwrap(LLVMOpaqueModule*&)’
-  102 |    unwrap(module)->setTargetTriple(TM->getTargetTriple().getTriple());
-      |    ~~~~~~^~~~~~~~
-In file included from /mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/IR/Type.h:18,
-                 from /mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/IR/DerivedTypes.h:23,
-                 from /mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/IR/InstrTypes.h:26,
-                 from /mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/Analysis/TargetLibraryInfo.h:14,
-                 from ../mesa-24.0.7/src/amd/llvm/ac_llvm_helper.cpp:8:
-
-Its getting the definition from llvm/IR/Type.h instead of Module.h and caused
-confusion to compiler
-
-Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29993]
-Signed-off-by: Khem Raj <[email protected]>
----
- src/amd/llvm/ac_llvm_helper.cpp | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/amd/llvm/ac_llvm_helper.cpp b/src/amd/llvm/ac_llvm_helper.cpp
-index 5d065279ad1..af4a50f8409 100644
---- a/src/amd/llvm/ac_llvm_helper.cpp
-+++ b/src/amd/llvm/ac_llvm_helper.cpp
-@@ -8,6 +8,7 @@
- #include <llvm/Analysis/TargetLibraryInfo.h>
- #include <llvm/IR/IRBuilder.h>
- #include <llvm/IR/LegacyPassManager.h>
-+#include <llvm/IR/Module.h>
- #include <llvm/IR/Verifier.h>
- #include <llvm/Target/TargetMachine.h>
- #include <llvm/MC/MCSubtargetInfo.h>
meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch deleted +0 -58
deleted file mode 100644
index ab161520906..00000000000
@@ -1,58 +0,0 @@
-From 4bd15a419e892da843489c374c58c5b29c40b5d6 Mon Sep 17 00:00:00 2001
-From: Romain Naour <[email protected]>
-Date: Tue, 6 Feb 2024 09:47:09 +0100
-Subject: [PATCH 1/2] drisw: fix build without dri3
-
-commit 1887368df41 ("glx/sw: check for modifier support in the kopper path")
-added dri3_priv.h header and dri3_check_multibuffer() function in drisw that
-can be build without dri3.
-
-  i686-buildroot-linux-gnu/bin/ld: src/glx/libglx.a.p/drisw_glx.c.o: in function `driswCreateScreenDriver':
-  drisw_glx.c:(.text.driswCreateScreenDriver+0x3a0): undefined reference to `dri3_check_multibuffer'
-  collect2: error: ld returned 1 exit status
-
-Add HAVE_DRI3 guard around dri3_priv.h header and the zink code using
-dri3_check_multibuffer().
-
-Fixes: 1887368df41 ("glx/sw: check for modifier support in the kopper path")
-
-Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478]
-Signed-off-by: Romain Naour <[email protected]>
-Signed-off-by: Khem Raj <[email protected]>
----
- src/glx/drisw_glx.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
-index 3d3f752..4b19e2d 100644
---- a/src/glx/drisw_glx.c
-+++ b/src/glx/drisw_glx.c
-@@ -32,7 +32,9 @@
- #include <dlfcn.h>
- #include "dri_common.h"
- #include "drisw_priv.h"
-+#ifdef HAVE_DRI3
- #include "dri3_priv.h"
-+#endif
- #include <X11/extensions/shmproto.h>
- #include <assert.h>
- #include <vulkan/vulkan_core.h>
-@@ -995,6 +997,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv,
-        goto handle_error;
-    }
-
-+#ifdef HAVE_DRI3
-    if (pdpyp->zink) {
-       bool err;
-       psc->has_multibuffer = dri3_check_multibuffer(priv->dpy, &err);
-@@ -1005,6 +1008,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv,
-          goto handle_error;
-       }
-    }
-+#endif
-
-    glx_config_destroy_list(psc->base.configs);
-    psc->base.configs = configs;
---
-2.44.0
-
meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +58 -13
index 5975ab4472e..38871b6d11f 100644
@@ -1,4 +1,4 @@
-From 027ac36756cc75eea9ed4fee135a351af30b35fd Mon Sep 17 00:00:00 2001
+From 66d73feaac088d1a588a44a1780f2eaf4335fccf Mon Sep 17 00:00:00 2001
 From: Dmitry Baryshkov <[email protected]>
 Date: Tue, 16 Jul 2024 12:32:47 +0300
 Subject: [PATCH] freedreno: don't encode build path into binaries
@@ -13,33 +13,76 @@ it manually when running the tests.
 Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30206]
 Signed-off-by: Dmitry Baryshkov <[email protected]>
 ---
+ meson.build                      | 1 +
+ meson_options.txt                | 7 +++++++
  src/freedreno/afuc/meson.build   | 4 ++++
  src/freedreno/decode/meson.build | 4 +++-
- src/freedreno/meson.build        | 2 +-
- 3 files changed, 8 insertions(+), 2 deletions(-)
+ src/freedreno/meson.build        | 5 ++++-
+ 5 files changed, 19 insertions(+), 2 deletions(-)
 
+diff --git a/meson.build b/meson.build
+index 3bc837813f967..5c94e76649c63 100644
+--- a/meson.build
++++ b/meson.build
+@@ -76,6 +76,7 @@ if with_tools.contains('all')
+     'imagination',
+   ]
+ endif
++with_tools_for_development = get_option('tools-for-development')
+
+ with_any_vulkan_layers = get_option('vulkan-layers').length() != 0
+ with_intel_tools = with_tools.contains('intel') or with_tools.contains('intel-ui')
+diff --git a/meson_options.txt b/meson_options.txt
+index 753bebd961e3f..9bc308b512c13 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -537,6 +537,13 @@ option(
+   description : 'List of tools to build. (Note: `intel-ui` selects `intel`)',
+ )
+
++option(
++  'tools-for-development',
++  type : 'boolean',
++  value : false,
++  description : 'Support running tools from the build tree (for developers)',
++)
++
+ option(
+   'power8',
+   type : 'feature',
 diff --git a/src/freedreno/afuc/meson.build b/src/freedreno/afuc/meson.build
-index bb7cebf5a748..351cc31ef2de 100644
+index bb7cebf5a748c..351cc31ef2dec 100644
 --- a/src/freedreno/afuc/meson.build
 +++ b/src/freedreno/afuc/meson.build
-@@ -56,6 +56,7 @@ if with_tests
+@@ -56,10 +56,12 @@ if with_tests
    asm_fw = custom_target('afuc_test.fw',
      output: 'afuc_test.fw',
-     command: [asm, '-g', '6', files('../.gitlab-ci/traces/afuc_test.asm'), '@OUTPUT@'],
+     command: [asm, files('../.gitlab-ci/traces/afuc_test.asm'), '@OUTPUT@'],
++    env: {'RNN_PATH': rnn_src_path},
+   )
+   asm_fw_a7xx = custom_target('afuc_test_a7xx.fw',
+     output: 'afuc_test_a7xx.fw',
+     command: [asm, files('../.gitlab-ci/traces/afuc_test_a7xx.asm'), '@OUTPUT@'],
 +    env: {'RNN_PATH': rnn_src_path},
    )
    test('afuc-asm',
      diff,
-@@ -120,6 +122,7 @@ if cc.sizeof('size_t') > 4
+@@ -120,11 +122,13 @@ if cc.sizeof('size_t') > 4
      disasm_fw = custom_target('afuc_test.asm',
        output: 'afuc_test.asm',
-       command: [disasm, '-u', files('../.gitlab-ci/reference/afuc_test.fw'), '-g', '630'],
+       command: [disasm, '-u', files('../.gitlab-ci/reference/afuc_test.fw')],
++      env: {'RNN_PATH': rnn_src_path},
+       capture: true
+     )
+     disasm_fw_a7xx = custom_target('afuc_test_a7xx.asm',
+       output: 'afuc_test_a7xx.asm',
+       command: [disasm, '-u', files('../.gitlab-ci/reference/afuc_test_a7xx.fw')],
 +      env: {'RNN_PATH': rnn_src_path},
        capture: true
      )
      test('afuc-disasm',
 diff --git a/src/freedreno/decode/meson.build b/src/freedreno/decode/meson.build
-index 469eeb4eb597..dfa1c12d0d9f 100644
+index 469eeb4eb5975..915ba11af3b33 100644
 --- a/src/freedreno/decode/meson.build
 +++ b/src/freedreno/decode/meson.build
 @@ -194,6 +194,7 @@ if dep_lua.found() and dep_libarchive.found()
@@ -61,18 +104,20 @@ index 469eeb4eb597..dfa1c12d0d9f 100644
 
      test('crashdec-' + name,
 diff --git a/src/freedreno/meson.build b/src/freedreno/meson.build
-index 98e49b8fcf0e..145e72597eb9 100644
+index 98e49b8fcf0e9..f8bdc5299841b 100644
 --- a/src/freedreno/meson.build
 +++ b/src/freedreno/meson.build
-@@ -6,7 +6,7 @@ inc_freedreno_rnn = include_directories('rnn')
+@@ -6,7 +6,10 @@ inc_freedreno_rnn = include_directories('rnn')
 
  rnn_src_path = dir_source_root + '/src/freedreno/registers'
  rnn_install_path = get_option('datadir') + '/freedreno/registers'
 -rnn_path = rnn_src_path + ':' + get_option('prefix') + '/' + rnn_install_path
 +rnn_path = get_option('prefix') + '/' + rnn_install_path
++if with_tools_for_development
++  rnn_path = rnn_src_path + ':' + rnn_path
++endif
 
  dep_lua = dependency('lua54', 'lua53', 'lua52', 'lua', required: false,
                       allow_fallback: true, version: '>=5.2')
 --
-2.39.2
-
+GitLab
meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch deleted +0 -42
deleted file mode 100644
index 036a0b49453..00000000000
@@ -1,42 +0,0 @@
-From 62495ebb977866c52d5bed8499a547c49f0d9bc1 Mon Sep 17 00:00:00 2001
-From: Romain Naour <[email protected]>
-Date: Tue, 6 Feb 2024 09:47:10 +0100
-Subject: [PATCH 2/2] glxext: don't try zink if not enabled in mesa
-
-Commit 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers")
-added an automatic zink fallback even when the zink gallium is not
-enabled at build time.
-
-It leads to unexpected error log while loading drisw driver and
-zink is not installed on the rootfs:
-
-  MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so
-
-Fixes: 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers")
-
-Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478]
-Signed-off-by: Romain Naour <[email protected]>
-Signed-off-by: Khem Raj <[email protected]>
----
- src/glx/glxext.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/glx/glxext.c b/src/glx/glxext.c
-index 05c825a..7a06aa9 100644
---- a/src/glx/glxext.c
-+++ b/src/glx/glxext.c
-@@ -908,9 +908,11 @@ __glXInitialize(Display * dpy)
- #endif /* HAVE_DRI3 */
-       if (!debug_get_bool_option("LIBGL_DRI2_DISABLE", false))
-          dpyPriv->dri2Display = dri2CreateDisplay(dpy);
-+#if defined(HAVE_ZINK)
-       if (!dpyPriv->dri3Display && !dpyPriv->dri2Display)
-          try_zink = !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false) &&
-                     !getenv("GALLIUM_DRIVER");
-+#endif /* HAVE_ZINK */
-    }
- #endif /* GLX_USE_DRM */
-    if (glx_direct)
---
-2.44.0
-
meta/recipes-graphics/mesa/mesa.inc +19 -31
index 9fdf496e8b3..ecea7e94de8 100644
@@ -16,15 +16,11 @@ PE = "2"
 
 SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
            file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
-           file://0001-drisw-fix-build-without-dri3.patch \
-           file://0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch \
-           file://0001-Revert-meson-do-not-pull-in-clc-for-clover.patch \
-           file://0001-amd-Include-missing-llvm-IR-header-Module.h.patch \
            file://0001-freedreno-don-t-encode-build-path-into-binaries.patch\
 "
 
-SRC_URI[sha256sum] = "7454425f1ed4a6f1b5b107e1672b30c88b22ea0efea000ae2c7d96db93f6c26a"
-PV = "24.0.7"
+SRC_URI[sha256sum] = "fd077d3104edbe459e2b8597d2757ec065f9bd2d620b8c0b9cc88c2bf9891d02"
+PV = "24.2.2"
 
 UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P<pver>\d+(\.\d+)+)"
 
@@ -38,7 +34,7 @@ do_install:append() {
   fi
 }
 
-DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native"
+DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native python3-pyyaml-native gettext-native"
 DEPENDS:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'mesa-native', '', d)}"
 EXTRANATIVEPATH += "chrpath-native"
 PROVIDES = " \
@@ -77,8 +73,8 @@ EXTRA_OEMESON = " \
     -Dplatforms='${@",".join("${PLATFORMS}".split())}' \
 "
 
-EXTRA_OEMESON:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=system', '', d)}"
-EXTRA_OEMESON:append:class-native = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=enabled', '', d)}"
+EXTRA_OEMESON:append:class-target:x86-64 = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=system', '', d)}"
+EXTRA_OEMESON:append:class-native:x86-64 = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=enabled -Dinstall-intel-clc=true', '', d)}"
 
 def strip_comma(s):
     return s.strip(',')
@@ -108,10 +104,10 @@ PACKAGECONFIG[dri3] = "-Ddri3=enabled, -Ddri3=disabled, xorgproto libxshmfence"
 # Vulkan drivers need dri3 enabled
 # amd could be enabled as well but requires gallium-llvm with llvm >= 3.9
 VULKAN_DRIVERS = ""
-VULKAN_DRIVERS:append:x86 = ",intel,amd"
-VULKAN_DRIVERS:append:x86-64 = ",intel,amd"
+VULKAN_DRIVERS:append:x86 = "${@bb.utils.contains('PACKAGECONFIG', ',opencl', ',intel', '', d)},intel_hasvk,amd"
+VULKAN_DRIVERS:append:x86-64 = "${@bb.utils.contains('PACKAGECONFIG', 'opencl', ',intel', '', d)},intel_hasvk,amd"
 # i686 is a 32 bit override for mesa-native
-VULKAN_DRIVERS:append:i686 = ",intel,amd"
+VULKAN_DRIVERS:append:i686 = "${@bb.utils.contains('PACKAGECONFIG', 'opencl', ',intel', '', d)},intel_hasvk,amd"
 VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}"
 VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broadcom', '', d)}"
 VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',swrast', '', d)}"
@@ -137,7 +133,7 @@ PACKAGECONFIG[freedreno-fdperf] = ",,libconfig"
 PACKAGECONFIG[tools] = "-Dtools=${@strip_comma('${TOOLS}')}, -Dtools='', ${TOOLS_DEPS}"
 
 PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false"
-PACKAGECONFIG[glvnd] = "-Dglvnd=true, -Dglvnd=false, libglvnd"
+PACKAGECONFIG[glvnd] = "-Dglvnd=enabled, -Dglvnd=disabled, libglvnd"
 
 # "gles" requires "opengl"
 PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2=disabled"
@@ -145,32 +141,30 @@ PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2
 # "egl" requires "opengl"
 PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled"
 
-# "opencl" requires libclc from meta-clang and spirv-tools from OE-Core
-OPENCL_NATIVE = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', '-Dopencl-native=true', '', d)}"
-PACKAGECONFIG[opencl] = "-Dgallium-opencl=icd -Dopencl-spirv=true ${OPENCL_NATIVE},-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools python3-ply-native"
+# "opencl" requires libclc from meta-clang
+PACKAGECONFIG[opencl] = "-Dgallium-opencl=icd -Dopencl-spirv=true,-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools python3-ply-native"
 
 PACKAGECONFIG[broadcom] = ""
 PACKAGECONFIG[etnaviv] = ",,python3-pycparser-native"
 PACKAGECONFIG[freedreno] = ""
-PACKAGECONFIG[kmsro] = ""
 PACKAGECONFIG[vc4] = ""
 PACKAGECONFIG[v3d] = ""
 PACKAGECONFIG[zink] = ""
 
-GALLIUMDRIVERS = "swrast"
+GALLIUMDRIVERS = "softpipe${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',llvmpipe', '', d)}"
 # gallium swrast was found to crash Xorg on startup in x32 qemu
 GALLIUMDRIVERS:x86-x32 = ""
-GALLIUMDRIVERS:append:x86 = ",i915,iris,crocus"
-GALLIUMDRIVERS:append:x86-64 = ",i915,iris,crocus"
+GALLIUMDRIVERS:append:x86 = ",i915,crocus"
+GALLIUMDRIVERS:append:x86-64 = ",i915,crocus"
 # i686 is a 32 bit override for mesa-native
-GALLIUMDRIVERS:append:i686 = ",i915,iris,crocus"
+GALLIUMDRIVERS:append:i686 = ",i915,crocus"
 
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}"
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}"
-GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'kmsro', ',kmsro', '', d)}"
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'vc4', ',vc4', '', d)}"
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'v3d', ',v3d', '', d)}"
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'zink', ',zink', '', d)}"
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'opencl', ',iris', '', d)}"
 
 # radeonsi requires LLVM
 GALLIUMDRIVERS_RADEONSI = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',radeonsi', '', d)}"
@@ -247,7 +241,7 @@ PACKAGES =+ "libegl-mesa libegl-mesa-dev \
              libopencl-mesa libopencl-mesa-dev \
              libxatracker libxatracker-dev \
              mesa-megadriver mesa-vulkan-drivers \
-             mesa-vdpau-drivers mesa-tools \
+             mesa-vdpau-drivers mesa-gallium-drivers mesa-tools \
             "
 
 do_install:append () {
@@ -262,13 +256,6 @@ do_install:append () {
     rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc
 }
 
-do_install:append:class-native () {
-    if ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'true', 'false', d)}; then
-        install -d ${D}${bindir}
-        install -m0755 ${B}/src/intel/compiler/intel_clc ${D}${bindir}
-    fi
-}
-
 # For the packages that make up the OpenGL interfaces, inject variables so that
 # they don't get Debian-renamed (which would remove the -mesa suffix), and
 # RPROVIDEs/RCONFLICTs on the generic libgl name.
@@ -339,6 +326,7 @@ FILES:mesa-megadriver = "${libdir}/dri/* ${datadir}/drirc.d"
 FILES:mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${libdir}/libpowervr_rogue.so ${datadir}/vulkan"
 FILES:${PN}-vdpau-drivers = "${libdir}/vdpau/*.so.*"
 FILES:libegl-mesa = "${libdir}/libEGL*.so.* ${datadir}/glvnd/egl_vendor.d"
+FILES:mesa-gallium-drivers = "${libdir}/libgallium-*.so"
 FILES:libgbm = "${libdir}/libgbm.so.*"
 FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*"
 FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*"
@@ -366,6 +354,7 @@ FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
 # catch all to get all the tools and data
 FILES:${PN}-tools = "${bindir} ${datadir}"
 ALLOW_EMPTY:${PN}-tools = "1"
+INSANE_SKIP:${PN}-megadriver = "dev-so"
 
 # Fix upgrade path from mesa to mesa-megadriver
 RREPLACES:mesa-megadriver = "mesa"
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#206746): https://lists.openembedded.org/g/openembedded-core/message/206746
Mute This Topic: https://lists.openembedded.org/mt/109411619/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

author
#25 lore raw

Re: [OE-core] [PATCH 18/19] mesa: update 24.0.7 -> 24.2.2

Quoted 4 lines · Alexander Kanavin

This update was as well done with the assumption that clang is not in core, and so disables Intel iris driver (e.g. all modern intel graphics). I'd say leave it out too; we'll get back to it after clang lands.

Sounds good I have included it to make sure
This does not regress

Quoted 660 lines

Alex

Quoted 5 lines · Khem Raj via lists.openembedded.org

From: Markus Volk <[email protected]>

- Remove patches that have been merged upstream
- Remove 0001-Revert-meson-do-not-pull-in-clc-for-clover.patch. Issue

was fixed upstream

Quoted 3 lines

- Update 0001-freedreno-don-t-encode-build-path-into-binaries.patch
- Use 'enabled/disabled' for glvnd instead of deprecated 'true/false'
- swrast gallium driver has been split into 'softpipe' and 'llvmpipe'.

The use of 'swrast'

Quoted 2 lines

has been deprecated.
[

https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-24.2.2/meson.build#L171
]

Quoted 6 lines

- Add package for libgallium and install
- Add python3-pyyaml-native dependency
- Limit intel_clc to x86-64
- Remove OPENCL_NATIVE variable. The according option has been removed from meson_options.txt.
- Meanwhile theres an install option for intel_clc. Use it instead of

manual install

Quoted 1 line

- intel 'iris' and intel 'vulkan' drivers require opencl and thus need

meta-clang layer

Quoted 2 lines
   [https://gitlab.freedesktop.org/mesa/mesa/-/issues/11141]

- Remove gallium kmsro option. This is set depending on

'system_has_kms_drm'

Quoted 1 line
   [

https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-24.2.2/meson.build#L206
]

Quoted 6 lines

- Add vulkan support for older intel graphics

Note: 'kmsro' needs to be removed from mesa.bbappend in meta-raspberrypi

Quoted 9 lines
---
 ...-meson-do-not-pull-in-clc-for-clover.patch | 53 --------------
 ...lude-missing-llvm-IR-header-Module.h.patch | 41 -----------
 .../0001-drisw-fix-build-without-dri3.patch   | 58 ---------------
 ...on-t-encode-build-path-into-binaries.patch | 71 +++++++++++++++----
 ...on-t-try-zink-if-not-enabled-in-mesa.patch | 42 -----------
 meta/recipes-graphics/mesa/mesa.inc           | 49 +++++--------
 6 files changed, 77 insertions(+), 237 deletions(-)
 delete mode 100644

meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch

Quoted 1 line
 delete mode 100644

meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch

Quoted 1 line
 delete mode 100644

meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch

Quoted 1 line
 delete mode 100644

meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch

Quoted 2 lines

diff --git

a/meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch b/meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch

Quoted 3 lines

deleted file mode 100644
index 1711e22585a..00000000000
---

a/meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch

meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch line 7

Quoted 9 lines

+++ /dev/null

meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch deleted +0 -7
@@ -1,53 +0,0 @@
-From 051f41beda540f0ae77b341db01a6de83c9e938a Mon Sep 17 00:00:00 2001
-From: Markus Volk <[email protected]>
-Date: Fri, 8 Mar 2024 15:53:11 +0100
-Subject: [PATCH] Revert "meson: do not pull in clc for clover"
-
-This reverts commit 815a6647eb1383e9dc704ffcc266d85f3b13338a.
-Upstream-Status: Inappropriate [

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27783/diffs?commit_id=a976f2c9f0c07f9e06cc9affd9124b45bc60c2bd
]

Review line 9

Quoted 2 lines
(quoted diff) +0 -2
-
-Once the merge request above was added, it will only be possible to

provide opencl spir-v with gallium-rusticl=true. This is not yet supported in the mesa recipe.

Review line 10

Quoted 1 line
(quoted diff) +0 -1
-For now reverting this commit allows to still use clover with

opencl-spirv, which would otherwise be broken starting from mesa 24.0.2.

Review line 12

Quoted 2 lines
(quoted diff) +0 -2
-
-After it was merged, this patch needs to be removed and rusticl support

will be required

Quoted 41 lines
meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch deleted +0 -41
-
-Signed-off-by: Markus Volk <[email protected]>
----
- meson.build              | 3 ++-
- src/compiler/meson.build | 2 +-
- 2 files changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/meson.build b/meson.build
-index 2db6185..741b5d1 100644
---- a/meson.build
-+++ b/meson.build
-@@ -813,6 +813,7 @@ if _opencl != 'disabled'
-     error('The Clover OpenCL state tracker requires rtti')
-   endif
-
-+  with_clc = true
-   with_gallium_opencl = true
-   with_opencl_icd = _opencl == 'icd'
- else
-@@ -837,7 +838,7 @@ if with_gallium_rusticl
- endif
-
- dep_clc = null_dep
--if with_gallium_opencl or with_clc
-+if with_clc
-   dep_clc = dependency('libclc')
- endif
-
-diff --git a/src/compiler/meson.build b/src/compiler/meson.build
-index 8d73544..1dae56d 100644
---- a/src/compiler/meson.build
-+++ b/src/compiler/meson.build
-@@ -79,7 +79,7 @@ subdir('nir')
-
- subdir('spirv')
-
--if with_clc
-+if with_opencl_spirv
-   subdir('clc')
- endif
- if with_gallium
Quoted 1 line

diff --git

a/meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch b/meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch

Quoted 3 lines

deleted file mode 100644
index 82ad88a079c..00000000000
---

a/meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch

Quoted 4 lines

+++ /dev/null

meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch deleted +0 -2
@@ -1,41 +0,0 @@
-From 777d69cf15b80ab1f109a4936d6e4801c4b0e0f3 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>

meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch line 12

Quoted 10 lines
meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch deleted +0 -10
-Date: Mon, 1 Jul 2024 23:09:29 -0700
-Subject: [PATCH] amd: Include missing llvm IR header Module.h
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-With LLVM-19, Module.h header is not being pulled, which results in
-compile errors e.g.
-
-src/amd/llvm/ac_llvm_helper.cpp:102:10: error: no matching function for

call to ‘unwrap(LLVMOpaqueModule*&)’

Review line 13

Quoted 1 line
(quoted diff) +0 -1
-  102 |

unwrap(module)->setTargetTriple(TM->getTargetTriple().getTriple());

Review line 15

Quoted 2 lines
(quoted diff) +0 -2
-      |    ~~~~~~^~~~~~~~
-In file included from

/mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/IR/Type.h:18,

Review line 16

Quoted 1 line
(quoted diff) +0 -1
-                 from

/mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/IR/DerivedTypes.h:23,

Review line 17

Quoted 1 line
(quoted diff) +0 -1
-                 from

/mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/IR/InstrTypes.h:26,

Review line 18

Quoted 1 line
(quoted diff) +0 -1
-                 from

/mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/Analysis/TargetLibraryInfo.h:14,

meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch

Quoted 3 lines
meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch deleted +0 -3
-                 from ../mesa-24.0.7/src/amd/llvm/ac_llvm_helper.cpp:8:
-
-Its getting the definition from llvm/IR/Type.h instead of Module.h and

caused

meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch

Quoted 3 lines
meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch deleted +0 -3
-confusion to compiler
-
-Upstream-Status: Submitted [

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29993]

meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch

Quoted 6 lines
meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch deleted +0 -6
-Signed-off-by: Khem Raj <[email protected]>
----
- src/amd/llvm/ac_llvm_helper.cpp | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/amd/llvm/ac_llvm_helper.cpp

b/src/amd/llvm/ac_llvm_helper.cpp

Quoted 11 lines
meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch deleted +0 -11
-index 5d065279ad1..af4a50f8409 100644
---- a/src/amd/llvm/ac_llvm_helper.cpp
-+++ b/src/amd/llvm/ac_llvm_helper.cpp
-@@ -8,6 +8,7 @@
- #include <llvm/Analysis/TargetLibraryInfo.h>
- #include <llvm/IR/IRBuilder.h>
- #include <llvm/IR/LegacyPassManager.h>
-+#include <llvm/IR/Module.h>
- #include <llvm/IR/Verifier.h>
- #include <llvm/Target/TargetMachine.h>
- #include <llvm/MC/MCSubtargetInfo.h>
Quoted 1 line

diff --git

a/meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch b/meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch

Quoted 3 lines

deleted file mode 100644
index ab161520906..00000000000
---

a/meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch

meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch line 6

Quoted 8 lines

+++ /dev/null

meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch deleted +0 -6
@@ -1,58 +0,0 @@
-From 4bd15a419e892da843489c374c58c5b29c40b5d6 Mon Sep 17 00:00:00 2001
-From: Romain Naour <[email protected]>
-Date: Tue, 6 Feb 2024 09:47:09 +0100
-Subject: [PATCH 1/2] drisw: fix build without dri3
-
-commit 1887368df41 ("glx/sw: check for modifier support in the kopper

path")

Review line 7

Quoted 1 line
(quoted diff) +0 -1
-added dri3_priv.h header and dri3_check_multibuffer() function in drisw

that

meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch

Quoted 3 lines
meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch deleted +0 -3
-can be build without dri3.
-
-  i686-buildroot-linux-gnu/bin/ld: src/glx/libglx.a.p/drisw_glx.c.o: in

function `driswCreateScreenDriver':

Review line 11

Quoted 1 line
(quoted diff) +0 -1
-  drisw_glx.c:(.text.driswCreateScreenDriver+0x3a0): undefined

reference to `dri3_check_multibuffer'

meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch

Quoted 6 lines
meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch deleted +0 -6
-  collect2: error: ld returned 1 exit status
-
-Add HAVE_DRI3 guard around dri3_priv.h header and the zink code using
-dri3_check_multibuffer().
-
-Fixes: 1887368df41 ("glx/sw: check for modifier support in the kopper

path")

Review line 19

Quoted 2 lines
(quoted diff) +0 -2
-
-Upstream-Status: Submitted [

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478]

Quoted 11 lines
meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch deleted +0 -11
-Signed-off-by: Romain Naour <[email protected]>
-Signed-off-by: Khem Raj <[email protected]>
----
- src/glx/drisw_glx.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
-index 3d3f752..4b19e2d 100644
---- a/src/glx/drisw_glx.c
-+++ b/src/glx/drisw_glx.c
-@@ -32,7 +32,9 @@

meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch

Quoted 10 lines
meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch deleted +0 -10
- #include <dlfcn.h>
- #include "dri_common.h"
- #include "drisw_priv.h"
-+#ifdef HAVE_DRI3
- #include "dri3_priv.h"
-+#endif
- #include <X11/extensions/shmproto.h>
- #include <assert.h>
- #include <vulkan/vulkan_core.h>
-@@ -995,6 +997,7 @@ driswCreateScreenDriver(int screen, struct

glx_display *priv,

meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch

Quoted 8 lines
meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch deleted +0 -8
-        goto handle_error;
-    }
-
-+#ifdef HAVE_DRI3
-    if (pdpyp->zink) {
-       bool err;
-       psc->has_multibuffer = dri3_check_multibuffer(priv->dpy, &err);
-@@ -1005,6 +1008,7 @@ driswCreateScreenDriver(int screen, struct

glx_display *priv,

Quoted 11 lines
meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch deleted +0 -10
-          goto handle_error;
-       }
-    }
-+#endif
-
-    glx_config_destroy_list(psc->base.configs);
-    psc->base.configs = configs;
---
-2.44.0
-

diff --git

a/meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch b/meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch

Quoted 2 lines

index 5975ab4472e..38871b6d11f 100644
---

a/meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch

Quoted 1 line

+++

b/meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch

meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch it manually when running the tests. · line 13

Quoted 8 lines
meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +1 -1
@@ -1,4 +1,4 @@
-From 027ac36756cc75eea9ed4fee135a351af30b35fd Mon Sep 17 00:00:00 2001
+From 66d73feaac088d1a588a44a1780f2eaf4335fccf Mon Sep 17 00:00:00 2001
 From: Dmitry Baryshkov <[email protected]>
 Date: Tue, 16 Jul 2024 12:32:47 +0300
 Subject: [PATCH] freedreno: don't encode build path into binaries
@@ -13,33 +13,76 @@ it manually when running the tests.
 Upstream-Status: Submitted [

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30206]

Quoted 13 lines
meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +6 -2
 Signed-off-by: Dmitry Baryshkov <[email protected]>
 ---
+ meson.build                      | 1 +
+ meson_options.txt                | 7 +++++++
  src/freedreno/afuc/meson.build   | 4 ++++
  src/freedreno/decode/meson.build | 4 +++-
- src/freedreno/meson.build        | 2 +-
- 3 files changed, 8 insertions(+), 2 deletions(-)
+ src/freedreno/meson.build        | 5 ++++-
+ 5 files changed, 19 insertions(+), 2 deletions(-)
 
+diff --git a/meson.build b/meson.build
+index 3bc837813f967..5c94e76649c63 100644

meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch it manually when running the tests.

Quoted 10 lines
meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +10 -0
+--- a/meson.build
++++ b/meson.build
+@@ -76,6 +76,7 @@ if with_tools.contains('all')
+     'imagination',
+   ]
+ endif
++with_tools_for_development = get_option('tools-for-development')
+
+ with_any_vulkan_layers = get_option('vulkan-layers').length() != 0
+ with_intel_tools = with_tools.contains('intel') or

with_tools.contains('intel-ui')

meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch it manually when running the tests.

Quoted 6 lines
meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +6 -0
+diff --git a/meson_options.txt b/meson_options.txt
+index 753bebd961e3f..9bc308b512c13 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -537,6 +537,13 @@ option(
+   description : 'List of tools to build. (Note: `intel-ui` selects

intel)',

meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch it manually when running the tests.

Quoted 7 lines
meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +7 -0
+ )
+
++option(
++  'tools-for-development',
++  type : 'boolean',
++  value : false,
++  description : 'Support running tools from the build tree (for

developers)',

meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch it manually when running the tests.

Quoted 6 lines
meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +5 -0
++)
++
+ option(
+   'power8',
+   type : 'feature',
 diff --git a/src/freedreno/afuc/meson.build

b/src/freedreno/afuc/meson.build

meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch it manually when running the tests.

Quoted 9 lines
meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +2 -3
-index bb7cebf5a748..351cc31ef2de 100644
+index bb7cebf5a748c..351cc31ef2dec 100644
 --- a/src/freedreno/afuc/meson.build
 +++ b/src/freedreno/afuc/meson.build
-@@ -56,6 +56,7 @@ if with_tests
+@@ -56,10 +56,12 @@ if with_tests
    asm_fw = custom_target('afuc_test.fw',
      output: 'afuc_test.fw',
-     command: [asm, '-g', '6',

files('../.gitlab-ci/traces/afuc_test.asm'), '@OUTPUT@'],

Review it manually when running the tests. · line 60

Quoted 1 line
(quoted diff) +1 -0
+     command: [asm, files('../.gitlab-ci/traces/afuc_test.asm'),

'@OUTPUT@'],

meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch it manually when running the tests.

Quoted 5 lines
meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +5 -0
++    env: {'RNN_PATH': rnn_src_path},
+   )
+   asm_fw_a7xx = custom_target('afuc_test_a7xx.fw',
+     output: 'afuc_test_a7xx.fw',
+     command: [asm, files('../.gitlab-ci/traces/afuc_test_a7xx.asm'),

'@OUTPUT@'],

meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch it manually when running the tests.

Quoted 9 lines
meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +1 -2
 +    env: {'RNN_PATH': rnn_src_path},
    )
    test('afuc-asm',
      diff,
-@@ -120,6 +122,7 @@ if cc.sizeof('size_t') > 4
+@@ -120,11 +122,13 @@ if cc.sizeof('size_t') > 4
      disasm_fw = custom_target('afuc_test.asm',
        output: 'afuc_test.asm',
-       command: [disasm, '-u',

files('../.gitlab-ci/reference/afuc_test.fw'), '-g', '630'],

Review it manually when running the tests. · line 73

Quoted 1 line
(quoted diff) +1 -0
+       command: [disasm, '-u',

files('../.gitlab-ci/reference/afuc_test.fw')],

meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch it manually when running the tests.

Quoted 6 lines
meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +6 -0
++      env: {'RNN_PATH': rnn_src_path},
+       capture: true
+     )
+     disasm_fw_a7xx = custom_target('afuc_test_a7xx.asm',
+       output: 'afuc_test_a7xx.asm',
+       command: [disasm, '-u',

files('../.gitlab-ci/reference/afuc_test_a7xx.fw')],

meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch it manually when running the tests.

Quoted 5 lines
meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +0 -0
 +      env: {'RNN_PATH': rnn_src_path},
        capture: true
      )
      test('afuc-disasm',
 diff --git a/src/freedreno/decode/meson.build

b/src/freedreno/decode/meson.build

Quoted 9 lines
meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +1 -1
-index 469eeb4eb597..dfa1c12d0d9f 100644
+index 469eeb4eb5975..915ba11af3b33 100644
 --- a/src/freedreno/decode/meson.build
 +++ b/src/freedreno/decode/meson.build
 @@ -194,6 +194,7 @@ if dep_lua.found() and dep_libarchive.found()
@@ -61,18 +104,20 @@ index 469eeb4eb597..dfa1c12d0d9f 100644
 
      test('crashdec-' + name,
 diff --git a/src/freedreno/meson.build b/src/freedreno/meson.build

meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch index 469eeb4eb597..dfa1c12d0d9f 100644 · line 114

Quoted 10 lines
meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +2 -2
-index 98e49b8fcf0e..145e72597eb9 100644
+index 98e49b8fcf0e9..f8bdc5299841b 100644
 --- a/src/freedreno/meson.build
 +++ b/src/freedreno/meson.build
-@@ -6,7 +6,7 @@ inc_freedreno_rnn = include_directories('rnn')
+@@ -6,7 +6,10 @@ inc_freedreno_rnn = include_directories('rnn')
 
  rnn_src_path = dir_source_root + '/src/freedreno/registers'
  rnn_install_path = get_option('datadir') + '/freedreno/registers'
 -rnn_path = rnn_src_path + ':' + get_option('prefix') + '/' +

rnn_install_path

Quoted 11 lines
meta/recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch +4 -2
 +rnn_path = get_option('prefix') + '/' + rnn_install_path
++if with_tools_for_development
++  rnn_path = rnn_src_path + ':' + rnn_path
++endif
 
  dep_lua = dependency('lua54', 'lua53', 'lua52', 'lua', required: false,
                       allow_fallback: true, version: '>=5.2')
 --
-2.39.2
-
+GitLab
Quoted 1 line

diff --git

a/meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch b/meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch

Quoted 3 lines

deleted file mode 100644
index 036a0b49453..00000000000
---

a/meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch

meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch line 6

Quoted 8 lines

+++ /dev/null

meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch deleted +0 -6
@@ -1,42 +0,0 @@
-From 62495ebb977866c52d5bed8499a547c49f0d9bc1 Mon Sep 17 00:00:00 2001
-From: Romain Naour <[email protected]>
-Date: Tue, 6 Feb 2024 09:47:10 +0100
-Subject: [PATCH 2/2] glxext: don't try zink if not enabled in mesa
-
-Commit 7d9ea77b459 ("glx: add automatic zink fallback loading between

hw and sw drivers")

meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch

Quoted 9 lines
meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch deleted +0 -9
-added an automatic zink fallback even when the zink gallium is not
-enabled at build time.
-
-It leads to unexpected error log while loading drisw driver and
-zink is not installed on the rootfs:
-
-  MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so
-
-Fixes: 7d9ea77b459 ("glx: add automatic zink fallback loading between

hw and sw drivers")

Review line 17

Quoted 2 lines
(quoted diff) +0 -2
-
-Upstream-Status: Submitted [

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478]

Quoted 7 lines
meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch deleted +0 -7
-Signed-off-by: Romain Naour <[email protected]>
-Signed-off-by: Khem Raj <[email protected]>
----
- src/glx/glxext.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/glx/glxext.c b/src/glx/glxext.c

meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch

Quoted 10 lines
meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch deleted +0 -10
-index 05c825a..7a06aa9 100644
---- a/src/glx/glxext.c
-+++ b/src/glx/glxext.c
-@@ -908,9 +908,11 @@ __glXInitialize(Display * dpy)
- #endif /* HAVE_DRI3 */
-       if (!debug_get_bool_option("LIBGL_DRI2_DISABLE", false))
-          dpyPriv->dri2Display = dri2CreateDisplay(dpy);
-+#if defined(HAVE_ZINK)
-       if (!dpyPriv->dri3Display && !dpyPriv->dri2Display)
-          try_zink = !debug_get_bool_option("LIBGL_KOPPER_DISABLE",

false) &&

Review

Quoted 9 lines
meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch deleted +0 -8
-                     !getenv("GALLIUM_DRIVER");
-+#endif /* HAVE_ZINK */
-    }
- #endif /* GLX_USE_DRM */
-    if (glx_direct)
---
-2.44.0
-
(quoted diff) +0 -0

b/meta/recipes-graphics/mesa/mesa.inc

meta/recipes-graphics/mesa/mesa.inc PE = "2" · line 18

Quoted 7 lines

index 9fdf496e8b3..ecea7e94de8 100644

meta/recipes-graphics/mesa/mesa.inc +0 -0
@@ -16,15 +16,11 @@ PE = "2"
 
 SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
 

file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \

meta/recipes-graphics/mesa/mesa.inc PE = "2" · line 20

Quoted 2 lines
meta/recipes-graphics/mesa/mesa.inc +0 -2
-           file://0001-drisw-fix-build-without-dri3.patch \
-

file://0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch \

meta/recipes-graphics/mesa/mesa.inc PE = "2" · line 21

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +0 -1
-           file://0001-Revert-meson-do-not-pull-in-clc-for-clover.patch

\

meta/recipes-graphics/mesa/mesa.inc PE = "2" · line 22

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +0 -1
-

file://0001-amd-Include-missing-llvm-IR-header-Module.h.patch \

Quoted 1 line

file://0001-freedreno-don-t-encode-build-path-into-binaries.patch\

Quoted 3 lines

"

-SRC_URI[sha256sum] =

"7454425f1ed4a6f1b5b107e1672b30c88b22ea0efea000ae2c7d96db93f6c26a"

meta/recipes-graphics/mesa/mesa.inc

Quoted 2 lines
meta/recipes-graphics/mesa/mesa.inc +1 -1
-PV = "24.0.7"
+SRC_URI[sha256sum] =

"fd077d3104edbe459e2b8597d2757ec065f9bd2d620b8c0b9cc88c2bf9891d02"

meta/recipes-graphics/mesa/mesa.inc do_install:append() { · line 41

Quoted 9 lines
meta/recipes-graphics/mesa/mesa.inc +1 -1
+PV = "24.2.2"
 
 UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P<pver>\d+(\.\d+)+)"
@@ -38,7 +34,7 @@ do_install:append() {
   fi
 }
 
-DEPENDS = "expat makedepend-native flex-native bison-native

libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native"

meta/recipes-graphics/mesa/mesa.inc do_install:append() { · line 37

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +1 -0
+DEPENDS = "expat makedepend-native flex-native bison-native

libxml2-native zlib chrpath-replacement-native python3-mako-native python3-pyyaml-native gettext-native"

meta/recipes-graphics/mesa/mesa.inc do_install:append() { · line 38

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +0 -0
 DEPENDS:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG',

'opencl', 'mesa-native', '', d)}"

meta/recipes-graphics/mesa/mesa.inc EXTRA_OEMESON = " \ · line 80

Quoted 7 lines
meta/recipes-graphics/mesa/mesa.inc +0 -1
 EXTRANATIVEPATH += "chrpath-native"
 PROVIDES = " \
@@ -77,8 +73,8 @@ EXTRA_OEMESON = " \
     -Dplatforms='${@",".join("${PLATFORMS}".split())}' \
 "
 
-EXTRA_OEMESON:append:class-target = "

${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=system', '', d)}"

meta/recipes-graphics/mesa/mesa.inc EXTRA_OEMESON = " \ · line 81

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +0 -1
-EXTRA_OEMESON:append:class-native = "

${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=enabled', '', d)}"

meta/recipes-graphics/mesa/mesa.inc EXTRA_OEMESON = " \ · line 76

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +1 -0
+EXTRA_OEMESON:append:class-target:x86-64 = "

${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=system', '', d)}"

meta/recipes-graphics/mesa/mesa.inc EXTRA_OEMESON = " \ · line 77

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +1 -0
+EXTRA_OEMESON:append:class-native:x86-64 = "

${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=enabled -Dinstall-intel-clc=true', '', d)}"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[dri3] = "-Ddri3=enabled,

Quoted 4 lines
meta/recipes-graphics/mesa/mesa.inc +0 -0
 def strip_comma(s):
     return s.strip(',')
@@ -108,10 +104,10 @@ PACKAGECONFIG[dri3] = "-Ddri3=enabled,

-Ddri3=disabled, xorgproto libxshmfence"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[dri3] = "-Ddri3=enabled, · line 105

Quoted 2 lines
meta/recipes-graphics/mesa/mesa.inc +0 -0
 # Vulkan drivers need dri3 enabled
 # amd could be enabled as well but requires gallium-llvm with llvm >=

3.9

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[dri3] = "-Ddri3=enabled, -Ddri3=disabled, xorgproto libxshmfence"

Quoted 4 lines
meta/recipes-graphics/mesa/mesa.inc +1 -2
 VULKAN_DRIVERS = ""
-VULKAN_DRIVERS:append:x86 = ",intel,amd"
-VULKAN_DRIVERS:append:x86-64 = ",intel,amd"
+VULKAN_DRIVERS:append:x86 = "${@bb.utils.contains('PACKAGECONFIG',

',opencl', ',intel', '', d)},intel_hasvk,amd"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[dri3] = "-Ddri3=enabled, · line 108

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +1 -0
+VULKAN_DRIVERS:append:x86-64 = "${@bb.utils.contains('PACKAGECONFIG',

'opencl', ',intel', '', d)},intel_hasvk,amd"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[dri3] = "-Ddri3=enabled, -Ddri3=disabled, xorgproto libxshmfence"

Quoted 3 lines
meta/recipes-graphics/mesa/mesa.inc +1 -1
 # i686 is a 32 bit override for mesa-native
-VULKAN_DRIVERS:append:i686 = ",intel,amd"
+VULKAN_DRIVERS:append:i686 = "${@bb.utils.contains('PACKAGECONFIG',

'opencl', ',intel', '', d)},intel_hasvk,amd"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[dri3] = "-Ddri3=enabled, · line 111

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +0 -0
 VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG',

'freedreno', ',freedreno', '', d)}"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[dri3] = "-Ddri3=enabled, · line 112

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +0 -0
 VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG',

'broadcom', ',broadcom', '', d)}"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[dri3] = "-Ddri3=enabled, · line 113

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +0 -0
 VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG',

'gallium-llvm', ',swrast', '', d)}"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[freedreno-fdperf] = ",,libconfig" · line 133

Quoted 2 lines
meta/recipes-graphics/mesa/mesa.inc +0 -0
@@ -137,7 +133,7 @@ PACKAGECONFIG[freedreno-fdperf] = ",,libconfig"
 PACKAGECONFIG[tools] = "-Dtools=${@strip_comma('${TOOLS}')},

-Dtools='', ${TOOLS_DEPS}"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[freedreno-fdperf] = ",,libconfig"

Quoted 7 lines
meta/recipes-graphics/mesa/mesa.inc +1 -1
 PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false"
-PACKAGECONFIG[glvnd] = "-Dglvnd=true, -Dglvnd=false, libglvnd"
+PACKAGECONFIG[glvnd] = "-Dglvnd=enabled, -Dglvnd=disabled, libglvnd"
 
 # "gles" requires "opengl"
 PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled,

-Dgles1=disabled -Dgles2=disabled"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[gles] = "-Dgles1=enabled

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +0 -0
@@ -145,32 +141,30 @@ PACKAGECONFIG[gles] = "-Dgles1=enabled

-Dgles2=enabled, -Dgles1=disabled -Dgles2

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2

Quoted 5 lines
meta/recipes-graphics/mesa/mesa.inc +0 -2
 # "egl" requires "opengl"
 PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled"
 
-# "opencl" requires libclc from meta-clang and spirv-tools from OE-Core
-OPENCL_NATIVE = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno',

'-Dopencl-native=true', '', d)}"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[gles] = "-Dgles1=enabled · line 150

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +0 -1
-PACKAGECONFIG[opencl] = "-Dgallium-opencl=icd -Dopencl-spirv=true

${OPENCL_NATIVE},-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools python3-ply-native"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[gles] = "-Dgles1=enabled · line 145

Quoted 2 lines
meta/recipes-graphics/mesa/mesa.inc +2 -0
+# "opencl" requires libclc from meta-clang
+PACKAGECONFIG[opencl] = "-Dgallium-opencl=icd

-Dopencl-spirv=true,-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools python3-ply-native"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2

Quoted 11 lines
meta/recipes-graphics/mesa/mesa.inc +1 -2
 PACKAGECONFIG[broadcom] = ""
 PACKAGECONFIG[etnaviv] = ",,python3-pycparser-native"
 PACKAGECONFIG[freedreno] = ""
-PACKAGECONFIG[kmsro] = ""
 PACKAGECONFIG[vc4] = ""
 PACKAGECONFIG[v3d] = ""
 PACKAGECONFIG[zink] = ""
 
-GALLIUMDRIVERS = "swrast"
+GALLIUMDRIVERS = "softpipe${@bb.utils.contains('PACKAGECONFIG',

'gallium-llvm', ',llvmpipe', '', d)}"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2

Quoted 11 lines
meta/recipes-graphics/mesa/mesa.inc +3 -3
 # gallium swrast was found to crash Xorg on startup in x32 qemu
 GALLIUMDRIVERS:x86-x32 = ""
-GALLIUMDRIVERS:append:x86 = ",i915,iris,crocus"
-GALLIUMDRIVERS:append:x86-64 = ",i915,iris,crocus"
+GALLIUMDRIVERS:append:x86 = ",i915,crocus"
+GALLIUMDRIVERS:append:x86-64 = ",i915,crocus"
 # i686 is a 32 bit override for mesa-native
-GALLIUMDRIVERS:append:i686 = ",i915,iris,crocus"
+GALLIUMDRIVERS:append:i686 = ",i915,crocus"
 
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG',

'etnaviv', ',etnaviv', '', d)}"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[gles] = "-Dgles1=enabled · line 162

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +0 -0
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG',

'freedreno', ',freedreno', '', d)}"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[gles] = "-Dgles1=enabled · line 169

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +0 -1
-GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'kmsro',

',kmsro', '', d)}"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[gles] = "-Dgles1=enabled · line 163

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +0 -0
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'vc4',

',vc4', '', d)}"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[gles] = "-Dgles1=enabled · line 164

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +0 -0
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'v3d',

',v3d', '', d)}"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[gles] = "-Dgles1=enabled · line 165

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +0 -0
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'zink',

',zink', '', d)}"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[gles] = "-Dgles1=enabled · line 166

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +1 -0
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'opencl',

',iris', '', d)}"

meta/recipes-graphics/mesa/mesa.inc PACKAGECONFIG[gles] = "-Dgles1=enabled · line 168

Quoted 3 lines
meta/recipes-graphics/mesa/mesa.inc +0 -0
 # radeonsi requires LLVM
 GALLIUMDRIVERS_RADEONSI = "${@bb.utils.contains('PACKAGECONFIG',

'r600', ',radeonsi', '', d)}"

Quoted 10 lines
meta/recipes-graphics/mesa/mesa.inc +1 -1
@@ -247,7 +241,7 @@ PACKAGES =+ "libegl-mesa libegl-mesa-dev \
              libopencl-mesa libopencl-mesa-dev \
              libxatracker libxatracker-dev \
              mesa-megadriver mesa-vulkan-drivers \
-             mesa-vdpau-drivers mesa-tools \
+             mesa-vdpau-drivers mesa-gallium-drivers mesa-tools \
             "
 
 do_install:append () {

meta/recipes-graphics/mesa/mesa.inc do_install:append () { · line 266

Quoted 5 lines
meta/recipes-graphics/mesa/mesa.inc +0 -2
@@ -262,13 +256,6 @@ do_install:append () {
     rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc
 }
 
-do_install:append:class-native () {
-    if ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'true', 'false',

d)}; then

meta/recipes-graphics/mesa/mesa.inc do_install:append () {

Quoted 6 lines
meta/recipes-graphics/mesa/mesa.inc +0 -5
-        install -d ${D}${bindir}
-        install -m0755 ${B}/src/intel/compiler/intel_clc ${D}${bindir}
-    fi
-}
-
 # For the packages that make up the OpenGL interfaces, inject variables

so that

meta/recipes-graphics/mesa/mesa.inc do_install:append () { · line 260

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +0 -0
 # they don't get Debian-renamed (which would remove the -mesa suffix),

and

meta/recipes-graphics/mesa/mesa.inc FILES:mesa-megadriver = "${libdir}/dri/*

Quoted 2 lines
meta/recipes-graphics/mesa/mesa.inc +0 -0
 # RPROVIDEs/RCONFLICTs on the generic libgl name.
@@ -339,6 +326,7 @@ FILES:mesa-megadriver = "${libdir}/dri/*

${datadir}/drirc.d"

meta/recipes-graphics/mesa/mesa.inc FILES:mesa-megadriver = "${libdir}/dri/* · line 326

Quoted 1 line
meta/recipes-graphics/mesa/mesa.inc +0 -0
 FILES:mesa-vulkan-drivers = "${libdir}/libvulkan_*.so

${libdir}/libpowervr_rogue.so ${datadir}/vulkan"

meta/recipes-graphics/mesa/mesa.inc FILES:mesa-megadriver = "${libdir}/dri/* · line 328

Quoted 2 lines
meta/recipes-graphics/mesa/mesa.inc +0 -0
 FILES:${PN}-vdpau-drivers = "${libdir}/vdpau/*.so.*"
 FILES:libegl-mesa = "${libdir}/libEGL*.so.*

${datadir}/glvnd/egl_vendor.d"

meta/recipes-graphics/mesa/mesa.inc FILES:libxatracker-dev = "${libdir}/libxatracker.so

Quoted 5 lines
meta/recipes-graphics/mesa/mesa.inc +1 -0
+FILES:mesa-gallium-drivers = "${libdir}/libgallium-*.so"
 FILES:libgbm = "${libdir}/libgbm.so.*"
 FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*"
 FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*"
@@ -366,6 +354,7 @@ FILES:libxatracker-dev = "${libdir}/libxatracker.so

${libdir}/libxatracker.la \

Quoted 11 lines
meta/recipes-graphics/mesa/mesa.inc +1 -1
 # catch all to get all the tools and data
 FILES:${PN}-tools = "${bindir} ${datadir}"
 ALLOW_EMPTY:${PN}-tools = "1"
+INSANE_SKIP:${PN}-megadriver = "dev-so"
 
 # Fix upgrade path from mesa to mesa-megadriver
 RREPLACES:mesa-megadriver = "mesa"
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group. View/Reply Online (#206746):

https://lists.openembedded.org/g/openembedded-core/message/206746

Quoted 3 lines

Mute This Topic: https://lists.openembedded.org/mt/109411619/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [

[email protected]]

Quoted 2 lines

-=-=-=-=-=-=-=-=-=-=-=-

author
#26 lore raw

PATCH 19/19 mesa: add support for rusticl

In reply to Khem Raj

From: Markus Volk <[email protected]>

---
 ...n.build-workaround-for-rusticl-build.patch | 27 +++++++++++
 ...6da9458c9d0348f2390dc0bea67cf140b1a0.patch | 47 +++++++++++++++++++
 meta/recipes-graphics/mesa/mesa.inc           | 33 +++++++++----
 3 files changed, 97 insertions(+), 10 deletions(-)
 create mode 100644 meta/recipes-graphics/mesa/files/0001-rusticl-meson.build-workaround-for-rusticl-build.patch
 create mode 100644 meta/recipes-graphics/mesa/files/93e96da9458c9d0348f2390dc0bea67cf140b1a0.patch
meta/recipes-graphics/mesa/files/0001-rusticl-meson.build-workaround-for-rusticl-build.patch new file +27 -0
new file mode 100644
index 00000000000..9c953f961d0
@@ -0,0 +1,27 @@
+From b34ee4014ee9e3466ebafbd53745d9f9a13379da Mon Sep 17 00:00:00 2001
+From: Markus Volk <[email protected]>
+Date: Thu, 11 Jul 2024 22:52:16 +0200
+Subject: [PATCH] rusticl/meson.build: workaround for rusticl build
+
+Signed-off-by: Markus Volk <[email protected]>
+
+Upstream-Status: Inappropriate [oe-specific]
+---
+ src/gallium/frontends/rusticl/meson.build | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/gallium/frontends/rusticl/meson.build b/src/gallium/frontends/rusticl/meson.build
+index eef09d8f01e..efac4cab964 100644
+--- a/src/gallium/frontends/rusticl/meson.build
++++ b/src/gallium/frontends/rusticl/meson.build
+@@ -211,6 +211,7 @@ rusticl_llvm_bindings_rs = rust.bindgen(
+   c_args : [
+     rusticl_bindgen_c_args,
+     pre_args,
++   '-I@include@', '-I@include_cpp@', '-I@include_cpp_target_sys@'
+   ],
+   dependencies : [
+     dep_clang,
+-- 
+2.45.2
+
meta/recipes-graphics/mesa/files/93e96da9458c9d0348f2390dc0bea67cf140b1a0.patch new file +47 -0

47 lines not on this page · raw message

meta/recipes-graphics/mesa/mesa.inc +23 -10
index ecea7e94de8..04dec3fddc8 100644
@@ -17,6 +17,8 @@ PE = "2"
 SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
            file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
            file://0001-freedreno-don-t-encode-build-path-into-binaries.patch\
+           file://0001-rusticl-meson.build-workaround-for-rusticl-build.patch \
+           file://93e96da9458c9d0348f2390dc0bea67cf140b1a0.patch \
 "
 
 SRC_URI[sha256sum] = "fd077d3104edbe459e2b8597d2757ec065f9bd2d620b8c0b9cc88c2bf9891d02"
@@ -35,7 +37,7 @@ do_install:append() {
 }
 
 DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native python3-pyyaml-native gettext-native"
-DEPENDS:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'mesa-native', '', d)}"
+DEPENDS:append:class-target = " ${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', ' mesa-native gcc-runtime', '', d)}"
 EXTRANATIVEPATH += "chrpath-native"
 PROVIDES = " \
     ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \
@@ -46,7 +48,7 @@ PROVIDES = " \
     virtual/mesa \
     "
 
-inherit meson pkgconfig python3native gettext features_check
+inherit rust meson pkgconfig python3native gettext features_check
 
 BBCLASSEXTEND = "native nativesdk"
 
@@ -73,8 +75,14 @@ EXTRA_OEMESON = " \
     -Dplatforms='${@",".join("${PLATFORMS}".split())}' \
 "
 
-EXTRA_OEMESON:append:class-target:x86-64 = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=system', '', d)}"
-EXTRA_OEMESON:append:class-native:x86-64 = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=enabled -Dinstall-intel-clc=true', '', d)}"
+EXTRA_OEMESON:append:class-target:x86-64 = " ${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', '-Dintel-clc=system', '', d)}"
+EXTRA_OEMESON:append:class-native:x86-64 = " ${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', '-Dintel-clc=enabled -Dinstall-intel-clc=true -Dgallium-rusticl=false', '', d)}"
+
+do_configure:prepend() {
+	sed -i "s|@include@|${STAGING_INCDIR}|" ${S}/src/gallium/frontends/rusticl/meson.build
+	sed -i "s|@include_cpp@|${STAGING_INCDIR}\/c++\/14.2.0|" ${S}/src/gallium/frontends/rusticl/meson.build
+	sed -i "s|@include_cpp_target_sys@|${STAGING_INCDIR}\/c++\/14.2.0\/${TARGET_SYS}|" ${S}/src/gallium/frontends/rusticl/meson.build
+}
 
 def strip_comma(s):
     return s.strip(',')
@@ -104,10 +112,10 @@ PACKAGECONFIG[dri3] = "-Ddri3=enabled, -Ddri3=disabled, xorgproto libxshmfence"
 # Vulkan drivers need dri3 enabled
 # amd could be enabled as well but requires gallium-llvm with llvm >= 3.9
 VULKAN_DRIVERS = ""
-VULKAN_DRIVERS:append:x86 = "${@bb.utils.contains('PACKAGECONFIG', ',opencl', ',intel', '', d)},intel_hasvk,amd"
-VULKAN_DRIVERS:append:x86-64 = "${@bb.utils.contains('PACKAGECONFIG', 'opencl', ',intel', '', d)},intel_hasvk,amd"
+VULKAN_DRIVERS:append:x86 = "${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', ',intel', '', d)},intel_hasvk,amd"
+VULKAN_DRIVERS:append:x86-64 = "${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', ',intel', '', d)},intel_hasvk,amd"
 # i686 is a 32 bit override for mesa-native
-VULKAN_DRIVERS:append:i686 = "${@bb.utils.contains('PACKAGECONFIG', 'opencl', ',intel', '', d)},intel_hasvk,amd"
+VULKAN_DRIVERS:append:i686 = "${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', ',intel', '', d)},intel_hasvk,amd"
 VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}"
 VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broadcom', '', d)}"
 VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',swrast', '', d)}"
@@ -141,8 +149,10 @@ PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2
 # "egl" requires "opengl"
 PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled"
 
-# "opencl" requires libclc from meta-clang
-PACKAGECONFIG[opencl] = "-Dgallium-opencl=icd -Dopencl-spirv=true,-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools python3-ply-native"
+# "opencl-clover" requires libclc from meta-clang
+PACKAGECONFIG[opencl-clover] = "-Dgallium-opencl=icd -Dopencl-spirv=true,-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools python3-ply-native"
+# "opencl-rusticl" requires libclc, bindgen-cli and clang from meta-clang
+PACKAGECONFIG[opencl-rusticl] = "-Dgallium-rusticl=true,-Dgallium-rusticl=false,libclc bindgen-cli-native python3-ply-native clang"
 
 PACKAGECONFIG[broadcom] = ""
 PACKAGECONFIG[etnaviv] = ",,python3-pycparser-native"
@@ -164,7 +174,7 @@ GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',fre
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'vc4', ',vc4', '', d)}"
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'v3d', ',v3d', '', d)}"
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'zink', ',zink', '', d)}"
-GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'opencl', ',iris', '', d)}"
+GALLIUMDRIVERS:append ="${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', ',iris', '', d)}"
 
 # radeonsi requires LLVM
 GALLIUMDRIVERS_RADEONSI = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',radeonsi', '', d)}"
@@ -239,6 +249,7 @@ PACKAGES =+ "libegl-mesa libegl-mesa-dev \
              libgles2-mesa libgles2-mesa-dev \
              libgles3-mesa libgles3-mesa-dev \
              libopencl-mesa libopencl-mesa-dev \
+             libopencl-rusticl libopencl-rusticl-dev \
              libxatracker libxatracker-dev \
              mesa-megadriver mesa-vulkan-drivers \
              mesa-vdpau-drivers mesa-gallium-drivers mesa-tools \
@@ -333,6 +344,7 @@ FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*"
 FILES:libgl-mesa = "${libdir}/libGL.so.*"
 FILES:libglx-mesa = "${libdir}/libGLX*.so.*"
 FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd"
+FILES:libopencl-rusticl = "${libdir}/libRusticlOpenCL.so.* ${sysconfdir}/OpenCL/vendors/rusticl.icd"
 FILES:libglapi = "${libdir}/libglapi.so.*"
 FILES:libosmesa = "${libdir}/libOSMesa.so.*"
 FILES:libxatracker = "${libdir}/libxatracker.so.*"
@@ -347,6 +359,7 @@ FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/p
 FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
 FILES:libgles3-mesa-dev = "${includedir}/GLES3"
 FILES:libopencl-mesa-dev = "${libdir}/libMesaOpenCL.so"
+FILES:libopencl-rusticl-dev = "${libdir}/libRusticlOpenCL.so"
 FILES:libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
 FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
                           ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \
#27 lore raw

Re: [OE-core] [PATCH 19/19] mesa: add support for rusticl

Thanks for the patchset! This last patch should be left out, as it contains a workaround for an issue that is not full understood, and isn't necessary for the overall clang support or mesa upgrade. We should get back to it once the rest merges into core.

Alex

Quoted 216 lines · Khem Raj via lists.openembedded.org

From: Markus Volk <[email protected]>

---
 ...n.build-workaround-for-rusticl-build.patch | 27 +++++++++++
 ...6da9458c9d0348f2390dc0bea67cf140b1a0.patch | 47 +++++++++++++++++++
 meta/recipes-graphics/mesa/mesa.inc           | 33 +++++++++----
 3 files changed, 97 insertions(+), 10 deletions(-)
 create mode 100644 meta/recipes-graphics/mesa/files/0001-rusticl-meson.build-workaround-for-rusticl-build.patch
 create mode 100644 meta/recipes-graphics/mesa/files/93e96da9458c9d0348f2390dc0bea67cf140b1a0.patch
meta/recipes-graphics/mesa/files/0001-rusticl-meson.build-workaround-for-rusticl-build.patch new file +27 -0
new file mode 100644
index 00000000000..9c953f961d0
@@ -0,0 +1,27 @@
+From b34ee4014ee9e3466ebafbd53745d9f9a13379da Mon Sep 17 00:00:00 2001
+From: Markus Volk <[email protected]>
+Date: Thu, 11 Jul 2024 22:52:16 +0200
+Subject: [PATCH] rusticl/meson.build: workaround for rusticl build
+
+Signed-off-by: Markus Volk <[email protected]>
+
+Upstream-Status: Inappropriate [oe-specific]
+---
+ src/gallium/frontends/rusticl/meson.build | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/gallium/frontends/rusticl/meson.build b/src/gallium/frontends/rusticl/meson.build
+index eef09d8f01e..efac4cab964 100644
+--- a/src/gallium/frontends/rusticl/meson.build
++++ b/src/gallium/frontends/rusticl/meson.build
+@@ -211,6 +211,7 @@ rusticl_llvm_bindings_rs = rust.bindgen(
+   c_args : [
+     rusticl_bindgen_c_args,
+     pre_args,
++   '-I@include@', '-I@include_cpp@', '-I@include_cpp_target_sys@'
+   ],
+   dependencies : [
+     dep_clang,
+--
+2.45.2
+
meta/recipes-graphics/mesa/files/93e96da9458c9d0348f2390dc0bea67cf140b1a0.patch new file +47 -0
new file mode 100644
index 00000000000..9c5c9c75ffb
@@ -0,0 +1,47 @@
+From 93e96da9458c9d0348f2390dc0bea67cf140b1a0 Mon Sep 17 00:00:00 2001
+From: Karol Herbst <[email protected]>
+Date: Sun, 18 Aug 2024 00:08:50 +0200
+Subject: [PATCH] rusticl: do not use CL vector types in bindings and code
+
+Bindgen seems to miscompile them and I kinda thought I've done this
+already in the past, but apparently not.
+
+Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11722
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30710>
+
+Upstream-Status: Backport [https://gitlab.freedesktop.org/mesa/mesa/-/commit/93e96da9458c9d0348f2390dc0bea67cf140b1a0]
+
+Signed-off-by: Markus Volk <[email protected]>
+---
+ src/gallium/frontends/rusticl/api/device.rs | 2 +-
+ src/gallium/frontends/rusticl/meson.build   | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gallium/frontends/rusticl/api/device.rs b/src/gallium/frontends/rusticl/api/device.rs
+index 9793092db5ad4..c1cb7902e0371 100644
+--- a/src/gallium/frontends/rusticl/api/device.rs
++++ b/src/gallium/frontends/rusticl/api/device.rs
+@@ -196,7 +196,7 @@ impl CLInfo<cl_device_info> for cl_device_id {
+             // TODO proper retrival from devices
+             CL_DEVICE_MEM_BASE_ADDR_ALIGN => cl_prop::<cl_uint>(0x1000),
+             CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE => {
+-                cl_prop::<cl_uint>(size_of::<cl_ulong16>() as cl_uint)
++                cl_prop::<cl_uint>(16 * size_of::<cl_ulong>() as cl_uint)
+             }
+             CL_DEVICE_NAME => cl_prop::<&str>(&dev.screen().name()),
+             CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR => cl_prop::<cl_uint>(1),
+diff --git a/src/gallium/frontends/rusticl/meson.build b/src/gallium/frontends/rusticl/meson.build
+index 612e47bfe88e1..1fe75a611444d 100644
+--- a/src/gallium/frontends/rusticl/meson.build
++++ b/src/gallium/frontends/rusticl/meson.build
+@@ -146,6 +146,7 @@ rusticl_opencl_bindings_rs = rust.bindgen(
+     '--raw-line', 'unsafe impl std::marker::Send for _cl_image_desc {}',
+     '--raw-line', 'unsafe impl std::marker::Sync for _cl_image_desc {}',
+     '--allowlist-type', 'cl_.*',
++    '--blocklist-type', '(__)?cl_.*[2348(16)]',
+     '--allowlist-type', 'cl.*_fn',
+     '--allowlist-var', 'CL_.*',
+     # needed for gl_sharing extension
+--
+GitLab
+
meta/recipes-graphics/mesa/mesa.inc +23 -11
index ecea7e94de8..04dec3fddc8 100644
@@ -17,6 +17,8 @@ PE = "2"
 SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
            file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
            file://0001-freedreno-don-t-encode-build-path-into-binaries.patch\
+           file://0001-rusticl-meson.build-workaround-for-rusticl-build.patch \
+           file://93e96da9458c9d0348f2390dc0bea67cf140b1a0.patch \
 "
 
 SRC_URI[sha256sum] = "fd077d3104edbe459e2b8597d2757ec065f9bd2d620b8c0b9cc88c2bf9891d02"
@@ -35,7 +37,7 @@ do_install:append() {
 }
 
 DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native python3-pyyaml-native gettext-native"
-DEPENDS:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'mesa-native', '', d)}"
+DEPENDS:append:class-target = " ${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', ' mesa-native gcc-runtime', '', d)}"
 EXTRANATIVEPATH += "chrpath-native"
 PROVIDES = " \
     ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \
@@ -46,7 +48,7 @@ PROVIDES = " \
     virtual/mesa \
     "
 
-inherit meson pkgconfig python3native gettext features_check
+inherit rust meson pkgconfig python3native gettext features_check
 
 BBCLASSEXTEND = "native nativesdk"
 
@@ -73,8 +75,14 @@ EXTRA_OEMESON = " \
     -Dplatforms='${@",".join("${PLATFORMS}".split())}' \
 "
 
-EXTRA_OEMESON:append:class-target:x86-64 = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=system', '', d)}"
-EXTRA_OEMESON:append:class-native:x86-64 = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=enabled -Dinstall-intel-clc=true', '', d)}"
+EXTRA_OEMESON:append:class-target:x86-64 = " ${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', '-Dintel-clc=system', '', d)}"
+EXTRA_OEMESON:append:class-native:x86-64 = " ${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', '-Dintel-clc=enabled -Dinstall-intel-clc=true -Dgallium-rusticl=false', '', d)}"
+
+do_configure:prepend() {
+       sed -i "s|@include@|${STAGING_INCDIR}|" ${S}/src/gallium/frontends/rusticl/meson.build
+       sed -i "s|@include_cpp@|${STAGING_INCDIR}\/c++\/14.2.0|" ${S}/src/gallium/frontends/rusticl/meson.build
+       sed -i "s|@include_cpp_target_sys@|${STAGING_INCDIR}\/c++\/14.2.0\/${TARGET_SYS}|" ${S}/src/gallium/frontends/rusticl/meson.build
+}
 
 def strip_comma(s):
     return s.strip(',')
@@ -104,10 +112,10 @@ PACKAGECONFIG[dri3] = "-Ddri3=enabled, -Ddri3=disabled, xorgproto libxshmfence"
 # Vulkan drivers need dri3 enabled
 # amd could be enabled as well but requires gallium-llvm with llvm >= 3.9
 VULKAN_DRIVERS = ""
-VULKAN_DRIVERS:append:x86 = "${@bb.utils.contains('PACKAGECONFIG', ',opencl', ',intel', '', d)},intel_hasvk,amd"
-VULKAN_DRIVERS:append:x86-64 = "${@bb.utils.contains('PACKAGECONFIG', 'opencl', ',intel', '', d)},intel_hasvk,amd"
+VULKAN_DRIVERS:append:x86 = "${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', ',intel', '', d)},intel_hasvk,amd"
+VULKAN_DRIVERS:append:x86-64 = "${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', ',intel', '', d)},intel_hasvk,amd"
 # i686 is a 32 bit override for mesa-native
-VULKAN_DRIVERS:append:i686 = "${@bb.utils.contains('PACKAGECONFIG', 'opencl', ',intel', '', d)},intel_hasvk,amd"
+VULKAN_DRIVERS:append:i686 = "${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', ',intel', '', d)},intel_hasvk,amd"
 VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}"
 VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broadcom', '', d)}"
 VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',swrast', '', d)}"
@@ -141,8 +149,10 @@ PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2
 # "egl" requires "opengl"
 PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled"
 
-# "opencl" requires libclc from meta-clang
-PACKAGECONFIG[opencl] = "-Dgallium-opencl=icd -Dopencl-spirv=true,-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools python3-ply-native"
+# "opencl-clover" requires libclc from meta-clang
+PACKAGECONFIG[opencl-clover] = "-Dgallium-opencl=icd -Dopencl-spirv=true,-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools python3-ply-native"
+# "opencl-rusticl" requires libclc, bindgen-cli and clang from meta-clang
+PACKAGECONFIG[opencl-rusticl] = "-Dgallium-rusticl=true,-Dgallium-rusticl=false,libclc bindgen-cli-native python3-ply-native clang"
 
 PACKAGECONFIG[broadcom] = ""
 PACKAGECONFIG[etnaviv] = ",,python3-pycparser-native"
@@ -164,7 +174,7 @@ GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',fre
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'vc4', ',vc4', '', d)}"
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'v3d', ',v3d', '', d)}"
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'zink', ',zink', '', d)}"
-GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'opencl', ',iris', '', d)}"
+GALLIUMDRIVERS:append ="${@bb.utils.contains_any('PACKAGECONFIG', 'opencl-rusticl opencl-clover', ',iris', '', d)}"
 
 # radeonsi requires LLVM
 GALLIUMDRIVERS_RADEONSI = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',radeonsi', '', d)}"
@@ -239,6 +249,7 @@ PACKAGES =+ "libegl-mesa libegl-mesa-dev \
              libgles2-mesa libgles2-mesa-dev \
              libgles3-mesa libgles3-mesa-dev \
              libopencl-mesa libopencl-mesa-dev \
+             libopencl-rusticl libopencl-rusticl-dev \
              libxatracker libxatracker-dev \
              mesa-megadriver mesa-vulkan-drivers \
              mesa-vdpau-drivers mesa-gallium-drivers mesa-tools \
@@ -333,6 +344,7 @@ FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*"
 FILES:libgl-mesa = "${libdir}/libGL.so.*"
 FILES:libglx-mesa = "${libdir}/libGLX*.so.*"
 FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd"
+FILES:libopencl-rusticl = "${libdir}/libRusticlOpenCL.so.* ${sysconfdir}/OpenCL/vendors/rusticl.icd"
 FILES:libglapi = "${libdir}/libglapi.so.*"
 FILES:libosmesa = "${libdir}/libOSMesa.so.*"
 FILES:libxatracker = "${libdir}/libxatracker.so.*"
@@ -347,6 +359,7 @@ FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/p
 FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
 FILES:libgles3-mesa-dev = "${includedir}/GLES3"
 FILES:libopencl-mesa-dev = "${libdir}/libMesaOpenCL.so"
+FILES:libopencl-rusticl-dev = "${libdir}/libRusticlOpenCL.so"
 FILES:libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
 FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
                           ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#206747): https://lists.openembedded.org/g/openembedded-core/message/206747
Mute This Topic: https://lists.openembedded.org/mt/109411620/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#28 lore raw
In reply to Khem Raj
Quoted 8 lines · Khem Raj via lists.openembedded.org

It is added to default distro include file

---
 meta/conf/distro/include/clang.inc | 147
+++++++++++++++++++++++++++++

 1 file changed, 147 insertions(+)

 create mode 100644 meta/conf/distro/include/clang.inc

Thanks for putting this together. Looking at the series, it seems as if it is a copy and paste of meta-clang into OE-Core which isn't really what I think is needed. I think in core, we can strengthen the toolchain abstraction and make some of this a lot cleaner, this would be the time to do it. I think the patchset is a good first step but I wanted to be clear that I think changes are going to be needed. I'd need to do a bit more experimentation to give more specific feedback on that.

Cheers,

Richard

author
#29 lore raw
Quoted 11 lines · Richard Purdie
Quoted 8 lines · Khem Raj via lists.openembedded.org

It is added to default distro include file

---
 meta/conf/distro/include/clang.inc | 147
+++++++++++++++++++++++++++++
 1 file changed, 147 insertions(+)
 create mode 100644 meta/conf/distro/include/clang.inc
Quoted 8 lines

Thanks for putting this together. Looking at the series, it seems as if it is a copy and paste of meta-clang into OE-Core which isn't really what I think is needed. I think in core, we can strengthen the toolchain abstraction and make some of this a lot cleaner, this would be the time to do it. I think the patchset is a good first step but I wanted to be clear that I think changes are going to be needed. I'd need to do a bit more experimentation to give more specific feedback on that.

That is good. I have kept in mind that there are lot of users of clang via meta-clang shipping products and wanted to keep those usecases intact so they can migrate to use this from core
Without a lot of changes least it should result in maintaining it in meta-clang I would not prefer that. Within those bounds we can do the needed changes I will be happy to do that

Quoted 5 lines

Cheers,

Richard

#30 lore raw
In reply to Khem Raj

Hi Khem,

I know I've promised some review of this for a while, sorry it has taken as long. I'd hoped others with an interest in seeing this in core would help but that hasn't been the case so far.

In reading through the patches in this series, it is unfortunately nowhere near ready. I think there is preparation work needed both in core and in meta-clang before this can work.

Above all else, I want to get this right. We have an opportunity to make OE-Core work well with multiple toolchains, not just clang. If we get this wrong, we complicate core and create a mess which it could take years to unravel.

Quoted 22 lines · Khem Raj via lists.openembedded.org

It is added to default distro include file

---
 meta/conf/distro/include/clang.inc | 147 +++++++++++++++++++++++++++++

 1 file changed, 147 insertions(+)

 create mode 100644 meta/conf/distro/include/clang.inc

meta/conf/distro/include/clang.inc new file +8 -0
new file mode 100644
index 00000000000..ce49bbc0ed1
@@ -0,0 +1,147 @@
+# Add the necessary override
+CCACHE_COMPILERCHECK:toolchain-clang ?= "%compiler% -v"
+HOST_CC_ARCH:prepend:toolchain-clang = "-target ${HOST_SYS} "
+CC:toolchain-clang  = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+CXX:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+CPP:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} -E"
+CCLD:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+RANLIB:toolchain-clang = "${HOST_PREFIX}llvm-ranlib"

meta/conf/distro/include/clang.inc line 18

Quoted 10 lines
meta/conf/distro/include/clang.inc new file +10 -0
+AR:toolchain-clang = "${HOST_PREFIX}llvm-ar"
+NM:toolchain-clang = "${HOST_PREFIX}llvm-nm"
+OBJDUMP:toolchain-clang = "${HOST_PREFIX}llvm-objdump"
+OBJCOPY:toolchain-clang = "${HOST_PREFIX}llvm-objcopy"
+STRIP:toolchain-clang = "${HOST_PREFIX}llvm-strip"
+STRINGS:toolchain-clang = "${HOST_PREFIX}llvm-strings"
+READELF:toolchain-clang = "${HOST_PREFIX}llvm-readelf"
+LD:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '${HOST_PREFIX}ld.lld${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}', '${HOST_PREFIX}ld${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}', d)}"
+
+LTO:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'thin-lto', '-flto=thin', '-flto -fuse-ld=lld', d)}"

I think this highlights that these kinds of variables need to move in core to a separate .inc file which is then called something gcc related. We can create a clang file alongside with the different definitions.

We'd then likely to something similar for gcc native vs clang native and the BUILD_* definitions.

Quoted 9 lines
meta/conf/distro/include/clang.inc new file +9 -0
+COMPILER_RT ??= ""
+COMPILER_RT:toolchain-clang:class-native = "-rtlib=libgcc ${UNWINDLIB}"
+COMPILER_RT:armeb = "-rtlib=libgcc ${UNWINDLIB}"
+COMPILER_RT:libc-klibc = "-rtlib=libgcc ${UNWINDLIB}"
+
+UNWINDLIB ??= ""
+UNWINDLIB:toolchain-clang:class-native = "--unwindlib=libgcc"
+UNWINDLIB:armeb = "--unwindlib=libgcc"
+UNWINDLIB_libc-klibc = "--unwindlib=libgcc"

meta/conf/distro/include/clang.inc line 38

Quoted 10 lines
meta/conf/distro/include/clang.inc new file +10 -0
+
+LIBCPLUSPLUS ??= ""
+LIBCPLUSPLUS:armv5 = "-stdlib=libstdc++"
+
+CXXFLAGS:append:toolchain-clang = " ${LIBCPLUSPLUS}"
+LDFLAGS:append:toolchain-clang = " ${COMPILER_RT} ${LIBCPLUSPLUS}"
+
+TUNE_CCARGS:remove:toolchain-clang = "-meb"
+TUNE_CCARGS:remove:toolchain-clang = "-mel"
+TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", " -mbig-endian", " -mlittle-endian", d)}"

I don't want to see :remove in OE-Core. We should be using toolchain- gcc in core to set these instead and have clang versions alongside?

It'd be nice if we can drop from append to += too.

Quoted 26 lines
meta/conf/distro/include/clang.inc new file +26 -0
+
+# Clang does not yet support big.LITTLE performance tunes, so use the LITTLE for tunes
+TUNE_CCARGS:remove:toolchain-clang = "\
+    -mcpu=cortex-a57.cortex-a53${TUNE_CCARGS_MARCH_OPTS} \
+    -mcpu=cortex-a72.cortex-a53${TUNE_CCARGS_MARCH_OPTS} \
+    -mcpu=cortex-a15.cortex-a7${TUNE_CCARGS_MARCH_OPTS} \
+    -mcpu=cortex-a17.cortex-a7${TUNE_CCARGS_MARCH_OPTS} \
+    -mcpu=cortex-a72.cortex-a35${TUNE_CCARGS_MARCH_OPTS} \
+    -mcpu=cortex-a73.cortex-a53${TUNE_CCARGS_MARCH_OPTS} \
+    -mcpu=cortex-a75.cortex-a55${TUNE_CCARGS_MARCH_OPTS} \
+    -mcpu=cortex-a76.cortex-a55${TUNE_CCARGS_MARCH_OPTS}"
+TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa72-cortexa53 cortexa57-cortexa53 cortexa73-cortexa53", " -mcpu=cortex-a53${TUNE_CCARGS_MARCH_OPTS}", "", d)}"
+TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa15-cortexa7 cortexa17-cortexa7", " -mcpu=cortex-a7${TUNE_CCARGS_MARCH_OPTS}", "", d)}"
+TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa72-cortexa35", " -mcpu=cortex-a35${TUNE_CCARGS_MARCH_OPTS}", "", d)}"
+TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa75-cortexa55 cortexa76-cortexa55", " -mcpu=cortex-a55${TUNE_CCARGS_MARCH_OPTS}", "", d)}"
+
+# Workaround for https://github.com/llvm/llvm-project/issues/85699
+# needed for 64bit rpi3/rpi4 machines
+TUNE_CCARGS_MARCH_OPTS:append:toolchain-clang = "${@bb.utils.contains_any("DEFAULTTUNE", "cortexa72 cortexa53", "+nocrypto", "", d)}"
+
+# Clang does not support octeontx2 processor
+TUNE_CCARGS:remove:toolchain-clang = "-mcpu=octeontx2${TUNE_CCARGS_MARCH_OPTS}"
+
+# Reconcile some ppc anamolies
+TUNE_CCARGS:remove:toolchain-clang:powerpc = "-mhard-float -mno-spe"
+TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc64 = " -mlong-double-64"

meta/conf/distro/include/clang.inc line 74

Quoted 10 lines
meta/conf/distro/include/clang.inc new file +10 -0
+TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc64le = " -mlong-double-64"
+TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc = " -mlong-double-64"
+# usrmerge workaround
+TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains("DISTRO_FEATURES", "usrmerge", " --dyld-prefix=/usr", "", d)}"
+
+TUNE_CCARGS:append:toolchain-clang = " -Qunused-arguments"
+
+LDFLAGS:append:toolchain-clang:class-nativesdk:x86-64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-x86-64.so.2"
+LDFLAGS:append:toolchain-clang:class-nativesdk:x86 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux.so.2"
+LDFLAGS:append:toolchain-clang:class-nativesdk:aarch64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-aarch64.so.1"

Does nativesdk with clang relocate properly?

Quoted 15 lines
meta/conf/distro/include/clang.inc new file +15 -0
+LDFLAGS:toolchain-clang:class-nativesdk = "${BUILDSDK_LDFLAGS} \
+                                           -Wl,-rpath-link,${STAGING_LIBDIR}/.. \
+                                           -Wl,-rpath,${libdir}/.. "
+
+# Enable lld globally"
+LDFLAGS:append:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=lld', '', d)}"
+
+# Remove gcc specific -fcanon-prefix-map option, added in gcc-13+
+# clang does not support it yet
+DEBUG_PREFIX_MAP:remove:toolchain-clang = "-fcanon-prefix-map"
+
+# choose between 'gcc' 'clang' an empty '' can be used as well
+TOOLCHAIN ??= "gcc"
+# choose between 'gnu' 'llvm'
+TC_CXX_RUNTIME ??= "gnu"

meta/conf/distro/include/clang.inc line 100

Quoted 10 lines
meta/conf/distro/include/clang.inc new file +10 -0
+# Using gcc or llvm runtime is only available when using clang for compiler
+#TC_CXX_RUNTIME:toolchain-gcc = "gnu"
+TC_CXX_RUNTIME:armeb = "gnu"
+TC_CXX_RUNTIME:armv5 = "gnu"
+
+TOOLCHAIN:class-native = "gcc"
+TOOLCHAIN:class-nativesdk = "gcc"
+TOOLCHAIN:class-cross-canadian = "gcc"
+TOOLCHAIN:class-crosssdk = "gcc"
+TOOLCHAIN:class-cross = "gcc"

Toolchain selection shouldn't be buried in a .inc file. This needs to be higher level.

meta/conf/distro/include/clang.inc line 104

Quoted 3 lines
meta/conf/distro/include/clang.inc new file +3 -0
+OVERRIDES =. "${@['', 'toolchain-${TOOLCHAIN}:']['${TOOLCHAIN}' != '']}"
+OVERRIDES =. "${@['', 'runtime-${TC_CXX_RUNTIME}:']['${TC_CXX_RUNTIME}' != '']}"
+OVERRIDES[vardepsexclude] += "TOOLCHAIN TC_CXX_RUNTIME"

If we are introducing an toolchain override, that is a patch in its own right and it doesn't belong buried in a .inc.

Whilst I can see we'll have to have a toolchain switch, I'm much less sure about a runtime override too.

meta/conf/distro/include/clang.inc line 107

Quoted 2 lines
meta/conf/distro/include/clang.inc new file +2 -0
+YOCTO_ALTERNATE_EXE_PATH:toolchain-clang:class-target = "${STAGING_BINDIR}/llvm-config"
+YOCTO_ALTERNATE_LIBDIR:toolchain-clang:class-target = "/${BASELIB}"

Does this really need to be set globally?

meta/conf/distro/include/clang.inc line 113

Quoted 5 lines
meta/conf/distro/include/clang.inc new file +5 -0
+#YOCTO_ALTERNATE_EXE_PATH:toolchain-clang:class-target[export] = "1"
+#YOCTO_ALTERNATE_LIBDIR:toolchain-clang:class-target[export] = "1"
+
+#DEPENDS:append:toolchain-clang:class-target = " clang-cross-${TARGET_ARCH} "
+#DEPENDS:remove:toolchain-clang:allarch = "clang-cross-${TARGET_ARCH}"

Why the commented out lines?

Quoted 7 lines
meta/conf/distro/include/clang.inc new file +7 -0
+def clang_base_deps(d):
+    ret = ""
+    if not d.getVar('INHIBIT_DEFAULT_DEPS', False):
+        if not oe.utils.inherits(d, 'allarch') :
+            ret += " ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/libc"
+            if (d.getVar('TC_CXX_RUNTIME').find('android') != -1):
+                ret += " ${MLPREFIX}libcxx"

meta/conf/distro/include/clang.inc line 131

Quoted 10 lines
meta/conf/distro/include/clang.inc new file +10 -0
+            else:
+                ret += " virtual/${TARGET_PREFIX}compilerlibs ${MLPREFIX}compiler-rt ${MLPREFIX}libcxx"
+    return ret
+
+BASE_DEFAULT_DEPS:append:class-target:toolchain-clang:class-target = " ${@clang_base_deps(d)}"
+BASE_DEFAULT_DEPS:append:class-native:toolchain-clang:runtime-llvm = " libcxx-native compiler-rt-native"
+BASE_DEFAULT_DEPS:append:class-nativesdk:toolchain-clang:runtime-llvm = " clang-native nativesdk-libcxx nativesdk-compiler-rt"
+
+# do_populate_sysroot needs STRIP
+POPULATESYSROOTDEPS:toolchain-clang:class-target = "${MLPREFIX}clang-cross-${TARGET_ARCH}:do_populate_sysroot"

These kinds of bits should move to the toolchain inc? Maybe parameterise it too? virtual provider?

Quoted 6 lines
meta/conf/distro/include/clang.inc new file +6 -0
+
+cmake_do_generate_toolchain_file:append:toolchain-clang () {
+    cat >> ${WORKDIR}/toolchain.cmake <<EOF
+set( CMAKE_CLANG_TIDY ${HOST_PREFIX}clang-tidy )
+EOF
+    sed -i 's/ -mmusl / /g' ${WORKDIR}/toolchain.cmake

meta/conf/distro/include/clang.inc line 147

Quoted 10 lines
meta/conf/distro/include/clang.inc new file +10 -0
+}
+
+# dump recipes which still use gcc
+#python __anonymous() {
+#    toolchain = d.getVar("TOOLCHAIN")
+#    if not toolchain or toolchain == "clang" or 'class-target' not in d.getVar('OVERRIDES').split(':'):
+#        return
+#    pkgn = d.getVar("PN")
+#    bb.warn("%s - %s" % (pkgn, toolchain))
+#}

Does this comment block really need to be here?

The big problem with the series in general is it is just throwing clang into core as is. I think we need small incremental changes adding pieces step by step and we need to change core to support toolchain selection as a core feature, not a bolt on buried in .inc and class files.

Cheers,

Richard