From: Martin Jansa Date: Sat, 1 Apr 2023 16:28:22 +0000 (+0200) Subject: tcmode-default.inc: Add LLVM_PREFERRED_VERSION X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33c9100bec7dc062f9bdd88cae95c7e0fb974061;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git tcmode-default.inc: Add LLVM_PREFERRED_VERSION * Allow to independently set P_V for llvm* recipes with new LLVM_PREFERRED_VERSION and actual llvm version used in other places with existing LLVMVERSION variable LLVM_PREFERRED_VERSION is used only to set PREFERRED_VERSION of llvm recipes and you might need to change it only if your layer provides another set of llvm recipes with different version. LLVMVERSION is the actual version of LLVM used during the build (and it can be different from llvm recipes, e.g. when LLVM is provided by clang recipes based on PREFERRED_PROVIDER setting and meta-clang already sets LLVMVERSION in layer.conf). PREFERRED_VERSION_llvm doesn't affect version of clang recipes even when clang provides llvm, only PREFERRED_VERSION_clang would affect that. * This is needed for meta-clang which provides different llvm version from clang recipes, see: https://github.com/kraj/meta-clang/pull/766 https://lists.openembedded.org/g/bitbake-devel/message/14521 * as reported in: https://lists.openembedded.org/g/bitbake-devel/message/14523 the other places in kirkstone and langdale which use LLVMVERSION (which doesn't have to be the same as LLVM_PREFERRED_VERSION) are: meta/classes-recipe/meson.bbclass:llvm-config = 'llvm-config${LLVMVERSION}' meta/recipes-graphics/mesa/mesa.inc:MESA_LLVM_RELEASE ?= "${LLVMVERSION}" these were removed in mickledore, but there are other places which use LLVMVERSION as the actual LLVM version as reported in: https://github.com/kraj/meta-clang/pull/766#pullrequestreview-1349170591: meta-intel/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.12812.24.bb: -DIGC_OPTION__LLVM_PREFERRED_VERSION=${LLVMVERSION} \ meta-intel/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_14.0.0.bb: -DPREFERRED_LLVM_VERSION=${LLVMVERSION} \ meta-intel/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_15.0.0.bb: -DPREFERRED_LLVM_VERSION=${LLVMVERSION} \ meta-intel/conf/machine/include/meta-intel.inc:PREFERRED_VERSION_opencl-clang ?= "${@bb.utils.contains('LLVMVERSION', '14.0.3', '14.0.0', '15.0.0', d)}" meta-intel/conf/machine/include/meta-intel.inc:PREFERRED_VERSION_opencl-clang-native ?= "${@bb.utils.contains('LLVMVERSION', '14.0.3', '14.0.0', '15.0.0', d)}" meta-riscv/recipes-graphics/mesa/mesa-pvr.inc:MESA_LLVM_RELEASE ?= "${LLVMVERSION}" meta-browser/meta-chromium/recipes-browser/chromium/chromium-gn.inc:# Check the LLVMVERSION defined in the meta-clang layer. Given Chromium is meta-browser/meta-chromium/recipes-browser/chromium/chromium-gn.inc:# developed using new C++ features, the LLVMVERSION has to be >= 12. Otherwise, meta-browser/meta-chromium/recipes-browser/chromium/chromium-gn.inc: llvm_version = d.getVar('LLVMVERSION', False) meta-browser/meta-chromium/recipes-browser/chromium/chromium-gn.inc: bb.fatal("Your LLVMVERSION (%s) is lower than the minimum required " meta-browser/meta-chromium/recipes-browser/chromium/chromium-gn.inc: "LLVMVERSION (%s). If you are using dunfell, make sure you " meta-clang/conf/layer.conf:LLVMVERSION = "16.0.0" meta-clang/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb: -DBASE_LLVM_VERSION=${LLVMVERSION} \ meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.26.0.bb: -DLLVM_PACKAGE_VERSION=${LLVMVERSION} \ meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.17.0.bb: pvsplit = d.getVar('LLVMVERSION').split('.') Signed-off-by: Martin Jansa --- diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc index a12b202e432..11bf5ebbb83 100644 --- a/meta/conf/distro/include/tcmode-default.inc +++ b/meta/conf/distro/include/tcmode-default.inc @@ -24,9 +24,14 @@ GLIBCVERSION ?= "2.38%" LINUXLIBCVERSION ?= "6.6%" QEMUVERSION ?= "8.2%" GOVERSION ?= "1.20%" -LLVMVERSION ?= "17.%" RUSTVERSION ?= "1.74%" +# Allow to independently set P_V for llvm* recipes and actual llvm version used in other places +# This is needed for meta-clang which provides different llvm version from clang recipes, see: +# https://github.com/kraj/meta-clang/pull/766 +LLVM_PREFERRED_VERSION ?= "17.%" +LLVMVERSION ?= "${LLVM_PREFERRED_VERSION}" + PREFERRED_VERSION_gcc ?= "${GCCVERSION}" PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "${GCCVERSION}" PREFERRED_VERSION_gcc-crosssdk-${SDK_SYS} ?= "${SDKGCCVERSION}" @@ -77,9 +82,9 @@ PREFERRED_VERSION_go-runtime ?= "${GOVERSION}" PREFERRED_VERSION_nativesdk-go ?= "${GOVERSION}" PREFERRED_VERSION_nativesdk-go-runtime ?= "${GOVERSION}" -PREFERRED_VERSION_llvm = "${LLVMVERSION}" -PREFERRED_VERSION_llvm-native = "${LLVMVERSION}" -PREFERRED_VERSION_nativesdk-llvm = "${LLVMVERSION}" +PREFERRED_VERSION_llvm = "${LLVM_PREFERRED_VERSION}" +PREFERRED_VERSION_llvm-native = "${LLVM_PREFERRED_VERSION}" +PREFERRED_VERSION_nativesdk-llvm = "${LLVM_PREFERRED_VERSION}" # Rust toolchain preferred versions: