First off, thanks to everyone who tried to help me with my strange
cross compilation endeavor. I am happy to say that I finally got it
working. Although I cannot post proper patches to fix the cross
issues, still I would like to provide a starting point, in case
someone else wants to clean this up or just build cross.
I built version 4.4.0.3 under ptxdist with the following configure
environment ...
$(CROSS_ENV) \
CFLAGS=-I$(SYSROOT)/usr/include \
CXXFLAGS=-I$(SYSROOT)/usr/include \
LDFLAGS="-L$(SYSROOT)/usr/lib -L$(SYSROOT)/lib -Wl,-rpath-link,$(SYSROOT)/usr/lib" \
X_LIBS="-lxcb -lXau -lXdmcp -lX11 -lICE -lSM"
and these configure options.
--host=x86_64-unknown-linux-gnu \
--build=x86_64-host-linux-gnu \
--disable-cups \
--disable-dbus \
--disable-firebird-sdbc \
--disable-gconf \
--disable-gtk \
--disable-odk \
--disable-pdfimport \
--disable-postgresql-sdbc \
--disable-randr \
--enable-python=no \
--with-lang="en-US de" \
--with-system-cairo \
--with-system-zlib=no \
--without-help \
--without-java \
--without-system-dicts \
--x-includes=$(SYSROOT)/usr/include \
--x-libraries=$(SYSROOT)/usr/lib
Now, to the trouble spots:
* configure.ac
This script has lots of issues, most of which I hacked around. The
whole CONF-FOR-BUILD thing is, well, creative. The "unset" does not
go far enough. In my case I added:
unset \
AR AS LD NM CC CXX CPP RANLIB READELF OBJCOPY OBJDUMP STRIP DLLTOOL \
GNAT GNATBIND GNATCHOP GNATCLEAN GNATFIND GNATKR GNATLINK GNATLS \
GNATMAKE GNATNAME GNATPREP GNATXREF CC_FOR_BUILD CPP_FOR_BUILD \
LINK_FOR_BUILD SYSROOT PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG \
enable_option_checking enable_maintainer_mode enable_static \
ac_cv_file__dev_random ac_cv_file__proc_self_exe \
ac_cv_file__proc_self_fd ac_cv_file__proc_self_maps \
ac_cv_func_dcgettext ac_cv_func_getpgrp_void ac_cv_func_getrlimit \
ac_cv_func_malloc_0_nonnull ac_cv_func_memcmp_clean \
ac_cv_func_memcmp_working ac_cv_func_nonposix_getgrgid_r \
ac_cv_func_nonposix_getpwuid_r ac_cv_func_posix_getgrgid_r \
ac_cv_func_posix_getpwnam_r ac_cv_func_posix_getpwuid_r \
ac_cv_func_printf_unix98 ac_cv_func_realloc_0_nonnull \
ac_cv_func_setgrent_void ac_cv_func_setpgrp_void \
ac_cv_func_setvbuf_reversed ac_cv_func_strstr ac_cv_func_strtod \
ac_cv_func_strtoul ac_cv_func_vsnprintf_c99 ac_cv_func_wait3_rusage \
ac_cv_have_abstract_sockets ac_cv_lib_c_inet_aton \
ac_cv_sizeof_long_double ac_cv_sizeof_long_long ac_cv_sysv_ipc \
ac_cv_type_uintptr_t bash_cv_func_ctype_nonascii \
bash_cv_func_sigsetjmp bash_cv_func_strcoll_broken \
bash_cv_must_reinstall_sighandlers glib_cv_long_long_format \
gt_cv_func_gettext_libintl ac_cv_func_fork ac_cv_func_fork_works \
ac_cv_func_iconv_open CPPFLAGS CFLAGS CXXFLAGS LDFLAGS X_LIBS
This corresponds to the standard CROSS_ENV provided by ptxdist.
Also, the PATH needs reseting in order to avoid the cross tools.
I added
--disable-gconf \
--disable-dbus \
--disable-gtk \
--disable-gstreamer-1-0 \
--enable-python=no \
to the configure options. Probably this list could be expanded.
The tests for "$cross_compiling" are pretty messed up, especially
WRT cppunit and python.
The PATH from the enviroment is not getting through the script into
the config_host.mk as it should. The same goes for CPPFLAGS. My
work around was to fix the PATH after the fact, and to put the
nedded CPPFLAGS into CFLAGS and CXXFLAGS.
* icu 53
Some of the objects (sorry didn't keep notes which ones) are built
using the system headers, which in my case where icu version 52.
This happens even when using the "external" icu. If the system
lacks the icu headers, then LO cannot build. I got tired of playing
whack-the-mole and just reverted the LO patch that upgraded to 53.
* external/glew
** ExternalProject_glew.mk
- pass CFLAGS to CFLAGS.EXTRA
- pass LDFLAGS to LDFLAGS.EXTRA
* external/libgltf
** ExternalProject_libgltf.mk
- configure with --build and --host
* external/nss
** ExternalProject_nss.mk
- needs --enable-64bit to avoid -m32 (which my cross gcc doesn't have)
- needs to set NSINSTALL and NSDISTMODE on the make command line,
not in the environment.
- picks the wrong macros for atomics in nspr/pr/include/md/_linux.h
- should not try to sign libraries using cross compiled binaries
nss/cmd/shlibsign/sign.sh
* external/redland
** ExternalProject_raptor.mk
- pass CFLAGS, LIBXML_CFLAGS, and LDFLAGS
** ExternalProject_rasqal.mk
- pass CFLAGS and LDFLAGS
** ExternalProject_redland.mk
- pass CFLAGS and LDFLAGS
Thanks,
Richard
Context
- Laundry list of cross compilation issues · Richard Cochran
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.