bug-libtool
[Top][All Lists]
Advanced

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

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


From: Jo Shields
Subject: bug#39583: Error with cross-compiling where CCLD is Clang
Date: Wed, 12 Feb 2020 16:46:37 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

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`)

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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