Skip to contentSkip to conversation

package/pkg-cargo: ensure host/target rustflags are properly split

PATCH Superseded James Hilliard 2 participants 7 messages Jul 24, 2022 – Apr 10, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/pkg-cargo: ensure host/target rustflags are properly split

Set HOST_LDFLAGS RUSTFLAGS via the host-config feature, see:
https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#host-config

We have to enable this nightly feature first using:
CARGO_UNSTABLE_HOST_CONFIG="true"

Separately set target RUSTFLAGS for the target triple specific env variable.

---
 package/pkg-cargo.mk | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
package/pkg-cargo.mk +8 -3
index f7e3f39503..439d443b0d 100644
@@ -32,7 +32,10 @@ PKG_COMMON_CARGO_ENV = \
 # using nighly features on stable releases, i.e features that are not
 # yet considered stable.
 #
-# CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" "enables the nightly
+# CARGO_UNSTABLE_HOST_CONFIG="true" enables the host specific
+# configuration feature
+#
+# CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" enables the nightly
 # configuration option target-applies-to-host value to be set
 #
 # CARGO_TARGET_APPLIES_TO_HOST="false" is actually setting the value
@@ -41,9 +44,11 @@ PKG_COMMON_CARGO_ENV = \
 PKG_CARGO_ENV = \
 	$(PKG_COMMON_CARGO_ENV) \
 	__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS="nightly" \
+	CARGO_UNSTABLE_HOST_CONFIG="true" \
 	CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" \
 	CARGO_TARGET_APPLIES_TO_HOST="false" \
 	CARGO_BUILD_TARGET="$(RUSTC_TARGET_NAME)" \
+	CARGO_HOST_RUSTFLAGS="$(addprefix -C link-args=,$(HOST_LDFLAGS))" \
 	CARGO_TARGET_$(call UPPERCASE,$(RUSTC_TARGET_NAME))_LINKER=$(notdir $(TARGET_CROSS))gcc
 
 #
@@ -51,7 +56,8 @@ PKG_CARGO_ENV = \
 # and should be removed when fixed upstream
 #
 ifeq ($(NORMALIZED_ARCH),arm)
-	PKG_CARGO_ENV += RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"
+	PKG_CARGO_ENV += \
+		CARGO_TARGET_$(call UPPERCASE,$(RUSTC_TARGET_NAME))_RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"
 endif
 
 HOST_PKG_CARGO_ENV = \
@@ -128,7 +134,6 @@ else # ifeq ($(4),target)
 define $(2)_BUILD_CMDS
 	cd $$($$(PKG)_SRCDIR) && \
 	$$(HOST_MAKE_ENV) \
-		RUSTFLAGS="$$(addprefix -C link-args=,$$(HOST_LDFLAGS))" \
 		$$(HOST_CONFIGURE_OPTS) \
 		$$(HOST_PKG_CARGO_ENV) \
 		$$($(2)_CARGO_ENV) \
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 43 lines · James Hilliard

Set HOST_LDFLAGS RUSTFLAGS via the host-config feature, see:
https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#host-config

We have to enable this nightly feature first using:
CARGO_UNSTABLE_HOST_CONFIG="true"

Separately set target RUSTFLAGS for the target triple specific env variable.

---
  package/pkg-cargo.mk | 11 ++++++++---
  1 file changed, 8 insertions(+), 3 deletions(-)
package/pkg-cargo.mk +6 -1
index f7e3f39503..439d443b0d 100644
@@ -32,7 +32,10 @@ PKG_COMMON_CARGO_ENV = \
  # using nighly features on stable releases, i.e features that are not
  # yet considered stable.
  #
-# CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" "enables the nightly
+# CARGO_UNSTABLE_HOST_CONFIG="true" enables the host specific
+# configuration feature
+#
+# CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" enables the nightly
  # configuration option target-applies-to-host value to be set
  #
  # CARGO_TARGET_APPLIES_TO_HOST="false" is actually setting the value
