Cross compiling LibreOffice - x86_64 to aarch64

Ray Vine ray-v at inbox.lv
Fri Sep 6 13:56:35 UTC 2019


On 02/09/19 10:09, Michael Stahl wrote:
> On 30.08.19 21:51, Ray Vine wrote:
>> [CMP] animations/source/animcore/animcore
>> /w5/build-area/LO-6304/solenv/gbuild/ComponentTarget.mk:50:
>> *** No LIBFILENAME set at component target:
>> /w5/build-area/LO-6304/workdir_for_build/ComponentTarget/animations/source/animcore/animcore.component.
>>   Stop.
>> make[1]: *** Waiting for unfinished jobs....
>> make: *** [Makefile:295: cross-toolset] Error 2
> 
> looks like some library requires "animcore" but the module that contains Library_animcore.mk i.e. "animations" is missing in RepositoryModule_build.mk.
> 

Thanks, that set me on the path to a successful build.

Added animations to RepositoryModule_build.mk but then got another error:

| /w5/build-area/LO-6304/solenv/gbuild/LinkTarget.mk:687: *** used LinkTarget Library/libopencllo.so not defined.

and decided to try using a sledgehammer to fix it - replaced the modules list in RepositoryModule_build.mk with the list from RepositoryModule_host.mk and the BUILD system build then completed.

Presuming the purpose of the BUILD system build is to create binaries needed for the HOST compilation, this probably creates more than needed, but at least gives me a base build that works.
TODO: revisit this to add only the modules required.

Apart then from some issues related to my installation, the HOST build continued until getting to coinmp.
What a pita!

'configure' for each sub-directory uses $HOST-pkg-config to generate build data [--modversion, --cflags, etc], one use of which is to determine whether the source is available:

| checking for COIN-OR package CoinUtils... not given: No package 'coinutils' found
| configure: error: Required package CoinUtils not available.
| configure: error: /bin/sh './configure' failed for Osi

It also sets up a PKG_CONFIG_PATH which includes the local path to .pc files in the source and that is overwritten by the entry in the wrapper script:

aarch64-linux-gnu-pkg-config fails:
PKG_CONFIG_PATH=/w5/build-area/LO-6304/workdir/UnpackedTarball/coinmp/CoinUtils aarch64-linux-gnu-pkg-config --modversion "coinutils"
| Package coinutils was not found in the pkg-config search path.
| Perhaps you should add the directory containing `coinutils.pc`
| to the PKG_CONFIG_PATH environment variable
| No package 'coinutils' found

pkg-config succeeds:
PKG_CONFIG_PATH=/w5/build-area/LO-6304/workdir/UnpackedTarball/coinmp/CoinUtils pkg-config --modversion "coinutils"
| 2.9.11

And derived from '--cflags coinutils', the includes path is wrong:
| Making all in Osi
| Making all in src/Osi
| mkdir .libs
|  aarch64-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I<path-to-cross-tools>/sysroot/w5/build-area/LO-6304/workdir/UnpackedTarball/coinmp/CoinUtils/src -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long -DOSI_BUILD -MT OsiAuxInfo.lo -MD -MP -MF .deps/OsiAuxInfo.Tpo -c OsiAuxInfo.cpp  -fPIC -DPIC -o .libs/OsiAuxInfo.o
| OsiAuxInfo.cpp:10:10: fatal error: CoinPragma.hpp: No such file or directory
|    10 | #include "CoinPragma.hpp"
|       |          ^~~~~~~~~~~~~~~~

CoinPragma.hpp is in
/w5/build-area/LO-6304/workdir/UnpackedTarball/coinmp/CoinUtils/src
not
<path-to-cross-tools>/sysroot/w5/build-area/LO-6304/workdir/UnpackedTarball/coinmp/CoinUtils/src


The eventual work-around I came up with was to modify the wrapper script to bypass the PKG_CONFIG_* variables only for the coinmp configure scripts, i.e. if PKG_CONFIG_PATH contains CoinUtils:

[[ ! $PKG_CONFIG_PATH == *CoinUtils* ]] && {
PKG_CONFIG_PATH=
PKG_CONFIG_SYSROOT_DIR=<path-to-cross-tools>/sysroot
PKG_CONFIG_LIBDIR=<path-to-cross-tools>/sysroot/usr/lib64/pkgconfig
}
exec pkg-config "$@"


That did the trick - the build completed, and so far LO 6.3.0.4 is running OK.




More information about the LibreOffice mailing list