Questions about cross compiling for ARM / CMake issues

Alexander Neundorf neundorf at kde.org
Mon Feb 27 16:34:34 UTC 2012


On Monday 27 February 2012, Samuel Stirtzel wrote:
> 2012/2/27 Andreas Pakulat <apaku at gmx.de>:
> > On 27.02.12 14:53:33, Samuel Stirtzel wrote:
> >> 2012/2/27 Andreas Pakulat <apaku at gmx.de>:
> >> > On 27.02.12 14:16:38, Samuel Stirtzel wrote:
> >> >> 2012/2/27 Samuel Stirtzel <s.stirtzel at googlemail.com>:
> >> >> > Hi,
> >> >> > this is part of the approach to port Plasma Active to OpenEmbedded
> >> >> > (see [1], [2]).
> >> >> > 
> >> >> > 
> >> >> > In the current status the kdelibs build fine.
> >> >> > 
> >> >> > However there is an issue where other packages (like e.g. Nepomuk)
> >> >> > use the wrong libraries.
> >> >> > In this case Nepomuk tries to use the Hosts x86_64 libraries for
> >> >> > kdecore and kdeui, (see http://pastebin.com/CqqSGxYY for an
> >> >> > example).
> >> >> > 
> >> >> > The path "/work/oe-core/tmp-eglibc/sysroots/overo/" is the staging
> >> >> > sysroot of the build target.
> >> >> > And since CMAKE_FIND_ROOT_PATH is set to that path, it should not
> >> >> > "find" the library somewhere else..?
> >> >> > "CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY" is also set.
> >> >> > 
> >> >> > Is this by any chance related to the absolute paths in the
> >> >> > KDELibsDependencies.cmake file?
> >> >> > 
> >> >> > 
> >> >> > 
> >> >> > Anyone has an idea what I'm missing to solve this?
> >> >> > Help would be appreciated.
> >> >> > 
> >> >> > 
> >> >> > Links:
> >> >> > [1] Plasma Active port to OpenEmbedded:
> >> >> > http://lists.kde.org/?l=kde-active&m=132940140929418&w=2
> >> >> > [2] OpenEmbedded: http://www.openembedded.org/wiki/Main_Page
> >> >> > 
> >> >> > --
> >> >> > Regards
> >> >> > Samuel
> >> >> 
> >> >> Just to clarify my question, changing the KDELibsDependencies.cmake
> >> >> file does not solve my problem.
> >> >> In the logs it states "Found KDE 4.7 library dir:
> >> >> /work/oe-core/tmp-eglibc/sysroots/overo/usr/lib" but still the error
> >> >> occurs: "/usr/lib/libkdecore.so.5.7.0: file not recognized: File
> >> >> format not recognized"
> >> >> 
> >> >> Is there any Black Magic™ that finds the core library and relentless
> >> >> ignores all the other settings?
> >> > 
> >> > Please provide at least the complete linker line (make VERBOSE=1) so
> >> > we can see how kdecore is being linked.
> >> 
> >> Thanks for your answer.
> >> 
> >> Here the complete line with verbose=1: http://pastebin.com/EebmCiN2
> > 
> > Ok, so the absolute path to kdecore&Co is wrong. Hmm, makes me wonder
> > wether kdelibs supports cross-compilation at all...
> 
> IMHO it is between supporting cross compiling and not supporting it
> (aka. there is something but it won't work out of the box).

Officially, it does not support cross compiling.

There were some attempts, but none of them got it done properly.

You may be able to get it kind of working, but the right solution would be to 
implement it properly:
* follow what the cmake cross compiling wiki page says
* properly differentiate between host and target in the build files (both when 
building, as well as when using imported targets from kdelibs): 
** include the exported executable targets from a native build, and include 
the exported library targets from a cross build
* create correct try_run() results e.g. for kdelibs for some platform and put 
them somewhere reusable.

This may need features in cmake too, e.g. support for scratchbox etc.

Alex


More information about the Kde-buildsystem mailing list