@@ -41,9 +44,11 @@ PKG_COMMON_CARGO_ENV = \
  PKG_CARGO_ENV = \
  	$(PKG_COMMON_CARGO_ENV) \
  	__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS="nightly" \
+	CARGO_UNSTABLE_HOST_CONFIG="true" \
  	CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" \
  	CARGO_TARGET_APPLIES_TO_HOST="false" \
  	CARGO_BUILD_TARGET="$(RUSTC_TARGET_NAME)" \
+	CARGO_HOST_RUSTFLAGS="$(addprefix -C link-args=,$(HOST_LDFLAGS))" \
  	CARGO_TARGET_$(call UPPERCASE,$(RUSTC_TARGET_NAME))_LINKER=$(notdir $(TARGET_CROSS))gcc
 
  #

package/pkg-cargo.mk PKG_CARGO_ENV = \ · line 60

Quoted 6 lines
package/pkg-cargo.mk +2 -1
@@ -51,7 +56,8 @@ PKG_CARGO_ENV = \
  # and should be removed when fixed upstream
  #
  ifeq ($(NORMALIZED_ARCH),arm)
-	PKG_CARGO_ENV += RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"
+	PKG_CARGO_ENV += \
+		CARGO_TARGET_$(call UPPERCASE,$(RUSTC_TARGET_NAME))_RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"

I don't understand why this is needed. We don't set RUSTFLAGS anywhere else,
so it should be fine? Or is it because RUSTFLAGS is also used for native build even if CARGO_HOST_RUSTFLAGS is set?

(Anyway, this hunk can probably be removed, the bug that triggered it is fixed.)

package/pkg-cargo.mk else # ifeq ($(4),target) · line 131

Quoted 8 lines
package/pkg-cargo.mk +0 -1
  endif
 
  HOST_PKG_CARGO_ENV = \
@@ -128,7 +134,6 @@ else # ifeq ($(4),target)
  define $(2)_BUILD_CMDS
  	cd $$($$(PKG)_SRCDIR) && \
  	$$(HOST_MAKE_ENV) \
-		RUSTFLAGS="$$(addprefix -C link-args=,$$(HOST_LDFLAGS))" \

Why can this be removed? You added CARGO_HOST_RUSTFLAGS to the target build,
but we still want HOST_LDFLAGS in the host package build, no?

Regards,
Arnout

package/pkg-cargo.mk else # ifeq ($(4),target) · line 139

Quoted 3 lines
package/pkg-cargo.mk +0 -0
  		$$(HOST_CONFIGURE_OPTS) \
  		$$(HOST_PKG_CARGO_ENV) \
  		$$($(2)_CARGO_ENV) \

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
Quoted 45 lines · Arnout Vandecappelle
Quoted 41 lines · James Hilliard

Set HOST_LDFLAGS RUSTFLAGS via the host-config feature, see:
https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#host-config

We have to enable this nightly feature first using:
CARGO_UNSTABLE_HOST_CONFIG="true"

Separately set target RUSTFLAGS for the target triple specific env variable.

---
  package/pkg-cargo.mk | 11 ++++++++---
  1 file changed, 8 insertions(+), 3 deletions(-)
package/pkg-cargo.mk +6 -1
index f7e3f39503..439d443b0d 100644
@@ -32,7 +32,10 @@ PKG_COMMON_CARGO_ENV = \
  # using nighly features on stable releases, i.e features that are not
  # yet considered stable.
  #
-# CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" "enables the nightly
+# CARGO_UNSTABLE_HOST_CONFIG="true" enables the host specific
+# configuration feature
+#
+# CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" enables the nightly
  # configuration option target-applies-to-host value to be set
  #
  # CARGO_TARGET_APPLIES_TO_HOST="false" is actually setting the value
@@ -41,9 +44,11 @@ PKG_COMMON_CARGO_ENV = \
  PKG_CARGO_ENV = \
      $(PKG_COMMON_CARGO_ENV) \
      __CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS="nightly" \
