[Bug 256231] New: cmake INSTALL(EXPORT) files installed into /usr/share/apps instead of /usr/lib*/, breaks multilib

Nathan Phillip Brink (binki) ohnobinki at ohnopublishing.net
Sat Nov 6 14:26:43 GMT 2010


https://bugs.kde.org/show_bug.cgi?id=256231

           Summary: cmake INSTALL(EXPORT) files installed into
                    /usr/share/apps instead of /usr/lib*/, breaks multilib
           Product: kde
           Version: 4.5
          Platform: Gentoo Packages
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: unassigned-bugs at kde.org
        ReportedBy: ohnobinki at ohnopublishing.net


Version:           4.5 (using KDE 4.5.2) 
OS:                Linux

When attempting to compile a 32-bit version of something such as libkdegames,
the file INSTALL(EXPORT) files give CMake full paths to 64-bit verions of the
kdelib's core libraries. For example,
/usr/share/apps/cmake/modules/KDELibs4LibraryTargets.cmake references
/usr/share/apps/cmake/modules/KDELibs4LibraryTargets-gentoo.cmake which
contains something like:
``
# Import target "KDE4__kio" for configuration "Gentoo"
SET_PROPERTY(TARGET KDE4__kio APPEND PROPERTY IMPORTED_CONFIGURATIONS GENTOO)
SET_TARGET_PROPERTIES(KDE4__kio PROPERTIES
  IMPORTED_LINK_DEPENDENT_LIBRARIES_GENTOO "KDE4__solid"
  IMPORTED_LINK_INTERFACE_LIBRARIES_GENTOO
"KDE4__kdeui;KDE4__kdecore;Qt4::QtNetwork;Qt4::QtXml;Qt4::QtGui"
  IMPORTED_LOCATION_GENTOO "/usr/lib64/libkio.so.5.5.0"
  IMPORTED_SONAME_GENTOO "libkio.so.5"
  )
''

This causes compilation failure for a 32-bit compilation of libkdegames:
``
Linking CXX shared library ../lib/libkdegames.so
cd
/var/tmp/portage/kde-base/libkdegames-4.5.2/work/libkdegames-4.5.2_build/libkdegames
&& /usr/bin/cmake -E cmake_link_script CMakeFiles/kdegames.dir/link.txt
--verbose=1
/usr/bin/x86_64-pc-linux-gnu-g++  -fPIC -O2 -pipe -march=athlon64 -g -ggdb
-combine -ftree-vectorize -falign-functions=16 -falign-labels=16
-falign-jumps=16 -m32  -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef
-Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security
-fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common
-Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden
-fvisibility-inlines-hidden -Wl,--enable-new-dtags -Wl,--fatal-warnings
-Wl,--no-undefined -lc -Wl,--as-needed -Wl,-O1 -Wl,-t -Wl,--enable-new-dtags
-Wl,--hash-style=gnu -shared -Wl,-soname,libkdegames.so.5 -o
../lib/libkdegames.so.5.0.0 CMakeFiles/kdegames.dir/kdegames_automoc.o
CMakeFiles/kdegames.dir/digits/kgamesvgdigits.o
CMakeFiles/kdegames.dir/highscore/kexthighscore_item.o
CMakeFiles/kdegames.dir/highscore/kexthighscore_internal.o
CMakeFiles/kdegames.dir/highscore/kexthighscore_tab.o
CMakeFiles/kdegames.dir/highscore/kexthighscore_gui.o
CMakeFiles/kdegames.dir/highscore/kexthighscore.o
CMakeFiles/kdegames.dir/highscore/khighscore.o
CMakeFiles/kdegames.dir/highscore/kscoredialog.o
CMakeFiles/kdegames.dir/kgame/kgame.o CMakeFiles/kdegames.dir/kgame/kgamechat.o
CMakeFiles/kdegames.dir/kgame/kgameerror.o
CMakeFiles/kdegames.dir/kgame/kgameio.o
CMakeFiles/kdegames.dir/kgame/kgamemessage.o
CMakeFiles/kdegames.dir/kgame/kgamenetwork.o
CMakeFiles/kdegames.dir/kgame/kgameprocess.o
CMakeFiles/kdegames.dir/kgame/kgameproperty.o
CMakeFiles/kdegames.dir/kgame/kgamepropertyhandler.o
CMakeFiles/kdegames.dir/kgame/kgamesequence.o
CMakeFiles/kdegames.dir/kgame/kmessageclient.o
CMakeFiles/kdegames.dir/kgame/kmessageio.o
CMakeFiles/kdegames.dir/kgame/kmessageserver.o
CMakeFiles/kdegames.dir/kgame/kplayer.o
CMakeFiles/kdegames.dir/kgame/dialogs/kgameconnectdialog.o
CMakeFiles/kdegames.dir/kgame/dialogs/kgamedebugdialog.o
CMakeFiles/kdegames.dir/kgame/dialogs/kgamedialog.o
CMakeFiles/kdegames.dir/kgame/dialogs/kgamedialogconfig.o
CMakeFiles/kdegames.dir/kgame/dialogs/kgameerrordialog.o
CMakeFiles/kdegames.dir/carddeckinfo.o CMakeFiles/kdegames.dir/kcarddialog.o
CMakeFiles/kdegames.dir/kchat.o CMakeFiles/kdegames.dir/kchatbase.o
CMakeFiles/kdegames.dir/kchatbaseitemdelegate.o
CMakeFiles/kdegames.dir/kchatbasemodel.o CMakeFiles/kdegames.dir/kchatdialog.o
CMakeFiles/kdegames.dir/kgamecanvas.o CMakeFiles/kdegames.dir/kgameclock.o
CMakeFiles/kdegames.dir/kgamelcd.o CMakeFiles/kdegames.dir/kgamemisc.o
CMakeFiles/kdegames.dir/kgameprogress.o
CMakeFiles/kdegames.dir/kgamepopupitem.o
CMakeFiles/kdegames.dir/kgamesvgdocument.o CMakeFiles/kdegames.dir/kgametheme.o
CMakeFiles/kdegames.dir/kgamethemeselector.o
CMakeFiles/kdegames.dir/kstandardgameaction.o
CMakeFiles/kdegames.dir/kgamedifficulty.o CMakeFiles/kdegames.dir/cardcache.o
-L/usr/lib32/qt4 /usr/lib64/libkio.so.5.5.0 /usr/lib64/libkdeui.so.5.5.0
/usr/lib64/libkdnssd.so.4.5.0 /usr/lib64/libknewstuff3.so.4.5.0
/usr/lib32/qt4/libQtXml.so /usr/lib32/qt4/libQtNetwork.so
/usr/lib64/libkio.so.5.5.0 /usr/lib32/qt4/libQtXml.so
/usr/lib32/qt4/libQtNetwork.so /usr/lib64/libkdeui.so.5.5.0
/usr/lib32/qt4/libQtSvg.so /usr/lib64/libkdecore.so.5.5.0
/usr/lib32/qt4/libQtCore.so -lpthread /usr/lib32/qt4/libQtDBus.so
/usr/lib32/qt4/libQtGui.so -Wl,-rpath,/usr/lib32/qt4:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/../../../../x86_64-pc-linux-gnu/bin/ld:
mode elf_i386
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/../../../../lib32/crti.o
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/32/crtbeginS.o
CMakeFiles/kdegames.dir/kdegames_automoc.o
CMakeFiles/kdegames.dir/digits/kgamesvgdigits.o
CMakeFiles/kdegames.dir/highscore/kexthighscore_item.o
CMakeFiles/kdegames.dir/highscore/kexthighscore_internal.o
CMakeFiles/kdegames.dir/highscore/kexthighscore_tab.o
''
...
``
CMakeFiles/kdegames.dir/kstandardgameaction.o
CMakeFiles/kdegames.dir/kgamedifficulty.o
CMakeFiles/kdegames.dir/cardcache.o
/usr/lib64/libkio.so.5.5.0
/usr/lib64/libkio.so.5.5.0: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[2]: *** [lib/libkdegames.so.5.0.0] Error 1
make[2]: Leaving directory
`/var/tmp/portage/kde-base/libkdegames-4.5.2/work/libkdegames-4.5.2_build'
make[1]: *** [libkdegames/CMakeFiles/kdegames.dir/all] Error 2
make[1]: Leaving directory
`/var/tmp/portage/kde-base/libkdegames-4.5.2/work/libkdegames-4.5.2_build'
make: *** [all] Error 2
''

