Skip to contentSkip to conversation

rust: Add linker configurations for cross compilation

PATCH In review [email protected] 2 participants 2 messages Sep 4, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rust: Add linker configurations for cross compilation

From: pgowda <[email protected]>

Adds the cross compilation linker for build, host and target. Ensure the main rust config has the appropriate sections added to match the configurations.

---
 meta/recipes-devtools/rust/rust.inc | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-devtools/rust/rust.inc +3 -0
index 284347dedc..20fd797a90 100644
@@ -81,6 +81,7 @@ python do_configure() {
 
     config.set(host_section, "cxx", e(d.expand("${RUST_TARGET_CXX}")))
     config.set(host_section, "cc", e(d.expand("${RUST_TARGET_CC}")))
+    config.set(host_section, "linker", e(d.expand("${RUST_TARGET_CCLD}")))
     if "musl" in host_section:
         config.set(host_section, "musl-root", e(d.expand("${STAGING_DIR_HOST}${exec_prefix}")))
 
@@ -94,6 +95,7 @@ python do_configure() {
 
         config.set(build_section, "cxx", e(d.expand("${RUST_BUILD_CXX}")))
         config.set(build_section, "cc", e(d.expand("${RUST_BUILD_CC}")))
+	config.set(build_section, "linker", e(d.expand("${RUST_BUILD_CCLD}")))
 
     target_section = "target.{}".format(d.getVar('RUST_TARGET_SYS', True))
     if target_section != host_section and target_section != build_section:
@@ -103,6 +105,7 @@ python do_configure() {
 
         config.set(target_section, "cxx", e(d.expand("${RUST_TARGET_CXX}")))
         config.set(target_section, "cc", e(d.expand("${RUST_TARGET_CC}")))
+	config.set(target_section, "linker", e(d.expand("${RUST_TARGET_CCLD}")))
 
     # [llvm]
     config.add_section("llvm")
Signature · 1 line
2.25.1
#1 lore raw
Quoted 24 lines · On Sun, 2022-09-04 at 12:34 +0530, [email protected] wrote:

From: pgowda <[email protected]>

Adds the cross compilation linker for build, host and target. Ensure the main rust config has the appropriate sections added to match the configurations.

---
 meta/recipes-devtools/rust/rust.inc | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-devtools/rust/rust.inc +1 -0
index 284347dedc..20fd797a90 100644
@@ -81,6 +81,7 @@ python do_configure() {
 
     config.set(host_section, "cxx", e(d.expand("${RUST_TARGET_CXX}")))
     config.set(host_section, "cc", e(d.expand("${RUST_TARGET_CC}")))
+    config.set(host_section, "linker", e(d.expand("${RUST_TARGET_CCLD}")))
     if "musl" in host_section:
         config.set(host_section, "musl-root", e(d.expand("${STAGING_DIR_HOST}${exec_prefix}")))
 

meta/recipes-devtools/rust/rust.inc python do_configure() { · line 101

Quoted 7 lines
meta/recipes-devtools/rust/rust.inc +1 -0
@@ -94,6 +95,7 @@ python do_configure() {
 
         config.set(build_section, "cxx", e(d.expand("${RUST_BUILD_CXX}")))
         config.set(build_section, "cc", e(d.expand("${RUST_BUILD_CC}")))
+	config.set(build_section, "linker", e(d.expand("${RUST_BUILD_CCLD}")))
 
     target_section = "target.{}".format(d.getVar('RUST_TARGET_SYS', True))
     if target_section != host_section and target_section != build_section:

Your mailer somehow converted 8 spaces to a tab above. In the interests of moving forward, I'll fix this one up and test it.

Cheers,

Richard