bug#39583: Error with cross-compiling where CCLD is Clang

Jo Shields <[email protected]>
Newsgroups gmane.comp.gnu.libtool.bugs
Message-ID <[email protected]>
Hi,

I've been working on a project where we cross-compile for aarch64, on an
x86_64 host. The compiler we're under orders to use (I have no say here)
is Clang.

The norm with GCC is for a `triplet-gcc` binary as CC. For Clang,
cross-compiling is achieved with a `--target=triplet` compiler flag - i.e.

`aarch64-linux-gnu-gcc foo.c`

vs

`clang --target=aarch64-linux-gnu foo.c`

Critically, this applies even for cases where CC is being used as the
linker (i.e. CCLD=clang). If no `--target` is specified, Clang will use
the native (x86_64) linker, not the linker specified in LD.

This can be worked around by throwing `-XCClinker --target=triplet` into
every linker invocation in every makefile, but it would be nice if
instead, ltmain preserved the `--target` parameter in func_mode_link
(e.g. the way it does for `--sysroot`)

_______________________________________________
Bug-libtool mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-libtool
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEwQsMQnGBo0sbxf7dyQ+cuQ4frQwFAl5EckUACgkQyQ+cuQ4f
rQyA4Qf+LRTgKkPvDuTS0AwCym8p/Zz3OwQ0PZ0hsvsNDsicJj2hxDzF0D7MPfnU
eh/LY4VOrAPKnIkXH4YdvXXyB5XcvWbyzsaeYlhDONmW1v6ONOnYFcP8axI9W6GS
BmVJAnFSd/lHu63NSBrejubhAWdGTtyYMjf8wyOfmtzAbT9KNLFxq41zO/gHG+YQ
kR36tFRfS1BeU81s5dQFTtQWf4u6V/Wu7HmZaVZi1Gz1gwizznn2sZVn9ewfM+ro
Ox7DdDyZcC+/z8Jr/f5Ji3bURAmEJfqcHXjLMbyoMRct4SPIHsBAaIjUsrb9PsBr
dE9tHZmqEi3QyTg5Sll2WX8GCc556g==
=uHWR
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.