From 54616e7049701996fab1dfb85ba0ebc3189b53ec Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Thu, 26 Oct 2023 16:11:06 +0800 Subject: [PATCH] rust: Fix compile error for mipsel_24kc+24kf Currently, rust fails to build for mipsel_24kc+24kf with "opcode not supported on this processor: mips1 (mips1)" errors when building libunwind. Because mipsel_24kc+24kf is hard-float, a certain section of src/llvm-project/libunwind/src/UnwindRegistersRestore.S is selected to be compiled; the instructions in this section require MIPS II. mipsel_24kc+24kf is compiled for MIPS32 Release 2 (MIPS32 is based on MIPS II), but the C flags used to select this architecture were not passed to the rust bootstrap (to be passed back to gcc). This passes the C flags to rust bootstrap to fix this compile error. This also adds PKG_BUILD_FLAGS:=no-mips16 as attempting to generate MIPS16 code leads to a different compile error. Signed-off-by: Jeffery To --- lang/rust/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lang/rust/Makefile b/lang/rust/Makefile index f3189b5bf7..78d95d3d9c 100644 --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rust PKG_VERSION:=1.73.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=rustc-$(PKG_VERSION)-src.tar.gz PKG_SOURCE_URL:=https://static.rust-lang.org/dist/ @@ -18,6 +18,7 @@ PKG_LICENSE:=Apache-2.0 MIT PKG_LICENSE_FILES:=LICENSE-APACHE LICENSE-MIT PKG_HOST_ONLY:=1 +PKG_BUILD_FLAGS:=no-mips16 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk @@ -86,6 +87,7 @@ endef define Host/Compile $(RUST_SCCACHE_VARS) \ CARGO_HOME=$(CARGO_HOME) \ + TARGET_CFLAGS="$(TARGET_CFLAGS)" \ OPENWRT_RUSTC_BOOTSTRAP_CACHE=$(DL_DIR)/rustc \ $(PYTHON) $(HOST_BUILD_DIR)/x.py \ --build-dir $(HOST_BUILD_DIR)/build \ -- 2.30.2