[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libtool hardcodes native (cross-)compiler, incorrect when using libtool

From: Maxime Devos
Subject: libtool hardcodes native (cross-)compiler, incorrect when using libtool as cross-compiler
Date: Thu, 29 Apr 2021 00:03:33 +0200
User-agent: Evolution 3.34.2


[CC'ing to libtool mailing list, maybe they can shed some light on the matter
of how libtool can be used as a cross-compiler.  This concerns the definition
of the libtool package in guix.]

$ cat $(guix build libtool)/bin/libtool
Some relevant output:

> # A C compiler.
> LTCC="gcc"
> # Compile-time system search path for libraries.
> sys_lib_search_path_spec="/gnu/store/8zvc5mvk0xm3ygrxsgpyy5ilxb5rzjry-perl-5.30.2/lib
>  /gnu/store/i5a9qb07y9xjh9ry8hp6km43kji16nmd-libltdl-2.4.6/lib 
> /gnu/store/i8h2pcxqdq07ijm3ibkka8f4smn1w48v-bzip2-
1.0.8/lib /gnu/store/9860f1abqj8wjjnwl8a9v54pdcc3bhgf-xz-5.2.4/lib 
/gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib "

Usually, libtool uses the compiler it was passed.
However, during linking, (at least during the compilation of libtomsmath IIRC),
libtool uses LTCC instead.  Thus, when a package X has libtool in native-inputs,
and it is being cross-compiled, it should really use a variant of libtool that 
been configured to set LTCC=TARGET-gcc (or LTCC=TARGET-clang).

There do not seem to exist any such variants currently.  (For a relatively clean
method for automatically using a cross-compiling variant, see the "pkg-config"
macro.) Thus, I thought it would ‘simply’ be a matter of passing an appropriate
"--target=TARGET" option to libtool's configure script when libtool is being 
as cross-compiler.  But alas, libtool configure only supports --build and 
no --target in sight!

Any ideas?

Attachment: signature.asc
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]