From e3e3b3771bc597ca91f33c5eafc17a2dc3802c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Sun, 16 Aug 2020 19:10:11 +0200 Subject: qt5-creator: Make clang a PACKAGECONFIG - enabled for clang toolchain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test case: * meta-clang in layers * gcc toolchain * build qttools with PACKAGECONFIG[clang] enabled to get (native) help tools. After setting clang PACKAGECONFIG at qttools, qt5-creator builds failed due to linker errors: Linker tried to link against native clang tools. Avoid that in the same way as clang-toolchain did but use PACKAGECONFIG. * clang-toolchain builds remain unchanged * a hint was dropped in the recipe to support users failing for same issue Signed-off-by: Andreas Müller (cherry picked from commit 063714fb78cf5264ac52541c1c4c364620f8df28) --- recipes-qt/qt5/qt5-creator_git.bb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/recipes-qt/qt5/qt5-creator_git.bb b/recipes-qt/qt5/qt5-creator_git.bb index 0dd9c234..39f202d6 100644 --- a/recipes-qt/qt5/qt5-creator_git.bb +++ b/recipes-qt/qt5/qt5-creator_git.bb @@ -15,7 +15,6 @@ LIC_FILES_CHKSUM = " \ inherit qmake5 mime-xdg DEPENDS += "qtbase qtscript qtxmlpatterns qtx11extras qtdeclarative qttools qttools-native qtsvg chrpath-replacement-native zlib" -DEPENDS_append_toolchain-clang = " clang llvm-common" DEPENDS_append_libc-musl = " libexecinfo" SRCREV = "501e7c2fddec6b93e273dadcac389cd8c934cf00" @@ -34,6 +33,13 @@ EXTRA_QMAKEVARS_PRE += "IDE_LIBRARY_BASENAME=${baselib}${QT_DIR_NAME}" EXTRANATIVEPATH += "chrpath-native" +PACKAGECONFIG ??= "" +PACKAGECONFIG_append_toolchain-clang = " clang" + +# Important note: In case clang was added to qttools' PACKAGECONFIG, it has to +# be added here too - otherwise build fails trying to link native clang libraries +PACKAGECONFIG[clang] = ",,clang llvm-common" + COMPATIBLE_HOST_toolchain-clang_riscv32 = "null" COMPATIBLE_HOST_toolchain-clang_riscv64 = "null" @@ -50,11 +56,11 @@ do_configure_append() { do_install() { oe_runmake install INSTALL_ROOT=${D}${prefix} -} -do_install_append_toolchain-clang () { - # Remove RPATHs embedded in bins - chrpath --delete ${D}${libdir}/qtcreator/plugins/libClang* - chrpath --delete ${D}${libexecdir}/qtcreator/clang* + if [ "${@bb.utils.contains("PACKAGECONFIG", "clang", "1", "0", d)}" = "1" ]; then + # Remove RPATHs embedded in bins + chrpath --delete ${D}${libdir}/qtcreator/plugins/libClang* + chrpath --delete ${D}${libexecdir}/qtcreator/clang* + fi } FILES_${PN} += " \ -- cgit v1.2.3