+     CARGO_UNSTABLE_HOST_CONFIG="true" \
      CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" \
      CARGO_TARGET_APPLIES_TO_HOST="false" \
      CARGO_BUILD_TARGET="$(RUSTC_TARGET_NAME)" \
+     CARGO_HOST_RUSTFLAGS="$(addprefix -C link-args=,$(HOST_LDFLAGS))" \
      CARGO_TARGET_$(call UPPERCASE,$(RUSTC_TARGET_NAME))_LINKER=$(notdir $(TARGET_CROSS))gcc
 
Quoted 12 lines

package/pkg-cargo.mk PKG_CARGO_ENV = \ · line 60

Quoted 8 lines
package/pkg-cargo.mk +2 -1
  #
@@ -51,7 +56,8 @@ PKG_CARGO_ENV = \
  # and should be removed when fixed upstream
  #
  ifeq ($(NORMALIZED_ARCH),arm)
-     PKG_CARGO_ENV += RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"
+     PKG_CARGO_ENV += \
+             CARGO_TARGET_$(call UPPERCASE,$(RUSTC_TARGET_NAME))_RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"

I don't understand why this is needed. We don't set RUSTFLAGS anywhere else,
so it should be fine? Or is it because RUSTFLAGS is also used for native build even if CARGO_HOST_RUSTFLAGS is set?

So cargo target builds tend to actually build artifacts for both the host and the
target architecture, since cargo build-scripts are themselves written in rust, thus
passing plain RUSTFLAGS has inconsistent behavior it seems in regards to which artifact builds the RUSTFLAGS get applied to(seems to have changed across cargo versions as well). Splitting them explicitly should be more correct.

Quoted 5 lines

(Anyway, this hunk can probably be removed, the bug that triggered it is fixed.)

Quoted 2 lines
package/pkg-cargo.mk +0 -0
  endif
 
Quoted 9 lines

package/pkg-cargo.mk else # ifeq ($(4),target) · line 131

Quoted 6 lines
package/pkg-cargo.mk +0 -1
  HOST_PKG_CARGO_ENV = \
@@ -128,7 +134,6 @@ else # ifeq ($(4),target)
  define $(2)_BUILD_CMDS
      cd $$($$(PKG)_SRCDIR) && \
      $$(HOST_MAKE_ENV) \
-             RUSTFLAGS="$$(addprefix -C link-args=,$$(HOST_LDFLAGS))" \

Why can this be removed? You added CARGO_HOST_RUSTFLAGS to the target build,
but we still want HOST_LDFLAGS in the host package build, no?

I think this works ok since it's not a cross build like the target build. Target builds
generate both native/and target artifacts unlike host builds.

Quoted 7 lines

Regards,
Arnout

Quoted 3 lines
package/pkg-cargo.mk +0 -0
              $$(HOST_CONFIGURE_OPTS) \
              $$(HOST_PKG_CARGO_ENV) \
              $$($(2)_CARGO_ENV) \

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
Quoted 59 lines · James Hilliard
Quoted 45 lines · Arnout Vandecappelle
Quoted 41 lines · James Hilliard

Set HOST_LDFLAGS RUSTFLAGS via the host-config feature, see:
https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#host-config

We have to enable this nightly feature first using:
CARGO_UNSTABLE_HOST_CONFIG="true"

Separately set target RUSTFLAGS for the target triple specific env variable.

---
   package/pkg-cargo.mk | 11 ++++++++---
   1 file changed, 8 insertions(+), 3 deletions(-)
package/pkg-cargo.mk +6 -1
index f7e3f39503..439d443b0d 100644
@@ -32,7 +32,10 @@ PKG_COMMON_CARGO_ENV = \
   # using nighly features on stable releases, i.e features that are not
   # yet considered stable.
   #
-# CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" "enables the nightly
+# CARGO_UNSTABLE_HOST_CONFIG="true" enables the host specific
+# configuration feature
+#
+# CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" enables the nightly
   # configuration option target-applies-to-host value to be set
   #
   # CARGO_TARGET_APPLIES_TO_HOST="false" is actually setting the value
@@ -41,9 +44,11 @@ PKG_COMMON_CARGO_ENV = \
   PKG_CARGO_ENV = \
       $(PKG_COMMON_CARGO_ENV) \
       __CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS="nightly" \
+     CARGO_UNSTABLE_HOST_CONFIG="true" \
       CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" \
       CARGO_TARGET_APPLIES_TO_HOST="false" \
       CARGO_BUILD_TARGET="$(RUSTC_TARGET_NAME)" \
+     CARGO_HOST_RUSTFLAGS="$(addprefix -C link-args=,$(HOST_LDFLAGS))" \
       CARGO_TARGET_$(call UPPERCASE,$(RUSTC_TARGET_NAME))_LINKER=$(notdir $(TARGET_CROSS))gcc
 
Quoted 12 lines

package/pkg-cargo.mk PKG_CARGO_ENV = \ · line 60

Quoted 8 lines
package/pkg-cargo.mk +2 -1
   #
@@ -51,7 +56,8 @@ PKG_CARGO_ENV = \
   # and should be removed when fixed upstream
   #
   ifeq ($(NORMALIZED_ARCH),arm)
-     PKG_CARGO_ENV += RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"
+     PKG_CARGO_ENV += \
+             CARGO_TARGET_$(call UPPERCASE,$(RUSTC_TARGET_NAME))_RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"

I don't understand why this is needed. We don't set RUSTFLAGS anywhere else,
so it should be fine? Or is it because RUSTFLAGS is also used for native build even if CARGO_HOST_RUSTFLAGS is set?

Quoted 8 lines

So cargo target builds tend to actually build artifacts for both the host and the
target architecture, since cargo build-scripts are themselves written in rust, thus
passing plain RUSTFLAGS has inconsistent behavior it seems in regards to which artifact builds the RUSTFLAGS get applied to(seems to have changed across cargo versions as well). Splitting them explicitly should be more correct.

Ah, yes, that makes sense. However, this splitting wouldn't work at all if
host target name == target target name (e.g. x86_64-unknown-linux-gnu) - in particular, we DO NOT want to pass HOST_LDFLAGS for linking stuff for the target. HOST_LDFLAGS contains the rpath pointing into HOST_DIR/lib.

Quoted 16 lines
Quoted 6 lines

(Anyway, this hunk can probably be removed, the bug that triggered it is fixed.)

Quoted 2 lines
package/pkg-cargo.mk +0 -0
   endif
 
Quoted 9 lines

package/pkg-cargo.mk else # ifeq ($(4),target) · line 131

Quoted 6 lines
package/pkg-cargo.mk +0 -1
   HOST_PKG_CARGO_ENV = \
@@ -128,7 +134,6 @@ else # ifeq ($(4),target)
   define $(2)_BUILD_CMDS
       cd $$($$(PKG)_SRCDIR) && \
       $$(HOST_MAKE_ENV) \
-             RUSTFLAGS="$$(addprefix -C link-args=,$$(HOST_LDFLAGS))" \

Why can this be removed? You added CARGO_HOST_RUSTFLAGS to the target build,
but we still want HOST_LDFLAGS in the host package build, no?

Quoted 3 lines

I think this works ok since it's not a cross build like the target build. Target builds
generate both native/and target artifacts unlike host builds.

I don't think it will work (when linking against C code), because I don't see
where else the rpath into HOST_DIR will be passed. At the moment we have only one package in that situation I think: host-sentry-cli.

Regards,
Arnout

Quoted 8 lines
Quoted 8 lines

Regards,
Arnout

