package/pkg-cargo.mk: fix building cargo packages on 32bit arm

There are duplicated symbols between rustc and gcc. Specifying
--allow-multiple-definition to the linker as workaround until
rustc is fixed.

rust-lang issue: https://github.com/rust-lang/compiler-builtins/issues/420

Fixes: http://autobuild.buildroot.net/results/53f/53f5598b8e520caaa135fb4923c09da382dab329
Signed-off-by: Moritz Bitsch <moritz@h6t.eu>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
Moritz Bitsch 2022-02-18 00:06:38 +01:00 committed by Arnout Vandecappelle (Essensium/Mind)
parent 08f6960f53
commit f439f7c60b

View File

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