Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 520644 - kde-base/pykde4-4.14.0 fails to build (undefined symbol in PyQt4/QtCore.so when built with gcc-4.9.1 and -flto)
Summary: kde-base/pykde4-4.14.0 fails to build (undefined symbol in PyQt4/QtCore.so wh...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] KDE (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-4.9
  Show dependency tree
 
Reported: 2014-08-22 20:12 UTC by Tolga Dalman
Modified: 2014-10-05 12:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,4.79 KB, text/plain)
2014-08-22 20:12 UTC, Tolga Dalman
Details
CMake error log (CMakeError.log,12.03 KB, text/x-log)
2014-08-22 20:13 UTC, Tolga Dalman
Details
cmake output log (CMakeOutput.log,55.34 KB, text/x-log)
2014-08-22 20:13 UTC, Tolga Dalman
Details
build.log (build.log,8.54 KB, text/x-log)
2014-08-22 20:16 UTC, Tolga Dalman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tolga Dalman 2014-08-22 20:12:14 UTC
Created attachment 383422 [details]
emerge --info

# emerge -pv PyQt4

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] dev-python/PyQt4-4.11.1  USE="X dbus declarative kde opengl script sql svg webkit -debug -designer -doc -examples -help -multimedia -phonon -scripttools -xmlpatterns" PYTHON_TARGETS="python2_7 python3_3 -python3_2 -python3_4" 0 KiB



The relevant part of the error message is probably this (I will attach full logs):


-- Python system site-packages directory: /usr/lib64/python3.3/site-packages
-- Found SIP version: 4.16.2
Traceback (most recent call last):
  File "/usr/share/apps/cmake/modules/FindPyQt.py", line 6, in <module>
    import PyQt4.QtCore
ImportError: /usr/lib64/python3.3/site-packages/PyQt4/QtCore.so: undefined symbol: qpycore_pickle_protocol
-- 
-- The following OPTIONAL packages have been found:

 * Threads
 * OpenSSL
 * Perl

-- The following REQUIRED packages have been found:

 * X11
 * Qt4
 * Automoc4
 * Phonon (required version >= 4.3.80)
 * KDE4Internal
 * KDE4 (required version >= 4.9.4) , The KDE libraries , <http://www.kde.org>
   Required to build PyKDE4
 * PythonInterp , The Python interpreter , <http://www.python.org>
   Required to build PyKDE4
 * PythonLibrary , The Python Library , <http://www.python.org>
   Required to build PyKDE4
 * SIP , The SIP binding generator , <http://riverbankcomputing.com>
   Required to build PyKDE4

-- The following REQUIRED packages have not been found:

 * PyQt4 , The PyQt bindings , <http://riverbankcomputing.com>
   Required to build PyKDE4

CMake Error at /usr/share/cmake/Modules/FeatureSummary.cmake:430 (message):
  feature_summary() Error: REQUIRED package(s) are missing, aborting CMake
  run.
Call Stack (most recent call first):
  CMakeLists.txt:267 (feature_summary)
Comment 1 Tolga Dalman 2014-08-22 20:13:05 UTC
Created attachment 383424 [details]
CMake error log
Comment 2 Tolga Dalman 2014-08-22 20:13:22 UTC
Created attachment 383426 [details]
cmake output log
Comment 3 Tolga Dalman 2014-08-22 20:16:35 UTC
Created attachment 383428 [details]
build.log
Comment 4 Michael Palimaka (kensington) gentoo-dev 2014-08-28 12:23:20 UTC
Could you please try rebuilding sip, then PyQt4, then pykde4 in that order?
Comment 5 Tolga Dalman 2014-08-29 21:45:54 UTC
Same result.
Comment 6 Tolga Dalman 2014-08-31 06:50:19 UTC
While I have no explanation yet, I found a way to circumvent this bug. After recompiling PyQt4 with GCC 4.8.3 instead of GCC 4.9.1, the missing symbols from QtCore.so are found in the CMake configure machinerie.
Note that pykde4 itself compiles fine with GCC 4.9.1.

I propose to keep this bug open, however, the title should be renamed since this is ultimately a PyQt4 issue and has nothing to do with pykde4 per se. Thanks!
Comment 7 Davide Pesavento gentoo-dev 2014-09-12 14:19:52 UTC
I cannot find the error output in CMakeError.log, did it get truncated for some reason?
Comment 8 Michael Palimaka (kensington) gentoo-dev 2014-09-12 15:01:16 UTC
Traceback (most recent call last):
  File "/usr/share/apps/cmake/modules/FindPyQt.py", line 6, in <module>
    import PyQt4.QtCore
ImportError: /usr/lib64/python3.3/site-packages/PyQt4/QtCore.so: undefined symbol: qpycore_pickle_protocol

was the only error i saw
Comment 9 Davide Pesavento gentoo-dev 2014-10-04 23:40:59 UTC
I can reproduce with gcc-4.9.1 and -flto, so this appears to be an LTO bug.
Comment 10 Davide Pesavento gentoo-dev 2014-10-05 00:27:17 UTC
Actually no, it's not an LTO bug. Your setup is incorrect. With LTO you need to use gcc-ar and gcc-ranlib wrappers or the linking of static libraries will fail like this.

gcc(1) says:
"If object files containing GIMPLE bytecode are stored in a library archive, say libfoo.a, it is possible to extract and use them in an LTO link if you are using a
linker with plugin support.  To create static libraries suitable for LTO, use gcc-ar and gcc-ranlib instead of ar and "ranlib"; to show the symbols of object files
with GIMPLE bytecode, use gcc-nm.  Those commands require that ar, ranlib and nm have been compiled with plugin support. [...]"

Or alternatively you can use -ffat-lto-objects.
Comment 11 Tolga Dalman 2014-10-05 07:27:25 UTC
(In reply to Davide Pesavento from comment #10)
> Actually no, it's not an LTO bug. Your setup is incorrect. With LTO you need
> to use gcc-ar and gcc-ranlib wrappers or the linking of static libraries
> will fail like this.
> [...]
> Or alternatively you can use -ffat-lto-objects.


What is the proposed way to use LTO in Gentoo ? Always use fat-lto-objects ?
Comment 12 David Kredba 2014-10-05 12:49:55 UTC
This is my opinion based on observation. I think that with not-yet-released binutils 2.25 you should not expect any support for slim (yet) and fat (old, obsoleted by better slim variant) LTO in Gentoo.
With binutils-2.25 and gcc-4.9.2 released (it is coming in a few next days, at least rc) maybe slim LTO will start to be considered alpha or beta instead of experimental.
Patch your binutils 2.24 by slim LTO patches (one to enable it, one to report that the support is missing) and then the shared pie patch or use yesterday updated trunk binutils (fix for Mesa-10.3.0 and LLVM-3.5.0 FDE overalps, binutils Bug ld/17447). Then you only have to take care of existence of symlink  showing liblto_plugin.so in /usr/x86_64-pc-linux-gnu/binutils-bin/lib/bfd-plugins/ folder, pointing to 4.9.2-pre liblto_plugin.so. And then you can use slim LTO almost sytem wide except not yet slim LTO adopted packages.