]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
clang-cross: trim the recipes
authorRoss Burton <ross.burton@arm.com>
Mon, 28 Jul 2025 13:17:51 +0000 (14:17 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 4 Aug 2025 17:04:00 +0000 (18:04 +0100)
As a single clang-native build is a cross-compiler for all targets, this
recipe should simply create target-prefixed symlinks.

As such, it doesn't need to pull in the common clang include files, or
set TOOLCHAIN.

Unsetting PACKAGES isn't needed as cross inherits nopackages.

The sysroot preprocessing is used to stage bindir, but cross recipes
already stage this directory.

There doesn't appear to be a need to copy clang, so these are now linked
too.

SSTATE_SCAN_FILES only works on actual files not symlinks, so setting it
is pointless.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/clang/clang-cross-canadian_git.bb
meta/recipes-devtools/clang/clang-cross_git.bb
meta/recipes-devtools/clang/clang-crosssdk_git.bb

index 0e84d3ac9a39b5622d95b8dd9314f341ce2137b7..c96686157808f1b61c50bebd3e36d59c22498bc4 100644 (file)
@@ -3,21 +3,15 @@
 
 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"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
 SECTION = "devel"
 
 PN = "clang-cross-canadian-${TRANSLATED_TARGET_ARCH}"
-BPN = "clang"
 
-require common-clang.inc
-require common-source.inc
 inherit cross-canadian
 
-DEPENDS += "nativesdk-clang binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} virtual/nativesdk-cross-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"
+DEPENDS = "nativesdk-clang binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} virtual/nativesdk-cross-binutils virtual/nativesdk-libc"
 
 do_install() {
        install -d ${D}${bindir}
@@ -28,10 +22,7 @@ do_install() {
                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
 }
index 99e48522a0b0feb09b90e035a117cda067ca8f1b..bd72ee4e6d7b20f5740df180bc119f15c7f32fae 100644 (file)
@@ -3,39 +3,22 @@
 
 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"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
 SECTION = "devel"
 
 PN = "clang-cross-${TARGET_ARCH}"
-BPN = "clang"
 
-require common-clang.inc
-require common-source.inc
 inherit cross
-TOOLCHAIN = "clang"
-DEPENDS += "clang-native virtual/cross-binutils"
 
-#INHIBIT_PACKAGE_STRIP = "1"
-INHIBIT_SYSROOT_STRIP = "1"
+DEPENDS = "clang-native virtual/cross-binutils"
+
 do_install() {
-        install -d ${D}${bindir}
-       for tool in clang-tidy lld ld.lld llvm-profdata \
+       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
-       install -m 0755 ${STAGING_BINDIR_NATIVE}/clang ${D}${bindir}/${TARGET_PREFIX}clang
-       install -m 0755 ${STAGING_BINDIR_NATIVE}/clang ${D}${bindir}/${TARGET_PREFIX}clang++
-}
-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 = ""
index 234d4635784cd56486752f9b30351c123a5962cf..320579d8f12c2c0c5f8b5a6b67f7f41adabaf2f7 100644 (file)
@@ -3,17 +3,15 @@
 
 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"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
 SECTION = "devel"
 
 PN = "clang-crosssdk-${SDK_SYS}"
-BPN = "clang"
 
-require common-clang.inc
-require common-source.inc
 inherit crosssdk
-TOOLCHAIN = "clang"
-DEPENDS += "clang-native nativesdk-clang-glue virtual/nativesdk-cross-binutils virtual/nativesdk-libc"
+
+DEPENDS = "clang-native nativesdk-clang-glue virtual/nativesdk-cross-binutils virtual/nativesdk-libc"
 
 do_install() {
     install -d ${D}${bindir}
@@ -24,12 +22,7 @@ do_install() {
                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 = ""