done ; \
find . -mindepth 2 -maxdepth 2 -type f -name install.sh \
-execdir bash '{}' --prefix=$(STAGING_DIR)/host --disable-ldconfig \; ; \
- \
- sed -e 's|@RUSTC_TARGET_ARCH@|$(RUSTC_TARGET_ARCH)|g' \
- -e 's|@TARGET_CC_NOCACHE@|$(TARGET_CC_NOCACHE)|g' \
- $(CURDIR)/files/cargo-config > $(CARGO_HOME)/config.toml ; \
)
endef
+++ /dev/null
-[target.@RUSTC_TARGET_ARCH@]
-linker = "@TARGET_CC_NOCACHE@"
-
-[profile.stripped]
-inherits = "release"
-opt-level = "s"
-strip = true
CARGO_HOME=$(CARGO_HOME) \
CC=$(HOSTCC_NOCACHE) \
cargo install -v \
- --profile stripped \
+ --profile $(CARGO_HOST_PROFILE) \
$(if $(RUST_HOST_FEATURES),--features "$(RUST_HOST_FEATURES)") \
--root $(HOST_INSTALL_DIR) \
--path "$(if $(strip $(1)),$(strip $(1)),.)" $(2) ; \
( \
cd $(PKG_BUILD_DIR) ; \
CARGO_HOME=$(CARGO_HOME) \
+ CARGO_PROFILE_RELEASE_OPT_LEVEL=s \
+ CARGO_TARGET_$(subst -,_,$(call toupper,$(RUSTC_TARGET_ARCH)))_LINKER=$(TARGET_CC_NOCACHE) \
TARGET_CFLAGS="$(TARGET_CFLAGS) $(RUSTC_CFLAGS)" \
TARGET_CC=$(TARGET_CC_NOCACHE) \
CC=$(HOSTCC_NOCACHE) \
RUSTFLAGS="$(CARGO_RUSTFLAGS)" \
$(CARGO_VARS) \
cargo install -v \
- --profile stripped \
+ --profile $(CARGO_PKG_PROFILE) \
--target $(RUSTC_TARGET_ARCH) \
$(if $(strip $(RUST_PKG_FEATURES)),--features "$(strip $(RUST_PKG_FEATURES))") \
--root $(PKG_INSTALL_DIR) \
# Support only a subset for now.
RUST_ARCH_DEPENDS:=@(aarch64||arm||i386||i686||mips||mipsel||mips64||mips64el||mipsel||powerpc64||riscv64||x86_64)
+
+CARGO_HOST_PROFILE:=release
+
+CARGO_PKG_PROFILE:=$(if $(CONFIG_DEBUG),dev,release)