If kdelibs installed the EXPORT files into $(libdir) as almost suggested by the
example at http://cmake.org/cmake/help/cmake-2-8-docs.html#command:install ,
then I expect I would be able to compile a 32-bit version of libkdegames with
no problem. Another example of using $(libdir) for storing compile-time
metadata is pkg-config.


Reproducible: Always

Steps to Reproduce:
1. Set up your system to use a multilib-nosymlink style libdir structure. In
this format /lib is _not_ a symlink to /lib64 nor to /lib32; /lib32, /lib, and
/lib64 are distinct directories. The same paradigm applies to /usr/lib*.

Why must /lib not be a symlink to /lib64? Because this can hide problems where
an application's ./configure script should be pulling data from /lib32 but it
instead pulls the data from /lib (which is a symlink to /lib64). This makes
debugging a multilib-related compilation failure harder; the multilib-nosymlink
setup is much more straight-forward to debug.

2. Install both the 32-bit and 64-bit versions of =kde-base/kdelibs-4.5.2 using
portage-multilib
(https://github.com/sjnewbury/multilib-overlay/blob/portage-multilib/doc/portage-multilib-instructions).
portage-multilib will compile every package twice, once with normal CFLAGS and
again after inserting -m32 into CFLAGS and CXXFLAGS to produce 32-bit binaries.
It will also correctly set --with-libdir to /usr/lib64 or /usr/lib32 based on
which bitiness is being used. See also
http://public.kitware.com/Bug/view.php?id=11260 for a patch which fixes cmake's
ability to find automoc's .cmake files (which are properly installed into
$(libdir)).

3. Attempt to install both 32-bit and 64-bit versions of =libkdegames-4.5.2 .

(even though I am using the standard ./configure-style terminology to describe
how a 32-bit compilation is achieved, I recognize that kde uses CMake which has
more complicated and harder-to-remember methods/conventions for doing the same
thing. Unfortunately, CMake's authors disagree with some of these conventions:
http://public.kitware.com/Bug/view.php?id=10287 )

Actual Results:  
The installation of =libkdegames-4.5.2 fails with the error shown in
description.

Expected Results:  
Instead of specifying a full path to /usr/lib64/libkio.so.5.5.0, the Makefile
should just use -lkio so that the linker can find /usr/lib32/libkio.so (which
is in its searchpath).

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Unassigned-bugs mailing list