Message ID | 20250424-clang-merge-v2-0-0a51d0c1940d@gmail.com |
---|---|
Headers | show |
Series | clang-merge: Bring clang recipes from meta-clang | expand |
On Thu, Apr 24, 2025 at 10:43:21PM -0700, Khem Raj wrote: > Latest mesa 25+ needs libclang during build for tools like mesa_clc, > we enahnced already existing llvm recipe to build pieces of clang as > well, which worked for mesa's needs but broke static clang compiler > provided by meta-clang due to newfound conflicts, since clang is now > built with llvm recipe from core and also by meta-clang and they > compete for same namespace, an attempt to make them co-habit did reveal > more difficulties. Clang compiler from meta-clang is not able to use > llvm libraries from core since they patch them differently. > > This patch series therefore brings clang and all recipes that build from > llvm sources into core. With this changeset, clang recipes can be removed > from meta-clang there is a pull request for that already [1] > As an aside, we only build clang once and use it for meta-clang needs > and core needs. > > With this, meta-clang can depend upon core layer to provide clang and > related recipes, meta-clang will still provide the toolchain policies > around clang based toolchains. Clang compiler from core, while usable > for mesa is not yet fully usable out of box, since we need to workout > the multi-toolchain architecture for core, which will be done in next > phase after this merge. > > [1] https://github.com/kraj/meta-clang/pull/1088 > > Signed-off-by: Khem Raj <raj.khem@gmail.com> With the following lines in local.conf I got the RPROVIDES error: PACKAGECONFIG:append:pn-mesa = " opencl libclc gallium-llvm " PACKAGECONFIG:append:pn-mesa-native = " opencl libclc gallium-llvm " PACKAGECONFIG:append:pn-nativesdk-mesa = " opencl libclc gallium-llvm " $ DISTRO=poky MACHINE=qemux86-64 bitbake mesa ERROR: Nothing RPROVIDES 'spirv-llvm-translator' (but /home/lumag/Projects/RPB/build-rpb/conf/../../layers/openembedded-core/meta/recipes-graphics/mesa/mesa.bb RDEPENDS on or otherwise requires it) NOTE: Runtime target 'spirv-llvm-translator' is unbuildable, removing... Missing or unbuildable dependency chain was: ['spirv-llvm-translator'] ERROR: Required build target 'mesa' has no buildable providers. Missing or unbuildable dependency chain was: ['mesa', 'spirv-llvm-translator'] > --- > Changes in v2: > - Address Feedback from Alex and Dmitry. > - Squash similar commits to reduce number of patches. > - Move native toolchain file generation to cmake bbclass instead of > adding new class > - Fix space/tabs indentation inconsistencies > - Reorder the patch sequence to avoid errors in future git bisects > - Fix use before define string problem in one of the patches > - Link to v1: https://lore.kernel.org/r/20250424-clang-merge-v1-0-5a492a8461aa@gmail.com > > --- > Khem Raj (7): > cmake.bbclass: Enhance to emit a native toolchain cmake file > toolchain/clang: Remove duplicate RANLIB setting > sstatesig: Handle special case of llvm-project-source shared-workdir > multilib.conf: Add llvm-project-source recipe to NON_MULTILIB_RECIPES > kernel-arch.bbclass: Do not use weak assignment for TOOLCHAIN > clang: Merge llvm/clang family recipes from meta-clang > maintainers.inc: Add myself as maintainer for clang family of recipes > > meta/classes-recipe/cmake.bbclass | 58 +++ > meta/classes-recipe/kernel-arch.bbclass | 2 +- > meta/conf/distro/include/maintainers.inc | 11 +- > meta/conf/multilib.conf | 2 +- > meta/conf/toolchain/clang.inc | 1 - > meta/lib/oe/sstatesig.py | 3 + > .../clang/clang-cross-canadian_git.bb | 36 ++ > meta/recipes-devtools/clang/clang-cross_git.bb | 39 ++ > meta/recipes-devtools/clang/clang-crosssdk_git.bb | 33 ++ > ...ind-libunwind-headers-when-LIBCXXABI_LIBU.patch | 60 +++ > ...er-rt-support-a-new-embedded-linux-target.patch | 309 +++++++++++++ > ...-Simplify-cross-compilation.-Don-t-use-na.patch | 44 ++ > ...LibraryInfo-Undefine-libc-functions-if-th.patch | 90 ++++ > ...allow-env-override-of-exe-and-libdir-path.patch | 71 +++ > ...-clang-driver-Check-sysroot-for-ldso-path.patch | 78 ++++ > ...iver-tools.cpp-Add-lssp_nonshared-on-musl.patch | 32 ++ > .../0008-clang-Prepend-trailing-to-sysroot.patch | 39 ++ > ...inside-the-target-sysroot-for-compiler-ru.patch | 41 ++ > ...ang-Define-releative-gcc-installation-dir.patch | 123 +++++ > ...pthread-and-ldl-along-with-lunwind-for-st.patch | 35 ++ > ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 24 + > .../0013-Check-for-atomic-double-intrinsics.patch | 34 ++ > ...configure-for-packages-using-find_package.patch | 2 +- > ...esource-dir-location-for-cross-toolchains.patch | 50 +++ > ...r-Add-dyld-prefix-when-checking-sysroot-f.patch | 79 ++++ > .../0017-clang-Use-python3-in-python-scripts.patch | 35 ++ > ...Insert-anchor-for-adding-OE-distro-vendor.patch | 167 +++++++ > ...-Do-not-use-backtrace-APIs-on-non-glibc-l.patch | 68 +++ > ...86-triple-for-non-debian-multiarch-linux-.patch | 28 ++ > ...0021-libunwind-Added-unw_backtrace-method.patch | 56 +++ > .../0022-lldb-Link-with-libatomic-on-x86.patch | 33 ++ > ...023-compiler-rt-Enable-__int128-for-ppc32.patch | 73 +++ > ...-Do-not-use-cmake-infra-to-detect-libzstd.patch | 62 +++ > ...ler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch | 46 ++ > ...-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch | 43 ++ > ...s-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch | 81 ++++ > ...vm-Add-OE-specific-ABI-triple-for-N32-ABI.patch | 78 ++++ > ...d-libunwind.pc.in-and-llvm-config-scripts.patch | 90 ++++ > ...py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch | 92 ++++ > ...r-rt-Do-not-pass-target-to-clang-compiler.patch | 29 ++ > .../clang/clang/0032-Fix-build-on-ppc64-musl.patch | 97 ++++ > ...d-a-build-option-to-disable-building-dexp.patch | 85 ++++ > ...itter-sort-ClassInfo-lists-by-name-as-we.patch} | 4 +- > ...-remove-LLVM_LDFLAGS-from-ldflags-output.patch} | 12 +- > ...ot-emit-date-and-time-into-generate-files.patch | 37 ++ > .../clang}/spirv-internal-build.patch | 0 > .../clang}/spirv-shared-library.patch | 0 > meta/recipes-devtools/clang/clang_git.bb | 496 +++++++++++++++++++++ > meta/recipes-devtools/clang/common-clang.inc | 24 + > meta/recipes-devtools/clang/common-source.inc | 17 + > meta/recipes-devtools/clang/common.inc | 83 ++++ > .../clang/compiler-rt-sanitizers_git.bb | 139 ++++++ > meta/recipes-devtools/clang/compiler-rt_git.bb | 125 ++++++ > meta/recipes-devtools/clang/libcxx_git.bb | 119 +++++ > meta/recipes-devtools/clang/llvm-project-source.bb | 12 + > .../recipes-devtools/clang/llvm-project-source.inc | 99 ++++ > .../recipes-devtools/clang/nativesdk-clang-glue.bb | 36 ++ > meta/recipes-devtools/clang/openmp_git.bb | 67 +++ > .../0007-llvm-allow-env-override-of-exe-path.patch | 36 -- > meta/recipes-devtools/llvm/llvm/llvm-config | 54 --- > meta/recipes-devtools/llvm/llvm_20.1.2.bb | 233 ---------- > 61 files changed, 3715 insertions(+), 337 deletions(-) > --- > base-commit: c807b703cdfc5dc2c7fe98f55a5d323eb3e1877c > change-id: 20250423-clang-merge-ca9130ae95af > > Best regards, > -- > Khem Raj <raj.khem@gmail.com> > >
On Fri, Apr 25, 2025 at 01:27:45PM +0300, Dmitry Baryshkov wrote: > On Thu, Apr 24, 2025 at 10:43:21PM -0700, Khem Raj wrote: > > Latest mesa 25+ needs libclang during build for tools like mesa_clc, > > we enahnced already existing llvm recipe to build pieces of clang as > > well, which worked for mesa's needs but broke static clang compiler > > provided by meta-clang due to newfound conflicts, since clang is now > > built with llvm recipe from core and also by meta-clang and they > > compete for same namespace, an attempt to make them co-habit did reveal > > more difficulties. Clang compiler from meta-clang is not able to use > > llvm libraries from core since they patch them differently. > > > > This patch series therefore brings clang and all recipes that build from > > llvm sources into core. With this changeset, clang recipes can be removed > > from meta-clang there is a pull request for that already [1] > > As an aside, we only build clang once and use it for meta-clang needs > > and core needs. > > > > With this, meta-clang can depend upon core layer to provide clang and > > related recipes, meta-clang will still provide the toolchain policies > > around clang based toolchains. Clang compiler from core, while usable > > for mesa is not yet fully usable out of box, since we need to workout > > the multi-toolchain architecture for core, which will be done in next > > phase after this merge. > > > > [1] https://github.com/kraj/meta-clang/pull/1088 > > > > Signed-off-by: Khem Raj <raj.khem@gmail.com> > > With the following lines in local.conf I got the RPROVIDES error: > > PACKAGECONFIG:append:pn-mesa = " opencl libclc gallium-llvm " > PACKAGECONFIG:append:pn-mesa-native = " opencl libclc gallium-llvm " > PACKAGECONFIG:append:pn-nativesdk-mesa = " opencl libclc gallium-llvm " > > $ DISTRO=poky MACHINE=qemux86-64 bitbake mesa > > ERROR: Nothing RPROVIDES 'spirv-llvm-translator' (but /home/lumag/Projects/RPB/build-rpb/conf/../../layers/openembedded-core/meta/recipes-graphics/mesa/mesa.bb RDEPENDS on or otherwise requires it) > NOTE: Runtime target 'spirv-llvm-translator' is unbuildable, removing... > Missing or unbuildable dependency chain was: ['spirv-llvm-translator'] > ERROR: Required build target 'mesa' has no buildable providers. > Missing or unbuildable dependency chain was: ['mesa', 'spirv-llvm-translator'] After adding the RPROVIDES for libclc and spirv-llvm-translator, the same command fails with: ERROR: mesa-2_25.0.2-r0 do_package_qa: QA Issue: File /usr/lib/libMesaOpenCL.so.1.0.0 in package libopencl-mesa contains reference to TMPDIR [buildpaths] ERROR: mesa-2_25.0.2-r0 do_package_qa: Fatal QA errors were found, failing task. ERROR: Logfile of failure stored in: /home/lumag/Projects/RPB/build-rpb/tmp-poky/work/core2-64-poky-linux/mesa/25.0.2/temp/log.do_package_qa.3491435 ERROR: Task (/home/lumag/Projects/RPB/build-rpb/conf/../../layers/openembedded-core/meta/recipes-graphics/mesa/mesa.bb:do_package_qa) failed with exit code '1'
On Fri, Apr 25, 2025 at 02:04:53PM +0300, Dmitry Baryshkov wrote: > On Fri, Apr 25, 2025 at 01:27:45PM +0300, Dmitry Baryshkov wrote: > > On Thu, Apr 24, 2025 at 10:43:21PM -0700, Khem Raj wrote: > > > Latest mesa 25+ needs libclang during build for tools like mesa_clc, > > > we enahnced already existing llvm recipe to build pieces of clang as > > > well, which worked for mesa's needs but broke static clang compiler > > > provided by meta-clang due to newfound conflicts, since clang is now > > > built with llvm recipe from core and also by meta-clang and they > > > compete for same namespace, an attempt to make them co-habit did reveal > > > more difficulties. Clang compiler from meta-clang is not able to use > > > llvm libraries from core since they patch them differently. > > > > > > This patch series therefore brings clang and all recipes that build from > > > llvm sources into core. With this changeset, clang recipes can be removed > > > from meta-clang there is a pull request for that already [1] > > > As an aside, we only build clang once and use it for meta-clang needs > > > and core needs. > > > > > > With this, meta-clang can depend upon core layer to provide clang and > > > related recipes, meta-clang will still provide the toolchain policies > > > around clang based toolchains. Clang compiler from core, while usable > > > for mesa is not yet fully usable out of box, since we need to workout > > > the multi-toolchain architecture for core, which will be done in next > > > phase after this merge. > > > > > > [1] https://github.com/kraj/meta-clang/pull/1088 > > > > > > Signed-off-by: Khem Raj <raj.khem@gmail.com> > > > > With the following lines in local.conf I got the RPROVIDES error: > > > > PACKAGECONFIG:append:pn-mesa = " opencl libclc gallium-llvm " > > PACKAGECONFIG:append:pn-mesa-native = " opencl libclc gallium-llvm " > > PACKAGECONFIG:append:pn-nativesdk-mesa = " opencl libclc gallium-llvm " > > > > $ DISTRO=poky MACHINE=qemux86-64 bitbake mesa > > > > ERROR: Nothing RPROVIDES 'spirv-llvm-translator' (but /home/lumag/Projects/RPB/build-rpb/conf/../../layers/openembedded-core/meta/recipes-graphics/mesa/mesa.bb RDEPENDS on or otherwise requires it) > > NOTE: Runtime target 'spirv-llvm-translator' is unbuildable, removing... > > Missing or unbuildable dependency chain was: ['spirv-llvm-translator'] > > ERROR: Required build target 'mesa' has no buildable providers. > > Missing or unbuildable dependency chain was: ['mesa', 'spirv-llvm-translator'] > > After adding the RPROVIDES for libclc and spirv-llvm-translator, the > same command fails with: > > ERROR: mesa-2_25.0.2-r0 do_package_qa: QA Issue: File /usr/lib/libMesaOpenCL.so.1.0.0 in package libopencl-mesa contains reference to TMPDIR [buildpaths] > ERROR: mesa-2_25.0.2-r0 do_package_qa: Fatal QA errors were found, failing task. > ERROR: Logfile of failure stored in: /home/lumag/Projects/RPB/build-rpb/tmp-poky/work/core2-64-poky-linux/mesa/25.0.2/temp/log.do_package_qa.3491435 > ERROR: Task (/home/lumag/Projects/RPB/build-rpb/conf/../../layers/openembedded-core/meta/recipes-graphics/mesa/mesa.bb:do_package_qa) failed with exit code '1' As with the v1, building with the RPROVIDES and PACKAGECONFIG being set for poky/qemuarm64 fails with: /home/lumag/Projects/RPB/build-rpb/tmp-poky/work/cortexa57-poky-linux/mesa/25.0.2/recipe-sysroot/usr/include/llvm/ADT/DenseMapInfo.h:17:10: fatal error: 'cassert' file not f ound Unable to generate bindings: clang diagnosed error: /home/lumag/Projects/RPB/build-rpb/tmp-poky/work/cortexa57-poky-linux/mesa/25.0.2/recipe-sysroot/usr/include/llvm/ADT/Den seMapInfo.h:17:10: fatal error: 'cassert' file not found
On 4/25/25 4:18 AM, Dmitry Baryshkov wrote: > On Fri, Apr 25, 2025 at 02:04:53PM +0300, Dmitry Baryshkov wrote: >> On Fri, Apr 25, 2025 at 01:27:45PM +0300, Dmitry Baryshkov wrote: >>> On Thu, Apr 24, 2025 at 10:43:21PM -0700, Khem Raj wrote: >>>> Latest mesa 25+ needs libclang during build for tools like mesa_clc, >>>> we enahnced already existing llvm recipe to build pieces of clang as >>>> well, which worked for mesa's needs but broke static clang compiler >>>> provided by meta-clang due to newfound conflicts, since clang is now >>>> built with llvm recipe from core and also by meta-clang and they >>>> compete for same namespace, an attempt to make them co-habit did reveal >>>> more difficulties. Clang compiler from meta-clang is not able to use >>>> llvm libraries from core since they patch them differently. >>>> >>>> This patch series therefore brings clang and all recipes that build from >>>> llvm sources into core. With this changeset, clang recipes can be removed >>>> from meta-clang there is a pull request for that already [1] >>>> As an aside, we only build clang once and use it for meta-clang needs >>>> and core needs. >>>> >>>> With this, meta-clang can depend upon core layer to provide clang and >>>> related recipes, meta-clang will still provide the toolchain policies >>>> around clang based toolchains. Clang compiler from core, while usable >>>> for mesa is not yet fully usable out of box, since we need to workout >>>> the multi-toolchain architecture for core, which will be done in next >>>> phase after this merge. >>>> >>>> [1] https://github.com/kraj/meta-clang/pull/1088 >>>> >>>> Signed-off-by: Khem Raj <raj.khem@gmail.com> >>> >>> With the following lines in local.conf I got the RPROVIDES error: >>> >>> PACKAGECONFIG:append:pn-mesa = " opencl libclc gallium-llvm " >>> PACKAGECONFIG:append:pn-mesa-native = " opencl libclc gallium-llvm " >>> PACKAGECONFIG:append:pn-nativesdk-mesa = " opencl libclc gallium-llvm " >>> >>> $ DISTRO=poky MACHINE=qemux86-64 bitbake mesa >>> >>> ERROR: Nothing RPROVIDES 'spirv-llvm-translator' (but /home/lumag/Projects/RPB/build-rpb/conf/../../layers/openembedded-core/meta/recipes-graphics/mesa/mesa.bb RDEPENDS on or otherwise requires it) >>> NOTE: Runtime target 'spirv-llvm-translator' is unbuildable, removing... >>> Missing or unbuildable dependency chain was: ['spirv-llvm-translator'] >>> ERROR: Required build target 'mesa' has no buildable providers. >>> Missing or unbuildable dependency chain was: ['mesa', 'spirv-llvm-translator'] >> >> After adding the RPROVIDES for libclc and spirv-llvm-translator, the >> same command fails with: >> >> ERROR: mesa-2_25.0.2-r0 do_package_qa: QA Issue: File /usr/lib/libMesaOpenCL.so.1.0.0 in package libopencl-mesa contains reference to TMPDIR [buildpaths] I can see this on qemux86-64 as well. >> ERROR: mesa-2_25.0.2-r0 do_package_qa: Fatal QA errors were found, failing task. >> ERROR: Logfile of failure stored in: /home/lumag/Projects/RPB/build-rpb/tmp-poky/work/core2-64-poky-linux/mesa/25.0.2/temp/log.do_package_qa.3491435 >> ERROR: Task (/home/lumag/Projects/RPB/build-rpb/conf/../../layers/openembedded-core/meta/recipes-graphics/mesa/mesa.bb:do_package_qa) failed with exit code '1' > > As with the v1, building with the RPROVIDES and PACKAGECONFIG being set > for poky/qemuarm64 fails with: > > /home/lumag/Projects/RPB/build-rpb/tmp-poky/work/cortexa57-poky-linux/mesa/25.0.2/recipe-sysroot/usr/include/llvm/ADT/DenseMapInfo.h:17:10: fatal error: 'cassert' file not f > ound > Unable to generate bindings: clang diagnosed error: /home/lumag/Projects/RPB/build-rpb/tmp-poky/work/cortexa57-poky-linux/mesa/25.0.2/recipe-sysroot/usr/include/llvm/ADT/Den > seMapInfo.h:17:10: fatal error: 'cassert' file not found > this header comes from C++ runtime package either libstdc++ or libcxx, do you still see this with v2 series ?
On 26/04/2025 00:18, Khem Raj wrote: > On 4/25/25 4:18 AM, Dmitry Baryshkov wrote: >> On Fri, Apr 25, 2025 at 02:04:53PM +0300, Dmitry Baryshkov wrote: >>> On Fri, Apr 25, 2025 at 01:27:45PM +0300, Dmitry Baryshkov wrote: >>>> On Thu, Apr 24, 2025 at 10:43:21PM -0700, Khem Raj wrote: >>>>> Latest mesa 25+ needs libclang during build for tools like mesa_clc, >>>>> we enahnced already existing llvm recipe to build pieces of clang as >>>>> well, which worked for mesa's needs but broke static clang compiler >>>>> provided by meta-clang due to newfound conflicts, since clang is now >>>>> built with llvm recipe from core and also by meta-clang and they >>>>> compete for same namespace, an attempt to make them co-habit did >>>>> reveal >>>>> more difficulties. Clang compiler from meta-clang is not able to use >>>>> llvm libraries from core since they patch them differently. >>>>> >>>>> This patch series therefore brings clang and all recipes that build >>>>> from >>>>> llvm sources into core. With this changeset, clang recipes can be >>>>> removed >>>>> from meta-clang there is a pull request for that already [1] >>>>> As an aside, we only build clang once and use it for meta-clang needs >>>>> and core needs. >>>>> >>>>> With this, meta-clang can depend upon core layer to provide clang and >>>>> related recipes, meta-clang will still provide the toolchain policies >>>>> around clang based toolchains. Clang compiler from core, while usable >>>>> for mesa is not yet fully usable out of box, since we need to workout >>>>> the multi-toolchain architecture for core, which will be done in next >>>>> phase after this merge. >>>>> >>>>> [1] https://github.com/kraj/meta-clang/pull/1088 >>>>> >>>>> Signed-off-by: Khem Raj <raj.khem@gmail.com> >>>> >>>> With the following lines in local.conf I got the RPROVIDES error: >>>> >>>> PACKAGECONFIG:append:pn-mesa = " opencl libclc gallium-llvm " >>>> PACKAGECONFIG:append:pn-mesa-native = " opencl libclc gallium-llvm " >>>> PACKAGECONFIG:append:pn-nativesdk-mesa = " opencl libclc gallium-llvm " >>>> >>>> $ DISTRO=poky MACHINE=qemux86-64 bitbake mesa >>>> >>>> ERROR: Nothing RPROVIDES 'spirv-llvm-translator' (but /home/lumag/ >>>> Projects/RPB/build-rpb/conf/../../layers/openembedded-core/meta/ >>>> recipes-graphics/mesa/mesa.bb RDEPENDS on or otherwise requires it) >>>> NOTE: Runtime target 'spirv-llvm-translator' is unbuildable, >>>> removing... >>>> Missing or unbuildable dependency chain was: ['spirv-llvm-translator'] >>>> ERROR: Required build target 'mesa' has no buildable providers. >>>> Missing or unbuildable dependency chain was: ['mesa', 'spirv-llvm- >>>> translator'] >>> >>> After adding the RPROVIDES for libclc and spirv-llvm-translator, the >>> same command fails with: >>> >>> ERROR: mesa-2_25.0.2-r0 do_package_qa: QA Issue: File /usr/lib/ >>> libMesaOpenCL.so.1.0.0 in package libopencl-mesa contains reference >>> to TMPDIR [buildpaths] > > I can see this on qemux86-64 as well. > >>> ERROR: mesa-2_25.0.2-r0 do_package_qa: Fatal QA errors were found, >>> failing task. >>> ERROR: Logfile of failure stored in: /home/lumag/Projects/RPB/build- >>> rpb/tmp-poky/work/core2-64-poky-linux/mesa/25.0.2/temp/ >>> log.do_package_qa.3491435 >>> ERROR: Task (/home/lumag/Projects/RPB/build-rpb/conf/../../layers/ >>> openembedded-core/meta/recipes-graphics/mesa/mesa.bb:do_package_qa) >>> failed with exit code '1' >> >> As with the v1, building with the RPROVIDES and PACKAGECONFIG being set >> for poky/qemuarm64 fails with: >> >> /home/lumag/Projects/RPB/build-rpb/tmp-poky/work/cortexa57-poky-linux/ >> mesa/25.0.2/recipe-sysroot/usr/include/llvm/ADT/DenseMapInfo.h:17:10: >> fatal error: 'cassert' file not f >> ound >> Unable to generate bindings: clang diagnosed error: /home/lumag/ >> Projects/RPB/build-rpb/tmp-poky/work/cortexa57-poky-linux/mesa/25.0.2/ >> recipe-sysroot/usr/include/llvm/ADT/Den >> seMapInfo.h:17:10: fatal error: 'cassert' file not found >> > > this header comes from C++ runtime package either libstdc++ or libcxx, > do you still see this with v2 series ? Yes, I've been running the test against v2 + RPROVIDES
Latest mesa 25+ needs libclang during build for tools like mesa_clc, we enahnced already existing llvm recipe to build pieces of clang as well, which worked for mesa's needs but broke static clang compiler provided by meta-clang due to newfound conflicts, since clang is now built with llvm recipe from core and also by meta-clang and they compete for same namespace, an attempt to make them co-habit did reveal more difficulties. Clang compiler from meta-clang is not able to use llvm libraries from core since they patch them differently. This patch series therefore brings clang and all recipes that build from llvm sources into core. With this changeset, clang recipes can be removed from meta-clang there is a pull request for that already [1] As an aside, we only build clang once and use it for meta-clang needs and core needs. With this, meta-clang can depend upon core layer to provide clang and related recipes, meta-clang will still provide the toolchain policies around clang based toolchains. Clang compiler from core, while usable for mesa is not yet fully usable out of box, since we need to workout the multi-toolchain architecture for core, which will be done in next phase after this merge. [1] https://github.com/kraj/meta-clang/pull/1088 Signed-off-by: Khem Raj <raj.khem@gmail.com> --- Changes in v2: - Address Feedback from Alex and Dmitry. - Squash similar commits to reduce number of patches. - Move native toolchain file generation to cmake bbclass instead of adding new class - Fix space/tabs indentation inconsistencies - Reorder the patch sequence to avoid errors in future git bisects - Fix use before define string problem in one of the patches - Link to v1: https://lore.kernel.org/r/20250424-clang-merge-v1-0-5a492a8461aa@gmail.com --- Khem Raj (7): cmake.bbclass: Enhance to emit a native toolchain cmake file toolchain/clang: Remove duplicate RANLIB setting sstatesig: Handle special case of llvm-project-source shared-workdir multilib.conf: Add llvm-project-source recipe to NON_MULTILIB_RECIPES kernel-arch.bbclass: Do not use weak assignment for TOOLCHAIN clang: Merge llvm/clang family recipes from meta-clang maintainers.inc: Add myself as maintainer for clang family of recipes meta/classes-recipe/cmake.bbclass | 58 +++ meta/classes-recipe/kernel-arch.bbclass | 2 +- meta/conf/distro/include/maintainers.inc | 11 +- meta/conf/multilib.conf | 2 +- meta/conf/toolchain/clang.inc | 1 - meta/lib/oe/sstatesig.py | 3 + .../clang/clang-cross-canadian_git.bb | 36 ++ meta/recipes-devtools/clang/clang-cross_git.bb | 39 ++ meta/recipes-devtools/clang/clang-crosssdk_git.bb | 33 ++ ...ind-libunwind-headers-when-LIBCXXABI_LIBU.patch | 60 +++ ...er-rt-support-a-new-embedded-linux-target.patch | 309 +++++++++++++ ...-Simplify-cross-compilation.-Don-t-use-na.patch | 44 ++ ...LibraryInfo-Undefine-libc-functions-if-th.patch | 90 ++++ ...allow-env-override-of-exe-and-libdir-path.patch | 71 +++ ...-clang-driver-Check-sysroot-for-ldso-path.patch | 78 ++++ ...iver-tools.cpp-Add-lssp_nonshared-on-musl.patch | 32 ++ .../0008-clang-Prepend-trailing-to-sysroot.patch | 39 ++ ...inside-the-target-sysroot-for-compiler-ru.patch | 41 ++ ...ang-Define-releative-gcc-installation-dir.patch | 123 +++++ ...pthread-and-ldl-along-with-lunwind-for-st.patch | 35 ++ ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 24 + .../0013-Check-for-atomic-double-intrinsics.patch | 34 ++ ...configure-for-packages-using-find_package.patch | 2 +- ...esource-dir-location-for-cross-toolchains.patch | 50 +++ ...r-Add-dyld-prefix-when-checking-sysroot-f.patch | 79 ++++ .../0017-clang-Use-python3-in-python-scripts.patch | 35 ++ ...Insert-anchor-for-adding-OE-distro-vendor.patch | 167 +++++++ ...-Do-not-use-backtrace-APIs-on-non-glibc-l.patch | 68 +++ ...86-triple-for-non-debian-multiarch-linux-.patch | 28 ++ ...0021-libunwind-Added-unw_backtrace-method.patch | 56 +++ .../0022-lldb-Link-with-libatomic-on-x86.patch | 33 ++ ...023-compiler-rt-Enable-__int128-for-ppc32.patch | 73 +++ ...-Do-not-use-cmake-infra-to-detect-libzstd.patch | 62 +++ ...ler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch | 46 ++ ...-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch | 43 ++ ...s-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch | 81 ++++ ...vm-Add-OE-specific-ABI-triple-for-N32-ABI.patch | 78 ++++ ...d-libunwind.pc.in-and-llvm-config-scripts.patch | 90 ++++ ...py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch | 92 ++++ ...r-rt-Do-not-pass-target-to-clang-compiler.patch | 29 ++ .../clang/clang/0032-Fix-build-on-ppc64-musl.patch | 97 ++++ ...d-a-build-option-to-disable-building-dexp.patch | 85 ++++ ...itter-sort-ClassInfo-lists-by-name-as-we.patch} | 4 +- ...-remove-LLVM_LDFLAGS-from-ldflags-output.patch} | 12 +- ...ot-emit-date-and-time-into-generate-files.patch | 37 ++ .../clang}/spirv-internal-build.patch | 0 .../clang}/spirv-shared-library.patch | 0 meta/recipes-devtools/clang/clang_git.bb | 496 +++++++++++++++++++++ meta/recipes-devtools/clang/common-clang.inc | 24 + meta/recipes-devtools/clang/common-source.inc | 17 + meta/recipes-devtools/clang/common.inc | 83 ++++ .../clang/compiler-rt-sanitizers_git.bb | 139 ++++++ meta/recipes-devtools/clang/compiler-rt_git.bb | 125 ++++++ meta/recipes-devtools/clang/libcxx_git.bb | 119 +++++ meta/recipes-devtools/clang/llvm-project-source.bb | 12 + .../recipes-devtools/clang/llvm-project-source.inc | 99 ++++ .../recipes-devtools/clang/nativesdk-clang-glue.bb | 36 ++ meta/recipes-devtools/clang/openmp_git.bb | 67 +++ .../0007-llvm-allow-env-override-of-exe-path.patch | 36 -- meta/recipes-devtools/llvm/llvm/llvm-config | 54 --- meta/recipes-devtools/llvm/llvm_20.1.2.bb | 233 ---------- 61 files changed, 3715 insertions(+), 337 deletions(-) --- base-commit: c807b703cdfc5dc2c7fe98f55a5d323eb3e1877c change-id: 20250423-clang-merge-ca9130ae95af Best regards,