Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#38819 - [qt5-base] linker error with libQt5PlatformSupport.a when building qtwayland

Attached to Project: Arch Linux
Opened by Pier Luigi Fiorini (plfiorini) - Thursday, 06 February 2014, 20:07 GMT
Last edited by Andrea Scarpino (BaSh) - Monday, 19 January 2015, 15:10 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Andrea Scarpino (BaSh)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 12
Private No

Details

Description:

Can't build qtwayland

Additional info:
* This happens with qt5-base 5.2.1

Errors:

g++ -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,--no-undefined -Wl,-O1 -shared -Wl,-Bsymbolic-functions -Wl,-soname,libQt5WaylandClient.so.5 -o libQt5WaylandClient.so.5.2.1 .obj/qwaylandintegration.o .obj/qwaylandnativeinterface.o .obj/qwaylandshmbackingstore.o .obj/qwaylandinputdevice.o .obj/qwaylandcursor.o .obj/qwaylanddisplay.o .obj/qwaylandwindow.o .obj/qwaylandscreen.o .obj/qwaylandshmwindow.o .obj/qwaylandclipboard.o .obj/qwaylanddnd.o .obj/qwaylanddataoffer.o .obj/qwaylanddatadevicemanager.o .obj/qwaylanddatasource.o .obj/qwaylandshellsurface.o .obj/qwaylandextendedoutput.o .obj/qwaylandextendedsurface.o .obj/qwaylandsubsurface.o .obj/qwaylandtouch.o .obj/qwaylandqtkey.o .obj/qwaylandmimehelper.o .obj/qwaylanddecoration.o .obj/qwaylandeventthread.o .obj/qwaylandwindowmanagerintegration.o .obj/qwaylandinputcontext.o .obj/qwaylanddatadevice.o .obj/qwaylandclientbufferintegration.o .obj/qwaylandclientbufferintegrationplugin.o .obj/qwaylandclientbufferintegrationfactory.o .obj/qwaylandserverbufferintegration.o .obj/qwaylandserverbufferintegrationplugin.o .obj/qwaylandserverbufferintegrationfactory.o .obj/qwaylandhardwareintegration.o .obj/wayland-wayland-protocol.o .obj/wayland-surface-extension-protocol.o .obj/wayland-sub-surface-extension-protocol.o .obj/wayland-output-extension-protocol.o .obj/wayland-touch-extension-protocol.o .obj/wayland-qtkey-extension-protocol.o .obj/wayland-windowmanager-protocol.o .obj/wayland-text-protocol.o .obj/wayland-server-buffer-extension-protocol.o .obj/wayland-hardware-integration-protocol.o .obj/qwayland-wayland.o .obj/qwayland-surface-extension.o .obj/qwayland-sub-surface-extension.o .obj/qwayland-output-extension.o .obj/qwayland-touch-extension.o .obj/qwayland-qtkey-extension.o .obj/qwayland-windowmanager.o .obj/qwayland-text.o .obj/qwayland-server-buffer-extension.o .obj/qwayland-hardware-integration.o .obj/moc_qwaylanddisplay_p.o .obj/moc_qwaylandwindow_p.o .obj/moc_qwaylandinputdevice_p.o .obj/moc_qwaylanddatasource_p.o .obj/moc_qwaylandeventthread_p.o .obj/moc_qwaylandwindowmanagerintegration_p.o .obj/moc_qwaylandinputcontext_p.o .obj/moc_qwaylanddatadevice_p.o .obj/moc_qwaylandclientbufferintegrationplugin_p.o .obj/moc_qwaylandserverbufferintegrationplugin_p.o -lfontconfig -lfreetype -lxkbcommon -lwayland-client -lwayland-cursor -lQt5PlatformSupport -lQt5Gui -lQt5Core -lpthread -lglib-2.0 -lGL
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../lib/libQt5PlatformSupport.a(qfontconfigdatabase.o): In function `QFontconfigDatabase::defaultFont() const':
(.text+0x40): undefined reference to `FcPatternCreate'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../lib/libQt5PlatformSupport.a(qfontconfigdatabase.o): In function `QFontconfigDatabase::defaultFont() const':
(.text+0x4b): undefined reference to `FcDefaultSubstitute'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../lib/libQt5PlatformSupport.a(qfontconfigdatabase.o): In function `QFontconfigDatabase::defaultFont() const':
(.text+0x6a): undefined reference to `FcPatternGetString'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../lib/libQt5PlatformSupport.a(qfontconfigdatabase.o): In function `QFontconfigDatabase::defaultFont() const':
(.text+0x72): undefined reference to `FcPatternCreate'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../lib/libQt5PlatformSupport.a(qfontconfigdatabase.o): In function `QFontconfigDatabase::defaultFont() const':
(.text+0x8e): undefined reference to `FcPatternAddString'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../lib/libQt5PlatformSupport.a(qfontconfigdatabase.o): In function `QFontconfigDatabase::defaultFont() const':
(.text+0x9a): undefined reference to `FcConfigSubstitute'

Steps to reproduce:

git clone git://gitorious.org/qt/qtwayland.git
cd qtwayland
qmake
make
This task depends upon

Closed by  Andrea Scarpino (BaSh)
Monday, 19 January 2015, 15:10 GMT
Reason for closing:  Fixed
Additional comments about closing:  qt5-base 5.4.0-2
Comment by Andrea Scarpino (BaSh) - Thursday, 06 February 2014, 20:47 GMT
Qt5 is built with fontconfig from [extra], do you use some version from AUR?
Comment by Pier Luigi Fiorini (plfiorini) - Thursday, 06 February 2014, 20:51 GMT
Nope, I'm building in a chroot against qt5-base, can you try and see if you can reproduce this?
Comment by Andrea Scarpino (BaSh) - Thursday, 06 February 2014, 20:58 GMT
Sorry, I can't right now. I'll try tomorrow.
qtwayland also needs qt5-base built with GLES, I'm wrong?
Comment by Pier Luigi Fiorini (plfiorini) - Thursday, 06 February 2014, 21:07 GMT
Probably not, qtbase 5.2.1 now should be able to enable EGL without pulling GLES in (defaulting to desktop GL, in fact I can see a -lGL).
The configuration advertise egl and eglfs and the qtwayland check doesn't fail.

This is the output when I build qt5-wayland-git from AUR (https://aur.archlinux.org/packages/qt5-wayland-git/): http://pastebin.com/wTp0GBre
Both fontconfig and freetype2 gets installed.

This error happens also when I build qtwayland on my system (no chroot) though.
Comment by Jan de Groot (JGC) - Friday, 07 February 2014, 10:35 GMT
Is it possible that something pulls in a custom/in-tree version of fontconfig? The undefined references are new symbols added in fontconfig 2.11.0.
Comment by Taeyeon Mori (Orochimarufan) - Sunday, 09 February 2014, 23:48 GMT
It seems to be an issue with the build environment.
Getting extra/qt5 from ABS and taking the libQt5PlatformSupport.a that gets built fixes this issue. (I didn't try to completely replace the Qt install)

However, (related), qt5-wayland-git still won't build because of some broken code.
I'm not quite sure why that is, but it seems upstream hasn't finished updating the code and some of it is in a broken state.
I fixed the obvious things and got it to build.
I put up a patch if anyone's interested: http://oro.sodimm.me/~hinata/devel/qt5-wayland-git/ (Feel free to use it)
From my very limited testing, at least the -platform wayland part works. (I'll try a few things related to the compositor part tomorrow.)
Comment by Pier Luigi Fiorini (plfiorini) - Thursday, 27 February 2014, 11:17 GMT
News?
Comment by Andrea Scarpino (BaSh) - Saturday, 01 March 2014, 16:33 GMT
I can reproduce this, but still I've no idea on how to fix. Maybe it needs qt 5.3 to build?

I guess qt5-base doesn't need a rebuild because fontconfig/freetype2 have not rebuilt since the qt5-base build.
Comment by Pier Luigi Fiorini (plfiorini) - Saturday, 01 March 2014, 19:01 GMT
Did you build in a chroot?
Comment by Francois van der Ven (francoisvdv) - Thursday, 06 March 2014, 12:08 GMT
Can also reproduce and can't figure out how to make it work...

My build log: http://pastebin.com/wRjdphX7 and error: http://pastebin.com/k1JzWfib
Comment by Kovid Goyal (kovidgoyal) - Tuesday, 29 April 2014, 03:07 GMT
-lfontconfig needs to be specified *after* libQt5PlatformSupport.a

Arch apparently monkey patches qmake in its qt-base PKGBUILD, which breaks the generation of Makefiles for QPA plugins. You can workaround it by adding -lfontconfig and -lglib-2.0 to QMAKE_LIBS_PRIVATE in the .pro file of the QPA plugin. See this commit for an example: https://github.com/kovidgoyal/calibre/commit/fce51f8b1d793857f42489a5308dcee701fdb6bc
Comment by Andrea Scarpino (BaSh) - Tuesday, 29 April 2014, 06:50 GMT
Really? You mean that those:

sed -i "s|-O2|${CXXFLAGS}|" qtbase/mkspecs/common/{g++,gcc}-base.conf
sed -i "/^QMAKE_LFLAGS_RPATH/s| -Wl,-rpath,||g" qtbase/mkspecs/common/gcc-base-unix.conf
sed -i "/^QMAKE_LFLAGS\s/s|+=|+= ${LDFLAGS}|g" qtbase/mkspecs/common/gcc-base.con

did broke it?

I'm trying to build qt5 without them and see what happens.
Comment by Kovid Goyal (kovidgoyal) - Tuesday, 29 April 2014, 07:02 GMT
Compiling Qt from source yields a qmake that generates working Makefiles. Using the Arch version of Qt does not. I'm not familiar enough with qmake to know which of those expressions causes the problem, however.
Comment by Andrea Scarpino (BaSh) - Tuesday, 29 April 2014, 07:06 GMT
Thanks, now I know where to look.
Comment by Swift Geek (swiftgeek) - Tuesday, 29 April 2014, 10:17 GMT
Managed to compile qt5-wayland-git with:
qmake CONFIG+=wayland-compositor QMAKE_LIBS_PRIVATE+="-lfontconfig -lfreetype -lXrender"
(PKGBUILD version that i used) http://pkgbuild.com/git/aur-mirror.git/tree/qt5-wayland-git/PKGBUILD?id=f689c7937f53cc692b08356214b463114eaa0894

Got running transmission-qt after passing -platform wayland as an argument
# This should be considered as a workaround fort the bug within qt5's pkgbuilds
Comment by Andrea Scarpino (BaSh) - Tuesday, 20 May 2014, 09:00 GMT
Still not fixed with 5.3.0
Comment by PCMan (pcman) - Saturday, 24 May 2014, 03:21 GMT
I tried to compile the latest qtwayland from git with qt5-base 5.3 in the testing repo.
Then I got totally the same results about fontconfig linking problems.
This is always reproducible if you try to compile qtwayland from source.
The errors I got are slightly different, though.

   build.log (47.9 KiB)
Comment by Andrea Scarpino (BaSh) - Wednesday, 17 September 2014, 09:12 GMT
Current qtwayland requires Qt 5.4, so this cannot be tested ATM.
Comment by Pier Luigi Fiorini (plfiorini) - Wednesday, 17 September 2014, 09:17 GMT
Not entirely true: the 5.4 branch requires Qt 5.4.x, the dev branch can build with Qt 5.3.x
Comment by Swift Geek (swiftgeek) - Thursday, 16 October 2014, 23:32 GMT
Last that compiles for me is "374cb3b2872652317baec299712d7dfde6d9c896", later it seems to require 5.4.x
(still the same long qmake line, as ~qt5-base package is still broken)
#Sidenote: under new mesa/weston "QT_QPA_PLATFORM=wayland-egl" finally works
Comment by Swift Geek (swiftgeek) - Wednesday, 26 November 2014, 04:05 GMT
TheAifam5 has provided fixes for compiling against 5.3.x and now it compiles with commits newer than "374cb3b2872652317baec299712d7dfde6d9c896"
EDIT: This whole issue is about broken »qmake« (made from "monkey patched" PKGBUILD), which is as broken as it was almost a year ago.
Comment by Swift Geek (swiftgeek) - Sunday, 07 December 2014, 18:17 GMT
  • Field changed: Percent Complete (100% → 0%)
The qt5-base is still not fixed, this is a hack in qt5-wayland-git package described partially in comments...
Comment by Andrea Scarpino (BaSh) - Wednesday, 10 December 2014, 13:22 GMT
Just to report that qt5-wayland 5.4.0-1 will be in [extra] in the next hours.
Comment by Swift Geek (swiftgeek) - Wednesday, 10 December 2014, 13:53 GMT
Then i will remind for the 2nd time that this issue is about broken »qmake« and qt5-wayland-git is provided as example that triggers the bug existing »only in archlinux«
Comment by Andrea Scarpino (BaSh) - Wednesday, 10 December 2014, 14:10 GMT
Any suggestion on how to fix it?
Comment by Swift Geek (swiftgeek) - Wednesday, 10 December 2014, 14:21 GMT
Brute force, as usual
The only issue for me is that results on my machine would be provided after far too long time (days, not hours… i wouldn't trust ccache with such crazy bug)

qmake is still broken as of 2015-01-14
Recompiled qt5 with unchanged PKGBUILD via makepkg - qmake is broken in the same way. 2015-01-17 (6h of wasted time each time)
Compilation of qt5 without seds fails with some qtwebkit modules but produces »working« qt5-base. 2015-01-17

Related: FS#43186

Loading...