Skip to content

Commit

Permalink
package/pkg-cargo.mk: fix building cargo packages on 32bit arm
Browse files Browse the repository at this point in the history
There are duplicated symbols between rustc and gcc. Specifying
--allow-multiple-definition to the linker as workaround until
rustc is fixed.

rust-lang issue: rust-lang/compiler-builtins#420

Fixes: http://autobuild.buildroot.net/results/53f/53f5598b8e520caaa135fb4923c09da382dab329
Signed-off-by: Moritz Bitsch <[email protected]>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
  • Loading branch information
madmo authored and arnout committed Mar 7, 2022
1 parent 08f6960 commit f439f7c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions package/pkg-cargo.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ PKG_CARGO_ENV = \
CARGO_BUILD_TARGET="$(RUSTC_TARGET_NAME)" \
CARGO_TARGET_$(call UPPERCASE,$(RUSTC_TARGET_NAME))_LINKER=$(notdir $(TARGET_CROSS))gcc

#
# This is a workaround for https://github.com/rust-lang/compiler-builtins/issues/420
# and should be removed when fixed upstream
#
ifeq ($(NORMALIZED_ARCH),arm)
PKG_CARGO_ENV += RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"
endif

HOST_PKG_CARGO_ENV = \
$(PKG_COMMON_CARGO_ENV)

Expand Down

0 comments on commit f439f7c

Please sign in to comment.