dev-qt/qt-creator fails to build with sys-devel/clang:10. New version of clang is built without split libraries, and qt-creator fails to link to resulting clang libraries. Reproducible: Always Steps to Reproduce: 1. Copy and modify qt-creator ebuild to drop llvm/clang-8 compatibility restriction. Applying following diff should be enough: --- /usr/portage/dev-qt/qt-creator/qt-creator-4.10.1.ebuild 2019-12-11 02:41:53.000000000 +0300 +++ ./qt-creator-4.10.1.ebuild 2020-03-07 15:48:31.148920032 +0300 @@ -2,7 +2,6 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -LLVM_MAX_SLOT=8 PLOCALES="cs da de fr ja pl ru sl uk zh-CN zh-TW" inherit llvm qmake-utils virtualx xdg @@ -56,7 +55,7 @@ >=dev-qt/qtwidgets-${QT_PV} >=dev-qt/qtx11extras-${QT_PV} >=dev-qt/qtxml-${QT_PV} - clang? ( sys-devel/clang:8= ) + clang? ( sys-devel/clang:= ) designer? ( >=dev-qt/designer-${QT_PV} ) help? ( >=dev-qt/qthelp-${QT_PV} 2. Apply upstream patches to fix compiling qt-creator with recent clang versions. At least following two changes are required: https://code.qt.io/cgit/qt-creator/qt-creator.git/commit/?id=6ec8017bc675692f3d325c0cd95c9c4c7a79db7d https://code.qt.io/cgit/qt-creator/qt-creator.git/commit/?id=44023c8f43fd8daf8b7be305ea6d99b8b56fa551 3. ACCEPT_KEYWORDS="~*" emerge -1 clang:10 4. ACCEPT_KEYWORDS="~*" USE="clang" emerge -1 qt-creator Actual Results: Build fails: x86_64-pc-linux-gnu-g++ -Wl,-O1 -Wl,--as-needed -Wl,-z,origin '-Wl,-rpath,$ORIGIN:$ORIGIN/..:$ORIGIN/../lib64/qtcreator' -Wl,--no-undefined -Wl,-z,origin -Wl,-rpath,/usr/lib64/llvm/10 /lib64 -Wl,--exclude-libs,ALL -shared -Wl,-soname,libClangFormat.so -o libClangFormat.so .obj/release-shared/clangformatbaseindenter.o .obj/release-shared/clangformatconfigwidget.o .o bj/release-shared/clangformatindenter.o .obj/release-shared/clangformatplugin.o .obj/release-shared/clangformatsettings.o .obj/release-shared/clangformatutils.o .obj/release-shared/mo c_clangformatconfigwidget.o .obj/release-shared/moc_clangformatplugin.o -L/var/tmp/portage/dev-qt/qt-creator-4.10.1/work/qt-creator-opensource-src-4.10.1/lib64/qtcreator -L/var/tmp/ portage/dev-qt/qt-creator-4.10.1/work/qt-creator-opensource-src-4.10.1/lib64/qtcreator/plugins -lCppTools -lProjectExplorer -lCppEditor -lCore -lTextEditor -lQtcSsh -lCPlusPlus -lAggr egation -lExtensionSystem -lUtils -lKSyntaxHighlighting -L/usr/lib64/llvm/10/lib64 -lclangFormat -lclangToolingInclusions -lclangToolingCore -lclangRewrite -lclangLex -lclangBasic -lL LVM-10 /usr/lib64/libQt5Widgets.so /usr/lib64/libQt5Gui.so /usr/lib64/libQt5Concurrent.so /usr/lib64/libQt5Network.so /usr/lib64/libQt5Core.so /usr/lib64/libGL.so -lpthread /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lclangFormat /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lclangToolingInclusions /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lclangToolingCore /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lclangRewrite /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lclangLex /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lclangBasic collect2: error: ld returned 1 exit status make[3]: *** [Makefile:358: ../../../lib64/qtcreator/plugins/libClangFormat.so] Error 1 Expected Results: Successful build of qt-creator As far as I can see, clangFormat and other libraries are hardcoded in qt-creator plugin's build, but they're missing now for clang:10 in Gentoo: https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/shared/clang/clang_installation.pri#n210 Looks similar to bug #710306 Everything builds fine if clang:9 is used instead of clang:10 while following steps described above.
Created attachment 617402 [details] build.log.bz2 Full compressed build log
This is related to bug #710306. In the >=clang-10 ebuilds, the "-DBUILD_SHARED_LIBS" flag has been set to "OFF". This causes problems when building various packages, including qt-creator and mesa. This is a list of broken packages for Fedora, where they're considering making the same change: https://fedoraproject.org/wiki/Changes/Stop-Shipping-Individual-Component-Libraries-In-clang-lib-Package#Dependencies This change was apparently made to fix mlir, but it is breaking other packages. I'm not sure if any of these packages have upstream fixes or patches.
Same thing happens with dev-qt/qt-creator-4.8.2 (it doesn't have LLVM_MAX_SLOT). I have both llvm:9 and llvm:10 installed.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24dd58fe4592775fe430ee98d17ecb7825a02ade commit 24dd58fe4592775fe430ee98d17ecb7825a02ade Author: Peter Levine <plevine457@gmail.com> AuthorDate: 2020-05-08 07:11:14 +0000 Commit: Jason A. Donenfeld <zx2c4@gentoo.org> CommitDate: 2020-06-25 07:11:04 +0000 dev-qt/qt-creator: Support clang-10 Builds and runs without issue using patch from https://codereview.qt-project.org/c/qt-creator/qt-creator/+/299377 Closes: https://bugs.gentoo.org/720240 Closes: https://bugs.gentoo.org/711788 Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Peter Levine <plevine457@gmail.com> Signed-off-by: Jason A. Donenfeld <zx2c4@gentoo.org> .../files/qt-creator-4.12.0-dylib-fix.patch | 84 ++++++++++++++++++++++ dev-qt/qt-creator/qt-creator-9999.ebuild | 13 +++- 2 files changed, 95 insertions(+), 2 deletions(-)
*** Bug 730178 has been marked as a duplicate of this bug. ***
*** Bug 730236 has been marked as a duplicate of this bug. ***
Should the fixed version be stabilized now, because LLVM 10 became stable?
(In reply to Mike Limansky from comment #7) > Should the fixed version be stabilized now, because LLVM 10 became stable? Hence bug 720240.
(In reply to Andreas Sturmlechner from comment #8) > (In reply to Mike Limansky from comment #7) > > Should the fixed version be stabilized now, because LLVM 10 became stable? > Hence bug 720240. Well, it looks like it's a pretty long task, because it's require Qt 5.15. Maybe the default USE flags should be changed? To make things just work by default?
*** Bug 730256 has been marked as a duplicate of this bug. ***
*** Bug 730620 has been marked as a duplicate of this bug. ***
*** Bug 730652 has been marked as a duplicate of this bug. ***
as the latest qt-creator requires Qt 5.15, is it possible to backport the patch to qt-creator-4.10.1?
I have backported the patches for LLVM 9 and 10 to qt-creator-4.10.1, simply by taking the relevant commits from upstream git repository. Morever the ebuild needs a few simple changes
Created attachment 649674 [details, diff] qt-creator-4.10.1-llvm9.patch
Created attachment 649676 [details, diff] qt-creator-4.10.1-llvm10.patch
Here are the changes for the ebuild --- /usr/portage/dev-qt/qt-creator/qt-creator-4.10.1.ebuild 2020-07-17 10:56:50.238644177 +0200 +++ /var/lib/layman/__mine__/dev-qt/qt-creator/qt-creator-4.10.1.ebuild 2020-07-17 10:56:57.422643501 +0200 @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -LLVM_MAX_SLOT=8 +LLVM_MAX_SLOT=10 PLOCALES="cs da de fr ja pl ru sl uk zh-CN zh-TW" inherit llvm qmake-utils virtualx xdg @@ -96,6 +96,12 @@ done unset x +PATCHES=( + "${FILESDIR}"/${P}-llvm9.patch + "${FILESDIR}"/${P}-llvm10.patch + "${FILESDIR}"/${PN}-4.12.0-dylib-fix.patch +) + pkg_setup() { use clang && llvm_pkg_setup }
I don't know which is the purpose of the qt-creator-4.12.0-libclangformat-ide.patch but version 4.10.1 compiles successfully, is needed for runtime?
(In reply to Fabio Rossi from comment #18) > I don't know which is the purpose of the > qt-creator-4.12.0-libclangformat-ide.patch but version 4.10.1 compiles > successfully, is needed for runtime? I mean compiles successfully even without it
sorry I missed to update the clang dep in the ebuild: --- /usr/portage/dev-qt/qt-creator/qt-creator-4.10.1.ebuild 2020-07-17 10:56:50.238644177 +0200 +++ /var/lib/layman/__mine__/dev-qt/qt-creator/qt-creator-4.10.1.ebuild 2020-07-17 11:27:48.442469303 +0200 @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -LLVM_MAX_SLOT=8 +LLVM_MAX_SLOT=10 PLOCALES="cs da de fr ja pl ru sl uk zh-CN zh-TW" inherit llvm qmake-utils virtualx xdg @@ -56,7 +56,7 @@ >=dev-qt/qtwidgets-${QT_PV} >=dev-qt/qtx11extras-${QT_PV} >=dev-qt/qtxml-${QT_PV} - clang? ( sys-devel/clang:8= ) + clang? ( <sys-devel/clang-$((LLVM_MAX_SLOT + 1)):= ) designer? ( >=dev-qt/designer-${QT_PV} ) help? ( >=dev-qt/qthelp-${QT_PV} @@ -96,6 +96,12 @@ done unset x +PATCHES=( + "${FILESDIR}"/${P}-llvm9.patch + "${FILESDIR}"/${P}-llvm10.patch + "${FILESDIR}"/${PN}-4.12.0-dylib-fix.patch +) + pkg_setup() { use clang && llvm_pkg_setup }