Cross compiling LibreOffice - x86_64 to aarch64

Ray Vine ray-v at inbox.lv
Fri Aug 30 19:51:01 UTC 2019


 
I would like to cross compile LibreOffice for
aarch64 to run on my RPi3.

I've built it natively on x86_64 and am using the
same configure options for the cross compilation,
but getting errors almost immediately when it
starts with the BUILD system build.

As far as I can tell, I'm effectively doing what's
in README.cross|Raspbian.
Building on Slackware with my own cross compiler.

The set up is:

export CONFIGURE_OPTS="
--prefix=/
--disable-postgresql-sdbc
--without-java
--without-junit
--disable-odk
--without-krb5
--without-gssapi
--disable-gtk3
--disable-gtk
--disable-gstreamer-0-10
--disable-gstreamer-1-0
--disable-epm
--enable-release-build
--with-parallelism=6
--with-locales=en-GB
--with-lang=en-GB
--with-help
--with-external-tar=/w5/external_tarballs-6304
--with-system-libatomic_ops
--with-system-nss
--with-system-libpng
--with-theme=colibre"


For a native x86_64 build:
-------------------------
./autogen.sh $CONFIGURE_OPTS
make build-nocheck

.. builds successfully


For cross-compiling:
-------------------
export HOST=aarch64-linux-gnu
export SYSROOT=<path-to-cross-tools>/sysroot
export CC=$HOST-gcc
export CXX=$HOST-g++
mount -B
<directory-containing-HOST-libs-and-headers> $SYSROOT
export LIBDIRSUFFIX=64
export PATH=<path-to-cross-tools>/bin:$PATH
For HOST configuration:
export PYTHON_CFLAGS=-I$SYSROOT/usr/include/python2.7
export PYTHON_LIBS=-lpython2.7


Set up a pkg-config wrapper script for HOST and
name it $HOST-pkg-config because that's what
configure looks for:

echo $"PKG_CONFIG_PATH='' \\
PKG_CONFIG_SYSROOT_DIR=$SYSROOT \\
PKG_CONFIG_LIBDIR=$SYSROOT/usr/lib$LIBDIRSUFFIX/pkgconfig
\\
exec pkg-config \"\$@\"" >
<path-to-cross-tools>/bin/$HOST-pkg-config


./autogen.sh $CONFIGURE_OPTS --host=$HOST
--with-build-platform-configure-options="$CONFIGURE_OPTS
--without-help --without-system-dicts"

completes OK and everything looks OK

'make build-nocheck' or 'make' produces two errors
almost immediately:

[1]
make gb_Side=build -j 6 -rs -f
/w5/build-area/LO-6304/Makefile fetch
make gb_Side=build -j 6 -rs -f
/w5/build-area/LO-6304/Makefile.gbuild build-tools
/w5/build-area/LO-6304/RepositoryModule_build.mk:12:
*** Module does not exist:
/w5/build-area/LO-6304/mysqlc/Module_mysqlc.mk.  Stop.
make: *** [Makefile:299: cross-toolset] Error 2

That's correct as far as I can see - there is no
mysqlc module, so:
sed -i '/mysqlc/d ' RepositoryModule_build.mk
takes me to the next error:

[2]
[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

The directory ComponentTarget doesn't exist at
this stage.

This occurs after a minute or so for the cross
compile, whereas it completes for a native x86_64
build, but after about 5 hours into an 8+ hour build.

Running with --with-parallelism=1 takes a lot
longer but eventually gets to the same error.
ComponentTarget does then exist, but doesn't
contain animations:

ls
/w5/build-area/LO-6304/workdir_for_build/ComponentTarget
binaryurp/  comphelper/  io/  remotebridges/  sax/
 stoc/



More information about the LibreOffice mailing list