Quoted 3 lines
package/pkg-cargo.mk +0 -0
               $$(HOST_CONFIGURE_OPTS) \
               $$(HOST_PKG_CARGO_ENV) \
               $$($(2)_CARGO_ENV) \

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw
Quoted 72 lines · Arnout Vandecappelle
Quoted 59 lines · James Hilliard
Quoted 45 lines · Arnout Vandecappelle
Quoted 41 lines · James Hilliard

Set HOST_LDFLAGS RUSTFLAGS via the host-config feature, see:
https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#host-config

We have to enable this nightly feature first using:
CARGO_UNSTABLE_HOST_CONFIG="true"

Separately set target RUSTFLAGS for the target triple specific env variable.

---
   package/pkg-cargo.mk | 11 ++++++++---
   1 file changed, 8 insertions(+), 3 deletions(-)
package/pkg-cargo.mk +6 -1
index f7e3f39503..439d443b0d 100644
@@ -32,7 +32,10 @@ PKG_COMMON_CARGO_ENV = \
   # using nighly features on stable releases, i.e features that are not
   # yet considered stable.
   #
-# CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" "enables the nightly
+# CARGO_UNSTABLE_HOST_CONFIG="true" enables the host specific
+# configuration feature
+#
+# CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" enables the nightly
   # configuration option target-applies-to-host value to be set
   #
   # CARGO_TARGET_APPLIES_TO_HOST="false" is actually setting the value
@@ -41,9 +44,11 @@ PKG_COMMON_CARGO_ENV = \
   PKG_CARGO_ENV = \
       $(PKG_COMMON_CARGO_ENV) \
       __CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS="nightly" \
+     CARGO_UNSTABLE_HOST_CONFIG="true" \
       CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" \
       CARGO_TARGET_APPLIES_TO_HOST="false" \
       CARGO_BUILD_TARGET="$(RUSTC_TARGET_NAME)" \
+     CARGO_HOST_RUSTFLAGS="$(addprefix -C link-args=,$(HOST_LDFLAGS))" \
       CARGO_TARGET_$(call UPPERCASE,$(RUSTC_TARGET_NAME))_LINKER=$(notdir $(TARGET_CROSS))gcc
 
Quoted 12 lines

package/pkg-cargo.mk PKG_CARGO_ENV = \ · line 60

Quoted 8 lines
package/pkg-cargo.mk +2 -1
   #
@@ -51,7 +56,8 @@ PKG_CARGO_ENV = \
   # and should be removed when fixed upstream
   #
   ifeq ($(NORMALIZED_ARCH),arm)
-     PKG_CARGO_ENV += RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"
+     PKG_CARGO_ENV += \
+             CARGO_TARGET_$(call UPPERCASE,$(RUSTC_TARGET_NAME))_RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"

I don't understand why this is needed. We don't set RUSTFLAGS anywhere else,
so it should be fine? Or is it because RUSTFLAGS is also used for native build even if CARGO_HOST_RUSTFLAGS is set?

Quoted 8 lines

So cargo target builds tend to actually build artifacts for both the host and the
target architecture, since cargo build-scripts are themselves written in rust, thus
passing plain RUSTFLAGS has inconsistent behavior it seems in regards to which artifact builds the RUSTFLAGS get applied to(seems to have changed across cargo versions as well). Splitting them explicitly should be more correct.

Quoted 4 lines

Ah, yes, that makes sense. However, this splitting wouldn't work at all if
host target name == target target name (e.g. x86_64-unknown-linux-gnu) - in particular, we DO NOT want to pass HOST_LDFLAGS for linking stuff for the target. HOST_LDFLAGS contains the rpath pointing into HOST_DIR/lib.

Using CARGO_HOST_RUSTFLAGS should not pass the flags to the target build even when host target name == target target name.

We also are setting CARGO_TARGET_APPLIES_TO_HOST="false" which should split the flags even for cases where host target name == target target name.

Quoted 17 lines
Quoted 17 lines
Quoted 16 lines

(Anyway, this hunk can probably be removed, the bug that triggered it is fixed.)

package/pkg-cargo.mk else # ifeq ($(4),target) · line 131

