* [Buildroot] [PATCH v2] package/clang: default linker to the cross GNU
@ 2018-10-21 12:21 Matt Weber
2018-10-21 14:29 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Matt Weber @ 2018-10-21 12:21 UTC (permalink / raw)
To: buildroot
By default clang is assuming the system linker /usr/bin/ld. This
patchset updates the default to point at the cross toolchain ld.
Previously clang had been used on target only, this update is
required for host clang/clang++ to be used as a frontend for
cross-compiling.
Example build command:
output/host/bin/clang++ -mcpu=cortex-a53 \
--sysroot /<abs path>/output/staging/ \
-B /<abs path>/output/host/opt/ext-toolchain/ \
foobar.cc -o foobar
Cc: Valentin Korenblit <valentinkorenblit@gmail.com>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
---
Changes
v1 -> v2
[Romain
- Added example build command in commit description as example
for an eventual wrapper
- Moved setting of ld path option to be with other path assignments
---
package/clang/clang.mk | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/package/clang/clang.mk b/package/clang/clang.mk
index 52e0b98..f9d4ae3 100644
--- a/package/clang/clang.mk
+++ b/package/clang/clang.mk
@@ -49,7 +49,8 @@ CLANG_CONF_OPTS += \
-DCLANG_INCLUDE_DOCS=OFF \
-DCLANG_INCLUDE_TESTS=OFF
-HOST_CLANG_CONF_OPTS += -DLLVM_CONFIG:FILEPATH=$(HOST_DIR)/bin/llvm-config
+HOST_CLANG_CONF_OPTS += -DLLVM_CONFIG:FILEPATH=$(HOST_DIR)/bin/llvm-config \
+ -DCLANG_DEFAULT_LINKER=$(TARGET_LD)
CLANG_CONF_OPTS += -DLLVM_CONFIG:FILEPATH=$(STAGING_DIR)/usr/bin/llvm-config \
-DCLANG_TABLEGEN:FILEPATH=$(HOST_DIR)/bin/clang-tblgen \
-DLLVM_TABLEGEN_EXE:FILEPATH=$(HOST_DIR)/bin/llvm-tblgen
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH v2] package/clang: default linker to the cross GNU
2018-10-21 12:21 [Buildroot] [PATCH v2] package/clang: default linker to the cross GNU Matt Weber
@ 2018-10-21 14:29 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2018-10-21 14:29 UTC (permalink / raw)
To: buildroot
Hello,
On Sun, 21 Oct 2018 07:21:35 -0500, Matt Weber wrote:
> By default clang is assuming the system linker /usr/bin/ld. This
> patchset updates the default to point at the cross toolchain ld.
>
> Previously clang had been used on target only, this update is
> required for host clang/clang++ to be used as a frontend for
> cross-compiling.
>
> Example build command:
>
> output/host/bin/clang++ -mcpu=cortex-a53 \
> --sysroot /<abs path>/output/staging/ \
> -B /<abs path>/output/host/opt/ext-toolchain/ \
> foobar.cc -o foobar
>
> Cc: Valentin Korenblit <valentinkorenblit@gmail.com>
> Reviewed-by: Romain Naour <romain.naour@gmail.com>
> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
> ---
> Changes
> v1 -> v2
> [Romain
> - Added example build command in commit description as example
> for an eventual wrapper
> - Moved setting of ld path option to be with other path assignments
> ---
> package/clang/clang.mk | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-21 14:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-21 12:21 [Buildroot] [PATCH v2] package/clang: default linker to the cross GNU Matt Weber
2018-10-21 14:29 ` Thomas Petazzoni
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.