From 46981239e8dc5982e0cd5f3db90058f40ac709c2 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 20 Sep 2019 21:34:29 +0000 Subject: THAT'S IT WE HAVE EASY CROSS-COMPILATION FOLKS --- doc/crosscompile.html | 60 +++++++++++++++++---------------------------------- 1 file changed, 20 insertions(+), 40 deletions(-) (limited to 'doc/crosscompile.html') diff --git a/doc/crosscompile.html b/doc/crosscompile.html index e883142..3361ff8 100644 --- a/doc/crosscompile.html +++ b/doc/crosscompile.html @@ -57,56 +57,36 @@ options must be the valid paths for run-time. DESTDIR=stage. -

Support for build-time options

+

Support for build-time options and bypassing target execution tests

- skalibs now uses a standard ./configure && make && make install + skalibs uses a standard ./configure && make && make install process, and cross-compiling build-time options can be given on the ./configure command line.

-

Bypassing the build-time tests

- -

- This is the hardest part of cross-compilation, and very few build systems -get it right. (GNU autotools does not, which is one of the reasons why -skarnet.org packages do not use autotools.) -

-

- Native build procedures usually perform build-time tests: they compile -executables and run them (on the build platform, which is the same as -the target platform) to check for features and system quirks. skalibs -does exactly that: the ./configure step performs tests on the -build platform and stores the system-dependent results in a directory -that it calls the sysdeps for this platform. + skalibs performs a certain number of build-time tests, to collect +behaviour information on the target architecture. Most of these tests +work when cross-compiling, because they only involve characteristics +of the target that the cross-toolchain knows at build time; but some +actually require code execution on the target, and so they cannot be +performed when cross-compiling. For those, you have to manually +give a special option to configure, to tell the build system what the +behaviour of the target architecture is. The option is of the form +--with-sysdep-key=value, where key +is the name of the sysdep (i.e. the element of target behaviour that +is being tested), and value the associated value, most of +the time yes or no.

-But in a -cross-compilation environment, build-time tests are invalid, since the build -platform and the target platform differ. - There is only one way to cross-compile portable code without resorting -to build-time autodetection: -you must provide by hand the sysdeps for your target -architecture, via the --with-sysdeps option to configure. -

- -

- The easiest way to get the correct sysdeps for a target achitecture is -to natively run skalibs' ./configure script on that target, -and steal the produced sysdeps files, which are normally written to the -./sysdeps.cfg directory. -Doing this is easy with a virtual machine, qemu for instance. -You could also (politely) ask for precompiled sysdeps on the -skaware mailing-list, if you cannot find them anywhere on the Internet. -

- -

Credits

- -

-Dan Kegel brought up the need for a -clean cross-compilation system. + At all times, ./configure --help provides the list of sysdeps +you need to provide a --with-sysdep-* option for. As of +skalibs-2.9.0.0, there is only one such sysdep, named devurandom, +and the value should be yes if the target has a valid +pseudorandom generation device in /dev/urandom, and no +otherwise.

-- cgit v1.2.3