package/rustc: needs C++ compiler with musl based toolchain
While building host-rust with a musl based toolchain without C++ compiler,
the build fail since libunwind bundled in rust sources needs a C++ compiler.
cargo:warning=i686-buildroot-linux-musl-gcc.br_real: error: [...]/host-rust-1.62.0/src/llvm-project/libunwind/src/Unwind-EHABI.cpp: C++ compiler not installed on this system
Note: the issues can't be reproduced with a glibc based toolchain
without C++ probaly due to extra steps required to support musl libc.
We could add the C++ dependency direclty to host-rustc but it would
requires adding the C++ reverse dependencies to all rust packages.
Instread, we add the C++ dependency to BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
only when a musl toolchain is used. So we can still install a prebuilt
rust compiler but without the rust standard library (rust-std).
Usually we should not add toolchain dependencies in a _ARCH_SUPPORTS option but
BR2_PACKAGE_HOST_RUSTC_TARGET_TIER... options contains already some
BR2_TOOLCHAIN_USES_GLIBC or BR2_TOOLCHAIN_USES_MUSL.
Fixes:
http://autobuild.buildroot.org/results/636/636fb39c8f1b8c05e4ca451ac506cd63c7166d82
Signed-off-by: Romain Naour <romain.naour@smile.fr>
Reviewed-by: Nicolas Tran <nicolas.tran@smile.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
(cherry picked from commit 8520058ac0
)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
parent
767f381f09
commit
91786c875d
@ -99,11 +99,15 @@ config BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_PLATFORMS
|
||||
default y if BR2_sparc64 && BR2_TOOLCHAIN_USES_GLIBC
|
||||
|
||||
# All target rust packages should depend on this option
|
||||
# Note: With musl based toolchain, we need a C++ cross compiler to
|
||||
# build host-rust some target libraries (libunwind) from llvm source
|
||||
# code bundled in rust sources.
|
||||
config BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
|
||||
bool
|
||||
default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER1_PLATFORMS
|
||||
default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_HOST_TOOLS_PLATFORMS
|
||||
default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_PLATFORMS
|
||||
depends on BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_USES_MUSL
|
||||
depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
|
||||
|
||||
config BR2_PACKAGE_HOST_RUSTC_ARCH
|
||||
|
Loading…
Reference in New Issue
Block a user