unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: 48088@debbugs.gnu.org
Cc: libtool@gnu.org
Subject: bug#48088: libtool hardcodes native (cross-)compiler, incorrect when using libtool as cross-compiler
Date: Thu, 29 Apr 2021 00:03:33 +0200	[thread overview]
Message-ID: <e83c2512749a164b4f140ff237b3b5bc1b198c4b.camel@telenet.be> (raw)

[-- Attachment #1: Type: text/plain, Size: 1987 bytes --]

Hi,

[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/60g7r3l01fd7c58yjbm6krgcwj1jkpwg-file-5.38/lib /gnu/store/swqdvwri9dbv6zssg6v0by7l05hd6wxp-gawk-5.0.1/lib
/gnu/store/m1z7cdbqsqyp9xnjw5cvlb4a7gkcg3m4-binutils-2.34/lib /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib /gnu/store/s3dcqzwqaakv1yx37by9chksdbkgih17-glibc-2.31-static/lib
/gnu/store/hwcky7446s952w0mwchhmm211ll07zrq-glibc-utf8-locales-2.31/lib /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0
/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 has
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 used
as cross-compiler.  But alas, libtool configure only supports --build and --host,
no --target in sight!

Any ideas?
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

             reply	other threads:[~2021-04-28 22:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28 22:03 Maxime Devos [this message]
2021-04-29 11:52 ` bug#48088: libtool hardcodes native (cross-)compiler, incorrect when using libtool as cross-compiler Ludovic Courtès
2021-04-29 17:18   ` Maxime Devos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e83c2512749a164b4f140ff237b3b5bc1b198c4b.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=48088@debbugs.gnu.org \
    --cc=libtool@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).