Don't set musl-specific options/ldflags when using glibc.
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
--set=target.$(RUSTC_TARGET_ARCH).cc=$(TARGET_CC_NOCACHE) \
--set=target.$(RUSTC_TARGET_ARCH).cxx=$(TARGET_CXX_NOCACHE) \
--set=target.$(RUSTC_TARGET_ARCH).linker=$(TARGET_CC_NOCACHE) \
- --set=target.$(RUSTC_TARGET_ARCH).musl-root=$(TOOLCHAIN_DIR) \
- --set=target.$(RUSTC_TARGET_ARCH).ranlib=$(TARGET_RANLIB)
+ --set=target.$(RUSTC_TARGET_ARCH).ranlib=$(TARGET_RANLIB) \
+ $(if $(CONFIG_USE_MUSL),--set=target.$(RUSTC_TARGET_ARCH).musl-root=$(TOOLCHAIN_DIR))
# CARGO_HOME is an environmental
HOST_CONFIGURE_OPTS += CARGO_HOME="$(CARGO_HOME)"
RUSTC_HOST_ARCH:=$(HOST_ARCH)-unknown-linux-$(CONFIG_HOST_SUFFIX)
CARGO_HOME:=$(STAGING_DIR_HOSTPKG)/cargo
-# Force linking of the SSP library
+ifeq ($(CONFIG_USE_MUSL),y)
+# Force linking of the SSP library for musl
ifdef CONFIG_PKG_CC_STACKPROTECTOR_REGULAR
ifeq ($(strip $(PKG_SSP)),1)
RUSTC_LDFLAGS += -lssp_nonshared
TARGET_CFLAGS += -lssp_nonshared
endif
endif
+endif
# mips64 openwrt has a specific targed in rustc
ifeq ($(ARCH),mips64)