Quoted 8 lines
package/pkg-cargo.mk +0 -1
   endif
 
   HOST_PKG_CARGO_ENV = \
@@ -128,7 +134,6 @@ else # ifeq ($(4),target)
   define $(2)_BUILD_CMDS
       cd $$($$(PKG)_SRCDIR) && \
       $$(HOST_MAKE_ENV) \
-             RUSTFLAGS="$$(addprefix -C link-args=,$$(HOST_LDFLAGS))" \

Why can this be removed? You added CARGO_HOST_RUSTFLAGS to the target build,
but we still want HOST_LDFLAGS in the host package build, no?

Quoted 7 lines
Quoted 3 lines

I think this works ok since it's not a cross build like the target build. Target builds
generate both native/and target artifacts unlike host builds.

I don't think it will work (when linking against C code), because I don't see
where else the rpath into HOST_DIR will be passed. At the moment we have only one package in that situation I think: host-sentry-cli.

Oh, I was moving this somewhere else but must have accidentally dropped it instead,
will respin.

Quoted 14 lines

Regards,
Arnout

Quoted 8 lines
Quoted 8 lines

Regards,
Arnout

Quoted 3 lines
package/pkg-cargo.mk +0 -0
               $$(HOST_CONFIGURE_OPTS) \
               $$(HOST_PKG_CARGO_ENV) \
               $$($(2)_CARGO_ENV) \

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw
In reply to Arnout Vandecappelle
Quoted 3 lines · Arnout Vandecappelle

On 24/07/2022 04:01, James Hilliard wrote:

[snip]

Quoted 11 lines
Quoted 8 lines
package/pkg-cargo.mk +2 -1
@@ -51,7 +56,8 @@ PKG_CARGO_ENV = \
   # and should be removed when fixed upstream
   #
   ifeq ($(NORMALIZED_ARCH),arm)
-    PKG_CARGO_ENV += RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"
+    PKG_CARGO_ENV += \
+        CARGO_TARGET_$(call 

UPPERCASE,$(RUSTC_TARGET_NAME))_RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"

 I don't understand why this is needed. We don't set RUSTFLAGS anywhere else, so it should be fine? Or is it because RUSTFLAGS is also used for native build even if CARGO_HOST_RUSTFLAGS is set?

Quoted 1 line

 (Anyway, this hunk can probably be removed, the bug that triggered it is fixed.)

 You never replied to this. If indeed this part setting RUSTFLAGS can be removed, then we don't set RUSTFLAGS anywhere, so this patch shouldn't be needed, right?

 Regards,
 Arnout

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw
Quoted 20 lines · Arnout Vandecappelle
Quoted 3 lines · Arnout Vandecappelle

On 24/07/2022 04:01, James Hilliard wrote:

[snip]

Quoted 13 lines
Quoted 8 lines
package/pkg-cargo.mk +2 -1
@@ -51,7 +56,8 @@ PKG_CARGO_ENV = \
  # and should be removed when fixed upstream
  #
  ifeq ($(NORMALIZED_ARCH),arm)
-    PKG_CARGO_ENV += RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"
+    PKG_CARGO_ENV += \
+        CARGO_TARGET_$(call

UPPERCASE,$(RUSTC_TARGET_NAME))_RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"

I don't understand why this is needed. We don't set RUSTFLAGS anywhere else,
so it should be fine? Or is it because RUSTFLAGS is also used for native build even if CARGO_HOST_RUSTFLAGS is set?

Quoted 5 lines
Quoted 1 line

(Anyway, this hunk can probably be removed, the bug that triggered it is fixed.)

You never replied to this. If indeed this part setting RUSTFLAGS can be
removed, then we don't set RUSTFLAGS anywhere, so this patch shouldn't be needed, right?

The issue still appears to be open so I'm assuming it's still needed:
https://github.com/rust-lang/compiler-builtins/issues/420

Quoted 6 lines

Regards,
Arnout

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot