From c9354a7d0b70726a594abccc08d2cb69fff3f781 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Mon, 11 Sep 2023 20:58:34 +0000 Subject: [PATCH 01/58] py311, sabnzbd, homeassistant: Enable debug_symbols for qoriq --- spk/homeassistant/Makefile | 4 ++++ spk/python311/Makefile | 2 +- spk/sabnzbd/Makefile | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/spk/homeassistant/Makefile b/spk/homeassistant/Makefile index b69d396c98b..a3506305685 100644 --- a/spk/homeassistant/Makefile +++ b/spk/homeassistant/Makefile @@ -107,6 +107,10 @@ DEPENDS += cross/libxslt include ../../mk/spksrc.python.mk +ifeq ($(findstring $(ARCH),qoriq),$(ARCH)) +GCC_DEBUG_INFO := 1 +endif + # prefer native python tools (pip, maturin, ...) ENV += PATH=$(realpath $(WORK_DIR)/../../../native/$(PYTHON_PACKAGE)/work-native/install/usr/local/bin):$(PATH) diff --git a/spk/python311/Makefile b/spk/python311/Makefile index 3cfa3267e06..242a863f2ec 100644 --- a/spk/python311/Makefile +++ b/spk/python311/Makefile @@ -99,7 +99,7 @@ endif include ../../mk/spksrc.common.mk # Enable debug_info symgols for all archs -#GCC_DEBUG_INFO := 1 +GCC_DEBUG_INFO := 1 # Force compiler LTO optimizations except: # - when testing all wheels diff --git a/spk/sabnzbd/Makefile b/spk/sabnzbd/Makefile index ea63a1ef3ef..f4e9fee8810 100644 --- a/spk/sabnzbd/Makefile +++ b/spk/sabnzbd/Makefile @@ -49,6 +49,10 @@ include ../../mk/spksrc.python.mk # prefer native python tools (pip, maturin, ...) used for orjson ENV += PATH=$(realpath $(WORK_DIR)/../../../native/$(PYTHON_PACKAGE)/work-native/install/usr/local/bin):$(PATH) +ifeq ($(findstring $(ARCH),qoriq),$(ARCH)) +GCC_DEBUG_INFO := 1 +endif + .PHONY: sabnzbd_extra_install sabnzbd_extra_install: install -m 755 -d $(STAGING_DIR)/var/scripts From 3a646e3b3e6328385c37e3d80bc99cef2c83fe0c Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Mon, 11 Sep 2023 21:01:59 +0000 Subject: [PATCH 02/58] py311, sabnzbd, homeassistant: Enable debug_symbols also for x64 --- spk/homeassistant/Makefile | 3 ++- spk/sabnzbd/Makefile | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/spk/homeassistant/Makefile b/spk/homeassistant/Makefile index a3506305685..c0da1eb4032 100644 --- a/spk/homeassistant/Makefile +++ b/spk/homeassistant/Makefile @@ -107,7 +107,8 @@ DEPENDS += cross/libxslt include ../../mk/spksrc.python.mk -ifeq ($(findstring $(ARCH),qoriq),$(ARCH)) +# Enable debug_symgols for qoriq (and x64 to reproduce gdb calls) +ifeq ($(findstring $(ARCH),qoriq $(x64_ARCHS)),$(ARCH)) GCC_DEBUG_INFO := 1 endif diff --git a/spk/sabnzbd/Makefile b/spk/sabnzbd/Makefile index f4e9fee8810..80bd42664e5 100644 --- a/spk/sabnzbd/Makefile +++ b/spk/sabnzbd/Makefile @@ -49,6 +49,7 @@ include ../../mk/spksrc.python.mk # prefer native python tools (pip, maturin, ...) used for orjson ENV += PATH=$(realpath $(WORK_DIR)/../../../native/$(PYTHON_PACKAGE)/work-native/install/usr/local/bin):$(PATH) +# Enable debug_symgols for qoriq (and x64 to reproduce gdb calls) ifeq ($(findstring $(ARCH),qoriq),$(ARCH)) GCC_DEBUG_INFO := 1 endif From b123d4c0408ff47272d8e2bbeaa50d6626e64c7e Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 14 Sep 2023 16:27:42 +0000 Subject: [PATCH 03/58] py311: Force compiler LTO optimizations with exceptions - NOT when testing all wheels - NOT when including debug_info symbols - NOT when using PPC arch (fails on qoriq) --- spk/python311/Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spk/python311/Makefile b/spk/python311/Makefile index 242a863f2ec..18c83a5e65e 100644 --- a/spk/python311/Makefile +++ b/spk/python311/Makefile @@ -113,6 +113,18 @@ endif endif endif +# Force compiler LTO optimizations except: +# - when testing all wheels +# - when including debug_info symbols +# - when using PPC arch (fails on qoriq) +ifneq ($(strip $(WHEELS_TEST_ALL)),1) +ifneq ($(strip $(GCC_DEBUG_INFO)),1) +ifneq ($(findstring $(ARCH),$(OLD_PPC_ARCHS)),$(ARCH)) +ENV += PYTHON_OPTIMIZE=1 +endif +endif +endif + ## WHEELS_TEST_ALL: Force testing all wheel building ifeq ($(strip $(WHEELS_TEST_ALL)),1) From e6fa153f07763cd7142a3a56a1e8adb97c429ff0 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Mon, 18 Sep 2023 20:41:23 +0000 Subject: [PATCH 04/58] py311+sabnzbd+homeassistant: Enable debug_info symbols for all archs --- spk/homeassistant/Makefile | 4 +--- spk/sabnzbd/Makefile | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/spk/homeassistant/Makefile b/spk/homeassistant/Makefile index c0da1eb4032..2586684f00b 100644 --- a/spk/homeassistant/Makefile +++ b/spk/homeassistant/Makefile @@ -107,10 +107,8 @@ DEPENDS += cross/libxslt include ../../mk/spksrc.python.mk -# Enable debug_symgols for qoriq (and x64 to reproduce gdb calls) -ifeq ($(findstring $(ARCH),qoriq $(x64_ARCHS)),$(ARCH)) +# Enable debug_info symgols for all archs GCC_DEBUG_INFO := 1 -endif # prefer native python tools (pip, maturin, ...) ENV += PATH=$(realpath $(WORK_DIR)/../../../native/$(PYTHON_PACKAGE)/work-native/install/usr/local/bin):$(PATH) diff --git a/spk/sabnzbd/Makefile b/spk/sabnzbd/Makefile index 80bd42664e5..5f6f434d151 100644 --- a/spk/sabnzbd/Makefile +++ b/spk/sabnzbd/Makefile @@ -49,10 +49,8 @@ include ../../mk/spksrc.python.mk # prefer native python tools (pip, maturin, ...) used for orjson ENV += PATH=$(realpath $(WORK_DIR)/../../../native/$(PYTHON_PACKAGE)/work-native/install/usr/local/bin):$(PATH) -# Enable debug_symgols for qoriq (and x64 to reproduce gdb calls) -ifeq ($(findstring $(ARCH),qoriq),$(ARCH)) +# Enable debug_info symgols for all archs GCC_DEBUG_INFO := 1 -endif .PHONY: sabnzbd_extra_install sabnzbd_extra_install: From ec075940a3527d6bcd42073ea921be7921ae715c Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 19 Oct 2023 01:34:51 +0000 Subject: [PATCH 05/58] rustc: Add RUSTFLAGS environment variable option --- mk/spksrc.tc.mk | 1 + toolchain/syno-qoriq-6.2.4/Makefile | 1 + 2 files changed, 2 insertions(+) diff --git a/mk/spksrc.tc.mk b/mk/spksrc.tc.mk index 62ae778232c..2b116cd82c5 100644 --- a/mk/spksrc.tc.mk +++ b/mk/spksrc.tc.mk @@ -157,6 +157,7 @@ tc_vars: flag echo TC_ENV += CARGO_BUILD_TARGET=\"$(RUST_TARGET)\" ; \ echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_AR=\"$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)ar\" ; \ echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_LINKER=\"$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)gcc\" ; \ + echo TC_ENV += RUSTFLAGS=\"$(TC_RUSTFLAGS)\" ; \ echo TC_CONFIGURE_ARGS := --host=$(TC_TARGET) --build=i686-pc-linux ; \ echo TC_TYPE := $(TC_TYPE) ; \ echo TC_SYSROOT := $(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT) ; \ diff --git a/toolchain/syno-qoriq-6.2.4/Makefile b/toolchain/syno-qoriq-6.2.4/Makefile index c084c91da51..72cdd2852c2 100644 --- a/toolchain/syno-qoriq-6.2.4/Makefile +++ b/toolchain/syno-qoriq-6.2.4/Makefile @@ -9,5 +9,6 @@ TC_DIST_SITE_PATH = PowerPC%20QorIQ%20Linux%202.6.32 TC_TARGET = powerpc-e500v2-linux-gnuspe TC_SYSROOT = $(TC_TARGET)/sysroot TC_EXTRA_CFLAGS = -mcpu=8548 -mhard-float -mfloat-gprs=double +TC_RUSTFLAGS = -Ctarget-cpu=e500 include ../../mk/spksrc.tc.mk From 8390a8d048db25674b3f5c829ad97a0decd2221b Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sun, 29 Oct 2023 17:21:16 +0000 Subject: [PATCH 06/58] qoriq: Tentatively use additional RUSTFLAGS for arch --- toolchain/syno-qoriq-6.2.4/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/syno-qoriq-6.2.4/Makefile b/toolchain/syno-qoriq-6.2.4/Makefile index 72cdd2852c2..88033c37612 100644 --- a/toolchain/syno-qoriq-6.2.4/Makefile +++ b/toolchain/syno-qoriq-6.2.4/Makefile @@ -9,6 +9,6 @@ TC_DIST_SITE_PATH = PowerPC%20QorIQ%20Linux%202.6.32 TC_TARGET = powerpc-e500v2-linux-gnuspe TC_SYSROOT = $(TC_TARGET)/sysroot TC_EXTRA_CFLAGS = -mcpu=8548 -mhard-float -mfloat-gprs=double -TC_RUSTFLAGS = -Ctarget-cpu=e500 +TC_RUSTFLAGS = -C target-cpu=e500 target-feature=-hard-float,-spe include ../../mk/spksrc.tc.mk From 7c83b47500f3d2896d38a4154da33f9c28d1ecf9 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Tue, 28 Nov 2023 01:13:39 +0000 Subject: [PATCH 07/58] toolchain qoriq-6.2.4: Revert RUSTFLAGS and create standard links - Removing from RUSTFLAGS target-feature=-hard-float,-spe as unsupported - Create symbolic links using standard "target triple" naming in order to avoid confusion due to the usage from Synology of e500v2 specific --- toolchain/syno-qoriq-6.2.4/Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/toolchain/syno-qoriq-6.2.4/Makefile b/toolchain/syno-qoriq-6.2.4/Makefile index 88033c37612..7e613d69637 100644 --- a/toolchain/syno-qoriq-6.2.4/Makefile +++ b/toolchain/syno-qoriq-6.2.4/Makefile @@ -9,6 +9,16 @@ TC_DIST_SITE_PATH = PowerPC%20QorIQ%20Linux%202.6.32 TC_TARGET = powerpc-e500v2-linux-gnuspe TC_SYSROOT = $(TC_TARGET)/sysroot TC_EXTRA_CFLAGS = -mcpu=8548 -mhard-float -mfloat-gprs=double -TC_RUSTFLAGS = -C target-cpu=e500 target-feature=-hard-float,-spe +TC_RUSTFLAGS = -Ctarget-cpu=e500 + +POST_FIX_TARGET = qoriq_post_fix_target include ../../mk/spksrc.tc.mk + +.PHONY: qoriq_post_fix_target +qoriq_post_fix_target: + @cd $(WORK_DIR)/$(TC_TARGET)/bin ; \ + for gnutool in $$(ls -1); do \ + [ ! -h "powerpc-linux-gnuspe-$${gnutool##*-}" ] && ln -s $${gnutool} "powerpc-linux-gnuspe-$${gnutool##*-}" ; \ + [ ! -h "powerpc-unknown-linux-gnuspe-$${gnutool##*-}" ] && ln -s $${gnutool} "powerpc-unknown-linux-gnuspe-$${gnutool##*-}" ; \ + done From 64b715a973c1642b2f2ceafe43e1548d23b1abf6 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Tue, 28 Nov 2023 03:09:45 +0000 Subject: [PATCH 08/58] rust: Add support for powerpc-unknown-linux-gnuspe tier 3 target --- mk/spksrc.cross-rust-env.mk | 10 ++++++- mk/spksrc.cross-rust.mk | 6 ++-- mk/spksrc.tc-rust.mk | 57 +++++++++++++++++++++++++++++++++++-- 3 files changed, 66 insertions(+), 7 deletions(-) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index a3a7d14c432..8ad22e74901 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -12,6 +12,14 @@ ifeq ($(RUST_TOOLCHAIN),) RUST_TOOLCHAIN = stable endif +ifeq ($(RUST_TARGET_TOOLCHAIN),) +ifneq ($(shell rustup target list 2>&1 | grep $(RUST_TARGET) 2>/dev/null),) +RUST_TARGET_TOOLCHAIN = $(RUST_TOOLCHAIN) +else +RUST_TARGET_TOOLCHAIN = $(TC_ARCH) +endif +endif + RUST_TARGET = # map archs to rust targets ifeq ($(findstring $(ARCH), $(x64_ARCHS)),$(ARCH)) @@ -34,7 +42,7 @@ ifeq ($(findstring $(ARCH), $(ARMv8_ARCHS)),$(ARCH)) RUST_TARGET = aarch64-unknown-linux-gnu endif ifeq ($(findstring $(ARCH), $(PPC_ARCHS)),$(ARCH)) -RUST_TARGET = powerpc-unknown-linux-gnu +RUST_TARGET = powerpc-unknown-linux-gnuspe endif ifeq ($(RUST_TARGET),) $(error Arch $(ARCH) not supported) diff --git a/mk/spksrc.cross-rust.mk b/mk/spksrc.cross-rust.mk index af03e152713..f8cd6878fe2 100644 --- a/mk/spksrc.cross-rust.mk +++ b/mk/spksrc.cross-rust.mk @@ -60,9 +60,9 @@ endif # Default build with rust and install with cargo rust_install_target: - @echo " ==> Cargo install rust package $(PKG_NAME) ($(shell rustc --version); $(RUST_TOOLCHAIN))" - @$(RUN) cargo +$(RUST_TOOLCHAIN) install $(CARGO_INSTALL_ARGS) - + @echo " ==> Cargo install rust package $(PKG_NAME) (rustc +$(TC_RUSTUP_TOOLCHAIN) -vV)" + @$(RUN) rustc +$(TC_RUSTUP_TOOLCHAIN) -vV + @$(RUN) cargo install $(CARGO_INSTALL_ARGS) ##### diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 5831ae25f81..4d399e726d7 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -6,6 +6,10 @@ # rustc_target (override with RUSTC_TARGET) # post_rustc_target (override with POST_RUSTC_TARGET) +# Define rustc configuration toml file location +# when rebuilding for unsupported archs (i.e. Tier 3) +TC_LOCAL_VARS_RUST = $(WORK_DIR)/$(TC_ARCH).toml + # Configure file descriptor lock timeout ifeq ($(strip $(FLOCK_TIMEOUT)),) FLOCK_TIMEOUT = 300 @@ -32,6 +36,34 @@ endif .PHONY: rustc rustc_msg .PHONY: $(PRE_RUSTC_TARGET) $(RUSTC_TARGET) $(POST_RUSTC_TARGET) +.PHONY: $(TC_LOCAL_VARS_RUST) +$(TC_LOCAL_VARS_RUST): + env $(MAKE) --no-print-directory rust_toml > $@ 2>/dev/null; + +.PHONY: rust_toml +rust_toml: + @echo 'profile = "compiler"' ; \ + echo + @echo "[build]" ; \ + echo 'target = ["$(RUST_TARGET)"]' ; \ + echo "build-stage = 2" ; \ + echo "docs = false" ; \ + echo "docs-minification = false" ; \ + echo "compiler-docs = false" ; \ + echo + @echo "[target.$(RUST_TARGET)]" ; \ + echo 'cc = "$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)gcc"' ; \ + echo 'cxx = "$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)g++"' ; \ + echo 'ar = "$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)ar"' ; \ + echo 'ranlib = "$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)ranlib"' ; \ + echo 'linker = "$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)gcc"' ; \ + echo + @echo "#[target.'cfg(target_arch = \"$(firstword $(subst -, ,$(RUST_TARGET)))\")']" ; \ + echo '#rustflags = ["-C", "link-arg=--sysroot=$(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT)"]' ; \ + echo '#cflags = "$(TC_EXTRA_CFLAGS)"' ; \ + echo '#cxxflags = "$(TC_EXTRA_CFLAGS)"' ; \ + echo '#openssl-dir = "$(abspath $(WORK_DIR)/../../../toolkit/syno-$(ARCH)-$(TCVERSION)/work/usr/)"' + rustc_msg: @$(MSG) "Installing rustc toolchain for $(NAME)" @$(MSG) "- rustup installation PATH: $(RUSTUP_HOME)" @@ -47,7 +79,7 @@ pre_rustc_target: rustc_msg curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path ; \ flock -u 5 -rustc_target: $(PRE_RUSTC_TARGET) +rustc_target: $(PRE_RUSTC_TARGET) $(TC_LOCAL_VARS_RUST) @$(MSG) "rustup toolchain install $(RUST_TOOLCHAIN)" ; \ exec 5> /tmp/tc-rustc.lock ; \ flock --timeout $(FLOCK_TIMEOUT) --exclusive 5 || exit 1 ; \ @@ -56,9 +88,28 @@ rustc_target: $(PRE_RUSTC_TARGET) rustup toolchain install $(RUST_TOOLCHAIN) ; \ $(MSG) "rustup default $(RUST_TOOLCHAIN)" ; \ rustup default $(RUST_TOOLCHAIN) ; \ - $(MSG) "rustup target add $(RUST_TARGET)" ; \ - rustup target add $(RUST_TARGET) ; \ flock -u 5 + rustup show +ifneq ($(shell rustup target list 2>&1 | grep $(RUST_TARGET)),) + @$(MSG) "rustup target add $(RUST_TARGET)" + rustup override set stable + rustup target add $(RUST_TARGET) +else + @$(MSG) "Target $(RUST_TARGET) unavailable..." + @$(MSG) "Setting-up toolkit" + @$(MAKE) -C ../../toolkit/syno-$(ARCH)-$(TCVERSION) + @$(MSG) "Building Tier 3 rust target: $(RUST_TARGET)" + @(cd $(WORK_DIR) && [ ! -d rust ] && git clone --depth 1 https://github.com/rust-lang/rust.git || true) + @(cd $(WORK_DIR)/rust && ./x setup compiler) + @(cd $(WORK_DIR)/rust && \ + CFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ + CXXFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ + RUST_BACKTRACE=full \ + ./x build --config $(TC_LOCAL_VARS_RUST)) + @rustup toolchain link $(TC_ARCH) $(WORK_DIR)/rust/build/host/stage2 + @$(MSG) "Building Tier 3 rust target: $(RUST_TARGET) - stage2 complete" +endif + rustup show post_rustc_target: $(RUSTC_TARGET) From cf9cec291984994fd8b86977927041f819167c85 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Tue, 28 Nov 2023 22:23:48 +0000 Subject: [PATCH 09/58] rust: Use RUSTUP_TOOLCHAIN env variable to define used toolchain --- mk/spksrc.cross-rust-env.mk | 13 +++++-------- mk/spksrc.tc-rust.mk | 10 +++++----- mk/spksrc.tc.mk | 1 + 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index 8ad22e74901..2b779bbf9c9 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -8,16 +8,12 @@ export RUSTUP_HOME=$(BASE_DISTRIB_DIR)/rustup export PATH:=$(BASE_DISTRIB_DIR)/cargo/bin:$(PATH) endif -ifeq ($(RUST_TOOLCHAIN),) -RUST_TOOLCHAIN = stable +ifeq ($(RUSTUP_DEFAULT_TOOLCHAIN),) +RUSTUP_DEFAULT_TOOLCHAIN = stable endif -ifeq ($(RUST_TARGET_TOOLCHAIN),) -ifneq ($(shell rustup target list 2>&1 | grep $(RUST_TARGET) 2>/dev/null),) -RUST_TARGET_TOOLCHAIN = $(RUST_TOOLCHAIN) -else -RUST_TARGET_TOOLCHAIN = $(TC_ARCH) -endif +ifeq ($(TC_RUSTUP_TOOLCHAIN),) +TC_RUSTUP_TOOLCHAIN = $(RUSTUP_DEFAULT_TOOLCHAIN) endif RUST_TARGET = @@ -43,6 +39,7 @@ RUST_TARGET = aarch64-unknown-linux-gnu endif ifeq ($(findstring $(ARCH), $(PPC_ARCHS)),$(ARCH)) RUST_TARGET = powerpc-unknown-linux-gnuspe +TC_RUSTUP_TOOLCHAIN = $(TC_ARCH) endif ifeq ($(RUST_TARGET),) $(error Arch $(ARCH) not supported) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 4d399e726d7..e421ea03aef 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -80,17 +80,17 @@ pre_rustc_target: rustc_msg flock -u 5 rustc_target: $(PRE_RUSTC_TARGET) $(TC_LOCAL_VARS_RUST) - @$(MSG) "rustup toolchain install $(RUST_TOOLCHAIN)" ; \ + @$(MSG) "rustup toolchain install $(RUSTUP_DEFAULT_TOOLCHAIN)" ; \ exec 5> /tmp/tc-rustc.lock ; \ flock --timeout $(FLOCK_TIMEOUT) --exclusive 5 || exit 1 ; \ pid=$$$$ ; \ echo "$${pid}" 1>&5 ; \ - rustup toolchain install $(RUST_TOOLCHAIN) ; \ - $(MSG) "rustup default $(RUST_TOOLCHAIN)" ; \ - rustup default $(RUST_TOOLCHAIN) ; \ + rustup toolchain install $(RUSTUP_DEFAULT_TOOLCHAIN) ; \ + $(MSG) "rustup default $(RUSTUP_DEFAULT_TOOLCHAIN)" ; \ + rustup default $(RUSTUP_DEFAULT_TOOLCHAIN) ; \ flock -u 5 rustup show -ifneq ($(shell rustup target list 2>&1 | grep $(RUST_TARGET)),) +ifneq ($(TC_RUSTUP_TOOLCHAIN),stable) @$(MSG) "rustup target add $(RUST_TARGET)" rustup override set stable rustup target add $(RUST_TARGET) diff --git a/mk/spksrc.tc.mk b/mk/spksrc.tc.mk index 2b116cd82c5..0ff9ef28800 100644 --- a/mk/spksrc.tc.mk +++ b/mk/spksrc.tc.mk @@ -157,6 +157,7 @@ tc_vars: flag echo TC_ENV += CARGO_BUILD_TARGET=\"$(RUST_TARGET)\" ; \ echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_AR=\"$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)ar\" ; \ echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_LINKER=\"$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)gcc\" ; \ + echo TC_ENV += RUSTUP_TOOLCHAIN=\"$(TC_RUSTUP_TOOLCHAIN)\" ; \ echo TC_ENV += RUSTFLAGS=\"$(TC_RUSTFLAGS)\" ; \ echo TC_CONFIGURE_ARGS := --host=$(TC_TARGET) --build=i686-pc-linux ; \ echo TC_TYPE := $(TC_TYPE) ; \ From 744f34aa6d1918b54ecdb9d1ed1fcd434dade8f9 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Tue, 28 Nov 2023 22:43:17 +0000 Subject: [PATCH 10/58] rust: Fix default toolchain checking --- mk/spksrc.tc-rust.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index e421ea03aef..64972820b95 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -90,7 +90,7 @@ rustc_target: $(PRE_RUSTC_TARGET) $(TC_LOCAL_VARS_RUST) rustup default $(RUSTUP_DEFAULT_TOOLCHAIN) ; \ flock -u 5 rustup show -ifneq ($(TC_RUSTUP_TOOLCHAIN),stable) +ifeq ($(TC_RUSTUP_TOOLCHAIN),$(RUSTUP_DEFAULT_TOOLCHAIN)) @$(MSG) "rustup target add $(RUST_TARGET)" rustup override set stable rustup target add $(RUST_TARGET) From df6db3b5eccd01a9d40088590e4784e39e866a1f Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 29 Nov 2023 01:46:32 +0000 Subject: [PATCH 11/58] duplicity: Update bcrypt wheel from version 4.0.1 to 4.1.1 --- spk/duplicity/src/requirements-crossenv.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spk/duplicity/src/requirements-crossenv.txt b/spk/duplicity/src/requirements-crossenv.txt index 80f980cc578..75d554f7be1 100644 --- a/spk/duplicity/src/requirements-crossenv.txt +++ b/spk/duplicity/src/requirements-crossenv.txt @@ -7,7 +7,7 @@ duplicity==1.2.3 # Using launchpad source as alternate #https://launchpad.net/duplicity/0.8-series/0.8.23/+download/duplicity-0.8.23.tar.gz#egg=duplicity==0.8.23 -bcrypt==4.0.1 +bcrypt==4.1.1 cffi==1.15.1 coverage==7.2.7 #cryptography ==> cross/cryptography From 5276d97be01b8485d7f9befcb48c12a788501a42 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 29 Nov 2023 01:48:12 +0000 Subject: [PATCH 12/58] py310-py311: Update bcrypt wheel from version 4.0.1 to 4.1.1 --- spk/python310/src/requirements-crossenv.txt | 2 +- spk/python311/src/requirements-crossenv.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spk/python310/src/requirements-crossenv.txt b/spk/python310/src/requirements-crossenv.txt index 01edc7b6fa0..e4745c4b630 100644 --- a/spk/python310/src/requirements-crossenv.txt +++ b/spk/python310/src/requirements-crossenv.txt @@ -8,7 +8,7 @@ # Require environment variables # PYO3_CROSS_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ # PYO3_CROSS_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ -bcrypt==4.0.1 +bcrypt==4.1.1 # [cryptography] # Mandatory of using OPENSSL_*_DIR starting with version >= 40 diff --git a/spk/python311/src/requirements-crossenv.txt b/spk/python311/src/requirements-crossenv.txt index c73dcba588e..71d675dccfc 100644 --- a/spk/python311/src/requirements-crossenv.txt +++ b/spk/python311/src/requirements-crossenv.txt @@ -8,7 +8,7 @@ # Require environment variables # PYO3_CROSS_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ # PYO3_CROSS_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ -bcrypt==4.0.1 +bcrypt==4.1.1 # [cryptography] # Mandatory of using OPENSSL_*_DIR starting with version >= 40 From b372bb4965f86d551e585f5f7ae876c947b79a9e Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 29 Nov 2023 01:57:38 +0000 Subject: [PATCH 13/58] homeassistant: Update bcrypt 4.1.1 and cryptography 41.0.3 --- spk/homeassistant/src/requirements-crossenv.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spk/homeassistant/src/requirements-crossenv.txt b/spk/homeassistant/src/requirements-crossenv.txt index 2e96306eb89..2bbe851ff95 100644 --- a/spk/homeassistant/src/requirements-crossenv.txt +++ b/spk/homeassistant/src/requirements-crossenv.txt @@ -1,5 +1,5 @@ aiohttp==3.8.5 -bcrypt==4.0.1 +bcrypt==4.1.1 bitstruct==8.17.0 bluetooth_data_tools==1.3.0 Brotli==1.0.9 @@ -9,7 +9,7 @@ chacha20poly1305_reuseable==0.4.1 ciso8601==2.3.0 coverage==7.2.7 crcmod==1.7 -cryptography==41.0.1 +cryptography==41.0.3 dbus_fast==1.86.0 ephem==4.1.2 faust_cchardet==2.1.18 From c7eab3207469f0f492331ea655a04ae193831054 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 29 Nov 2023 01:59:22 +0000 Subject: [PATCH 14/58] rust: Enforce using newer native/cmake when building toolchain --- mk/spksrc.cross-rust-env.mk | 3 +++ mk/spksrc.tc-rust.mk | 2 ++ 2 files changed, 5 insertions(+) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index 2b779bbf9c9..2e3b393f527 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -14,6 +14,9 @@ endif ifeq ($(TC_RUSTUP_TOOLCHAIN),) TC_RUSTUP_TOOLCHAIN = $(RUSTUP_DEFAULT_TOOLCHAIN) +else +USE_NATIVE_CMAKE = 1 +include ../../mk/spksrc.native-cmake-env.mk endif RUST_TARGET = diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 64972820b95..58d418fbdac 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -98,6 +98,8 @@ else @$(MSG) "Target $(RUST_TARGET) unavailable..." @$(MSG) "Setting-up toolkit" @$(MAKE) -C ../../toolkit/syno-$(ARCH)-$(TCVERSION) + @$(MSG) "Enforce usage of CMake 3.20.0 or higher" + @$(MAKE) -C ../../natime/cmake @$(MSG) "Building Tier 3 rust target: $(RUST_TARGET)" @(cd $(WORK_DIR) && [ ! -d rust ] && git clone --depth 1 https://github.com/rust-lang/rust.git || true) @(cd $(WORK_DIR)/rust && ./x setup compiler) From 321c3ee5373d0c69bdb6c3edbd0a2a4b4747b6f1 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 29 Nov 2023 02:02:56 +0000 Subject: [PATCH 15/58] rust: Fix typo when building native/cmake --- mk/spksrc.tc-rust.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 58d418fbdac..7a2e49bd395 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -99,7 +99,7 @@ else @$(MSG) "Setting-up toolkit" @$(MAKE) -C ../../toolkit/syno-$(ARCH)-$(TCVERSION) @$(MSG) "Enforce usage of CMake 3.20.0 or higher" - @$(MAKE) -C ../../natime/cmake + @$(MAKE) -C ../../native/cmake @$(MSG) "Building Tier 3 rust target: $(RUST_TARGET)" @(cd $(WORK_DIR) && [ ! -d rust ] && git clone --depth 1 https://github.com/rust-lang/rust.git || true) @(cd $(WORK_DIR)/rust && ./x setup compiler) From 1abf6073194f218621381a5b4cada31de7a82911 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 29 Nov 2023 03:02:39 +0000 Subject: [PATCH 16/58] rust: Tentative to fix online issue relatively to cmake --- mk/spksrc.cross-rust-env.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index 2e3b393f527..23d9696ad62 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -1,5 +1,8 @@ # Configuration for rust compiler -# +# + +# For newer cmake when building tier-3 toolchains +include ../../mk/spksrc.native-cmake-env.mk # Add cargo for rust compiler to default PATH ifneq ($(BASE_DISTRIB_DIR),) @@ -16,7 +19,6 @@ ifeq ($(TC_RUSTUP_TOOLCHAIN),) TC_RUSTUP_TOOLCHAIN = $(RUSTUP_DEFAULT_TOOLCHAIN) else USE_NATIVE_CMAKE = 1 -include ../../mk/spksrc.native-cmake-env.mk endif RUST_TARGET = From a6f6c522e2b899eeeba74a9b5972f69e184ed907 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 29 Nov 2023 03:35:38 +0000 Subject: [PATCH 17/58] rust: Different approach to enforce using native/cmake --- mk/spksrc.cross-rust-env.mk | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index 23d9696ad62..b534a88d1ff 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -1,14 +1,13 @@ # Configuration for rust compiler # -# For newer cmake when building tier-3 toolchains -include ../../mk/spksrc.native-cmake-env.mk - # Add cargo for rust compiler to default PATH ifneq ($(BASE_DISTRIB_DIR),) +# Enforce newer cmake when building tier-3 toolchains +CMAKE_PATH = $(abspath $(WORK_DIR)/../../../native/cmake/work-native/install/usr/local/bin) export CARGO_HOME=$(BASE_DISTRIB_DIR)/cargo export RUSTUP_HOME=$(BASE_DISTRIB_DIR)/rustup -export PATH:=$(BASE_DISTRIB_DIR)/cargo/bin:$(PATH) +export PATH:=$(abspath $(BASE_DISTRIB_DIR)/cargo/bin):$(CMAKE_PATH):$(PATH) endif ifeq ($(RUSTUP_DEFAULT_TOOLCHAIN),) @@ -17,8 +16,6 @@ endif ifeq ($(TC_RUSTUP_TOOLCHAIN),) TC_RUSTUP_TOOLCHAIN = $(RUSTUP_DEFAULT_TOOLCHAIN) -else -USE_NATIVE_CMAKE = 1 endif RUST_TARGET = From 2bcea4fe987fbcd2a86ffaa33119f5d12a024c8a Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 29 Nov 2023 11:31:50 +0000 Subject: [PATCH 18/58] rust: Enforcing --sysroot at link time for tier-3 toolchain builds --- mk/spksrc.tc-rust.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 7a2e49bd395..6940ae23f64 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -106,6 +106,7 @@ else @(cd $(WORK_DIR)/rust && \ CFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ CXXFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ + LDFLAGS_$(subst -,_,$(RUST_TARGET))="--sysroot=$(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT)" \ RUST_BACKTRACE=full \ ./x build --config $(TC_LOCAL_VARS_RUST)) @rustup toolchain link $(TC_ARCH) $(WORK_DIR)/rust/build/host/stage2 From dc424a290f0c92778600c59dd21406da0428e016 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 29 Nov 2023 22:51:02 +0000 Subject: [PATCH 19/58] rust: Enforce sysroot using extra RUSTFLAGS variable --- mk/spksrc.tc.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/mk/spksrc.tc.mk b/mk/spksrc.tc.mk index 0ff9ef28800..d4d92976cba 100644 --- a/mk/spksrc.tc.mk +++ b/mk/spksrc.tc.mk @@ -157,6 +157,7 @@ tc_vars: flag echo TC_ENV += CARGO_BUILD_TARGET=\"$(RUST_TARGET)\" ; \ echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_AR=\"$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)ar\" ; \ echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_LINKER=\"$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)gcc\" ; \ + echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_RUSTFLAGS=\"-C link-arg=--sysroot=$(abspath $(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT))\" ; \ echo TC_ENV += RUSTUP_TOOLCHAIN=\"$(TC_RUSTUP_TOOLCHAIN)\" ; \ echo TC_ENV += RUSTFLAGS=\"$(TC_RUSTFLAGS)\" ; \ echo TC_CONFIGURE_ARGS := --host=$(TC_TARGET) --build=i686-pc-linux ; \ From 0a8fb06992aa056c156abea637182b6cd517d4d0 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 30 Nov 2023 01:17:35 +0000 Subject: [PATCH 20/58] rust: Downgrade to stage1 level compiler and disable toolkit --- mk/spksrc.cross-rust-env.mk | 4 ++++ mk/spksrc.tc-rust.mk | 13 +++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index b534a88d1ff..8cb83d68fd9 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -14,6 +14,10 @@ ifeq ($(RUSTUP_DEFAULT_TOOLCHAIN),) RUSTUP_DEFAULT_TOOLCHAIN = stable endif +# When building toolchain Tier-3 arch support +# https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#stage-2-the-truly-current-compiler +RUSTUP_DEFAULT_TOOLCHAIN_STAGE = 1 + ifeq ($(TC_RUSTUP_TOOLCHAIN),) TC_RUSTUP_TOOLCHAIN = $(RUSTUP_DEFAULT_TOOLCHAIN) endif diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 6940ae23f64..ed810232638 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -46,7 +46,7 @@ rust_toml: echo @echo "[build]" ; \ echo 'target = ["$(RUST_TARGET)"]' ; \ - echo "build-stage = 2" ; \ + echo "build-stage = $(RUSTUP_DEFAULT_TOOLCHAIN_STAGE)" ; \ echo "docs = false" ; \ echo "docs-minification = false" ; \ echo "compiler-docs = false" ; \ @@ -58,11 +58,6 @@ rust_toml: echo 'ranlib = "$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)ranlib"' ; \ echo 'linker = "$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)gcc"' ; \ echo - @echo "#[target.'cfg(target_arch = \"$(firstword $(subst -, ,$(RUST_TARGET)))\")']" ; \ - echo '#rustflags = ["-C", "link-arg=--sysroot=$(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT)"]' ; \ - echo '#cflags = "$(TC_EXTRA_CFLAGS)"' ; \ - echo '#cxxflags = "$(TC_EXTRA_CFLAGS)"' ; \ - echo '#openssl-dir = "$(abspath $(WORK_DIR)/../../../toolkit/syno-$(ARCH)-$(TCVERSION)/work/usr/)"' rustc_msg: @$(MSG) "Installing rustc toolchain for $(NAME)" @@ -96,8 +91,6 @@ ifeq ($(TC_RUSTUP_TOOLCHAIN),$(RUSTUP_DEFAULT_TOOLCHAIN)) rustup target add $(RUST_TARGET) else @$(MSG) "Target $(RUST_TARGET) unavailable..." - @$(MSG) "Setting-up toolkit" - @$(MAKE) -C ../../toolkit/syno-$(ARCH)-$(TCVERSION) @$(MSG) "Enforce usage of CMake 3.20.0 or higher" @$(MAKE) -C ../../native/cmake @$(MSG) "Building Tier 3 rust target: $(RUST_TARGET)" @@ -109,8 +102,8 @@ else LDFLAGS_$(subst -,_,$(RUST_TARGET))="--sysroot=$(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT)" \ RUST_BACKTRACE=full \ ./x build --config $(TC_LOCAL_VARS_RUST)) - @rustup toolchain link $(TC_ARCH) $(WORK_DIR)/rust/build/host/stage2 - @$(MSG) "Building Tier 3 rust target: $(RUST_TARGET) - stage2 complete" + @rustup toolchain link $(TC_ARCH) $(WORK_DIR)/rust/build/host/stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) + @$(MSG) "Building Tier 3 rust target: $(RUST_TARGET) - stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) complete" endif rustup show From 28273c75cca9feef049f49d8349276251cc4ffde Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 30 Nov 2023 01:38:30 +0000 Subject: [PATCH 21/58] rust: Rename custom toolchain to match RUSTUP_TOOLCHAIN for clarity --- mk/spksrc.cross-rust-env.mk | 2 +- mk/spksrc.tc-rust.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index 8cb83d68fd9..4731905c0a6 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -45,7 +45,7 @@ RUST_TARGET = aarch64-unknown-linux-gnu endif ifeq ($(findstring $(ARCH), $(PPC_ARCHS)),$(ARCH)) RUST_TARGET = powerpc-unknown-linux-gnuspe -TC_RUSTUP_TOOLCHAIN = $(TC_ARCH) +TC_RUSTUP_TOOLCHAIN = $(RUST_TARGET) endif ifeq ($(RUST_TARGET),) $(error Arch $(ARCH) not supported) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index ed810232638..0ba6a65589d 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -102,7 +102,7 @@ else LDFLAGS_$(subst -,_,$(RUST_TARGET))="--sysroot=$(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT)" \ RUST_BACKTRACE=full \ ./x build --config $(TC_LOCAL_VARS_RUST)) - @rustup toolchain link $(TC_ARCH) $(WORK_DIR)/rust/build/host/stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) + @rustup toolchain link $(TC_RUSTUP_TOOLCHAIN) $(WORK_DIR)/rust/build/host/stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) @$(MSG) "Building Tier 3 rust target: $(RUST_TARGET) - stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) complete" endif rustup show From 5ed8923ef9c8ed28792170cc9cedbab08a81356f Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 30 Nov 2023 10:12:23 +0000 Subject: [PATCH 22/58] rust: Revert back at using stage2 compiler as it fails online --- mk/spksrc.cross-rust-env.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index 4731905c0a6..2dfb92bd934 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -16,7 +16,7 @@ endif # When building toolchain Tier-3 arch support # https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#stage-2-the-truly-current-compiler -RUSTUP_DEFAULT_TOOLCHAIN_STAGE = 1 +RUSTUP_DEFAULT_TOOLCHAIN_STAGE = 2 ifeq ($(TC_RUSTUP_TOOLCHAIN),) TC_RUSTUP_TOOLCHAIN = $(RUSTUP_DEFAULT_TOOLCHAIN) From b3f5cfd8e6b432e30f1f2e01631cf8c6dc28c80d Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 30 Nov 2023 23:15:59 +0000 Subject: [PATCH 23/58] rust: Clean-up stage0 and stage1 after building stage2 --- mk/spksrc.tc-rust.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 0ba6a65589d..a103ffe96f8 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -93,7 +93,7 @@ else @$(MSG) "Target $(RUST_TARGET) unavailable..." @$(MSG) "Enforce usage of CMake 3.20.0 or higher" @$(MAKE) -C ../../native/cmake - @$(MSG) "Building Tier 3 rust target: $(RUST_TARGET)" + @$(MSG) "Building Tier-3 rust target: $(RUST_TARGET)" @(cd $(WORK_DIR) && [ ! -d rust ] && git clone --depth 1 https://github.com/rust-lang/rust.git || true) @(cd $(WORK_DIR)/rust && ./x setup compiler) @(cd $(WORK_DIR)/rust && \ @@ -103,6 +103,9 @@ else RUST_BACKTRACE=full \ ./x build --config $(TC_LOCAL_VARS_RUST)) @rustup toolchain link $(TC_RUSTUP_TOOLCHAIN) $(WORK_DIR)/rust/build/host/stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) + @for i in 0 1 2 ; do \ + [ $${i} -lt $(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) ] && (cd $(WORK_DIR)/rust && ./x clean --stage $${i}) || true ; \ + done @$(MSG) "Building Tier 3 rust target: $(RUST_TARGET) - stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) complete" endif rustup show From 6604835d26190fe6db914437453b5e2dadc033c7 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sat, 2 Dec 2023 15:23:26 +0000 Subject: [PATCH 24/58] rust: Add ADDITIONAL_RUSTFLAGS to target-tripple rustflags env var --- mk/spksrc.tc.mk | 3 +-- toolchain/syno-qoriq-6.2.4/Makefile | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mk/spksrc.tc.mk b/mk/spksrc.tc.mk index d4d92976cba..999c47ff123 100644 --- a/mk/spksrc.tc.mk +++ b/mk/spksrc.tc.mk @@ -157,9 +157,8 @@ tc_vars: flag echo TC_ENV += CARGO_BUILD_TARGET=\"$(RUST_TARGET)\" ; \ echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_AR=\"$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)ar\" ; \ echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_LINKER=\"$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)gcc\" ; \ - echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_RUSTFLAGS=\"-C link-arg=--sysroot=$(abspath $(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT))\" ; \ + echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_RUSTFLAGS=\"-C link-arg=--sysroot=$(abspath $(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT)) $(TC_RUSTFLAGS) $$\(ADDITIONAL_RUSTFLAGS\)\" ; \ echo TC_ENV += RUSTUP_TOOLCHAIN=\"$(TC_RUSTUP_TOOLCHAIN)\" ; \ - echo TC_ENV += RUSTFLAGS=\"$(TC_RUSTFLAGS)\" ; \ echo TC_CONFIGURE_ARGS := --host=$(TC_TARGET) --build=i686-pc-linux ; \ echo TC_TYPE := $(TC_TYPE) ; \ echo TC_SYSROOT := $(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT) ; \ diff --git a/toolchain/syno-qoriq-6.2.4/Makefile b/toolchain/syno-qoriq-6.2.4/Makefile index 7e613d69637..bb9ce030568 100644 --- a/toolchain/syno-qoriq-6.2.4/Makefile +++ b/toolchain/syno-qoriq-6.2.4/Makefile @@ -9,7 +9,7 @@ TC_DIST_SITE_PATH = PowerPC%20QorIQ%20Linux%202.6.32 TC_TARGET = powerpc-e500v2-linux-gnuspe TC_SYSROOT = $(TC_TARGET)/sysroot TC_EXTRA_CFLAGS = -mcpu=8548 -mhard-float -mfloat-gprs=double -TC_RUSTFLAGS = -Ctarget-cpu=e500 +TC_RUSTFLAGS = -C target-cpu=e500 POST_FIX_TARGET = qoriq_post_fix_target From 274c67b3fe08bd4bee71342ffb921e91943c019b Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 11 Jan 2024 00:33:10 +0000 Subject: [PATCH 25/58] rust.mk: Use RUSTUP_TOOLCHAIN overriding +stable|$(toolchain) --- mk/spksrc.cross-rust.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mk/spksrc.cross-rust.mk b/mk/spksrc.cross-rust.mk index f8cd6878fe2..894ccdaaa58 100644 --- a/mk/spksrc.cross-rust.mk +++ b/mk/spksrc.cross-rust.mk @@ -59,9 +59,12 @@ CARGO_INSTALL_ARGS += $(CARGO_BUILD_ARGS) endif # Default build with rust and install with cargo +# The cargo call uses tc_vars.mk RUSTUP_TOOLCHAIN variable +# overriding definition using +stable or +$(RUSTUP_TOOLCHAIN) +# https://rust-lang.github.io/rustup/environment-variables.html rust_install_target: - @echo " ==> Cargo install rust package $(PKG_NAME) (rustc +$(TC_RUSTUP_TOOLCHAIN) -vV)" - @$(RUN) rustc +$(TC_RUSTUP_TOOLCHAIN) -vV + @echo " ==> Cargo install rust package $(PKG_NAME) (rustc +$(RUSTUP_TOOLCHAIN) -vV)" + @$(RUN) rustc +$(RUSTUP_TOOLCHAIN) -vV @$(RUN) cargo install $(CARGO_INSTALL_ARGS) ##### From 086889c098c539492d627b4523312ebef1bcdff0 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 24 Jan 2024 01:42:54 +0000 Subject: [PATCH 26/58] rust: First working version for powerpc-*-gnuspe for qoriq arch NOTE: requires clean-up and review of every extra variable set --- mk/spksrc.cross-rust-env.mk | 8 ++++++-- mk/spksrc.cross-rust.mk | 7 ++++--- mk/spksrc.tc-rust.mk | 31 +++++++++++++++++++++++-------- mk/spksrc.tc.mk | 3 +-- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index 2dfb92bd934..3ac019d0388 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -8,6 +8,9 @@ CMAKE_PATH = $(abspath $(WORK_DIR)/../../../native/cmake/work-native/install/usr export CARGO_HOME=$(BASE_DISTRIB_DIR)/cargo export RUSTUP_HOME=$(BASE_DISTRIB_DIR)/rustup export PATH:=$(abspath $(BASE_DISTRIB_DIR)/cargo/bin):$(CMAKE_PATH):$(PATH) +export CFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" +export CXXFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" +export LDFLAGS_$(subst -,_,$(RUST_TARGET))="--sysroot=$(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT)" endif ifeq ($(RUSTUP_DEFAULT_TOOLCHAIN),) @@ -15,8 +18,9 @@ RUSTUP_DEFAULT_TOOLCHAIN = stable endif # When building toolchain Tier-3 arch support +# While stage-2 is the truly current compiler, stage-1 suffice our needs # https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#stage-2-the-truly-current-compiler -RUSTUP_DEFAULT_TOOLCHAIN_STAGE = 2 +RUSTUP_DEFAULT_TOOLCHAIN_STAGE = 1 ifeq ($(TC_RUSTUP_TOOLCHAIN),) TC_RUSTUP_TOOLCHAIN = $(RUSTUP_DEFAULT_TOOLCHAIN) @@ -45,7 +49,7 @@ RUST_TARGET = aarch64-unknown-linux-gnu endif ifeq ($(findstring $(ARCH), $(PPC_ARCHS)),$(ARCH)) RUST_TARGET = powerpc-unknown-linux-gnuspe -TC_RUSTUP_TOOLCHAIN = $(RUST_TARGET) +TC_RUSTUP_TOOLCHAIN = stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE)-$(RUST_TARGET) endif ifeq ($(RUST_TARGET),) $(error Arch $(ARCH) not supported) diff --git a/mk/spksrc.cross-rust.mk b/mk/spksrc.cross-rust.mk index 894ccdaaa58..fdc54cb5904 100644 --- a/mk/spksrc.cross-rust.mk +++ b/mk/spksrc.cross-rust.mk @@ -63,9 +63,10 @@ endif # overriding definition using +stable or +$(RUSTUP_TOOLCHAIN) # https://rust-lang.github.io/rustup/environment-variables.html rust_install_target: - @echo " ==> Cargo install rust package $(PKG_NAME) (rustc +$(RUSTUP_TOOLCHAIN) -vV)" - @$(RUN) rustc +$(RUSTUP_TOOLCHAIN) -vV - @$(RUN) cargo install $(CARGO_INSTALL_ARGS) + @echo " ==> Cargo install rust package $(PKG_NAME) (rustc +$(TC_RUSTUP_TOOLCHAIN) -vV)" + @$(RUN) rustc +$(TC_RUSTUP_TOOLCHAIN) -vV + @$(RUN) echo cargo +$(TC_RUSTUP_TOOLCHAIN) install $(CARGO_INSTALL_ARGS) --target $(RUST_TARGET) + @$(RUN) cargo +$(TC_RUSTUP_TOOLCHAIN) install $(CARGO_INSTALL_ARGS) --target $(RUST_TARGET) ##### diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index a103ffe96f8..652eb8c9a7e 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -45,12 +45,26 @@ rust_toml: @echo 'profile = "compiler"' ; \ echo @echo "[build]" ; \ - echo 'target = ["$(RUST_TARGET)"]' ; \ + echo 'target = ["x86_64-unknown-linux-gnu", "$(RUST_TARGET)"]' ; \ echo "build-stage = $(RUSTUP_DEFAULT_TOOLCHAIN_STAGE)" ; \ + echo "doc-stage = 2" ; \ echo "docs = false" ; \ echo "docs-minification = false" ; \ echo "compiler-docs = false" ; \ echo + @echo "[rust]" ; \ + echo 'channel = "stable"' ; \ + echo 'lto = "off"' ; \ + echo + @echo "[llvm]" ; \ + echo 'download-ci-llvm = "if-unchanged"' ; \ + echo + @echo "[install]" ; \ + echo + @echo "[dist]" ; \ + echo + @echo "[target.x86_64-unknown-linux-gnu]" ; \ + echo @echo "[target.$(RUST_TARGET)]" ; \ echo 'cc = "$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)gcc"' ; \ echo 'cxx = "$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)g++"' ; \ @@ -96,13 +110,14 @@ else @$(MSG) "Building Tier-3 rust target: $(RUST_TARGET)" @(cd $(WORK_DIR) && [ ! -d rust ] && git clone --depth 1 https://github.com/rust-lang/rust.git || true) @(cd $(WORK_DIR)/rust && ./x setup compiler) - @(cd $(WORK_DIR)/rust && \ - CFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ - CXXFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ - LDFLAGS_$(subst -,_,$(RUST_TARGET))="--sysroot=$(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT)" \ - RUST_BACKTRACE=full \ - ./x build --config $(TC_LOCAL_VARS_RUST)) - @rustup toolchain link $(TC_RUSTUP_TOOLCHAIN) $(WORK_DIR)/rust/build/host/stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) + (cd $(WORK_DIR)/rust && \ + CFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ + CPPFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ + CXXFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ + CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_RUSTFLAGS="-Ctarget-cpu=e500" \ + RUST_BACKTRACE=full \ + ./x build --config $(TC_LOCAL_VARS_RUST)) + rustup toolchain link $(TC_RUSTUP_TOOLCHAIN) $(WORK_DIR)/rust/build/host/stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) @for i in 0 1 2 ; do \ [ $${i} -lt $(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) ] && (cd $(WORK_DIR)/rust && ./x clean --stage $${i}) || true ; \ done diff --git a/mk/spksrc.tc.mk b/mk/spksrc.tc.mk index 999c47ff123..f301d2c9043 100644 --- a/mk/spksrc.tc.mk +++ b/mk/spksrc.tc.mk @@ -157,8 +157,7 @@ tc_vars: flag echo TC_ENV += CARGO_BUILD_TARGET=\"$(RUST_TARGET)\" ; \ echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_AR=\"$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)ar\" ; \ echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_LINKER=\"$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)gcc\" ; \ - echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_RUSTFLAGS=\"-C link-arg=--sysroot=$(abspath $(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT)) $(TC_RUSTFLAGS) $$\(ADDITIONAL_RUSTFLAGS\)\" ; \ - echo TC_ENV += RUSTUP_TOOLCHAIN=\"$(TC_RUSTUP_TOOLCHAIN)\" ; \ + echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_RUSTFLAGS=\"$(TC_RUSTFLAGS) $$\(ADDITIONAL_RUSTFLAGS\)\" ; \ echo TC_CONFIGURE_ARGS := --host=$(TC_TARGET) --build=i686-pc-linux ; \ echo TC_TYPE := $(TC_TYPE) ; \ echo TC_SYSROOT := $(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT) ; \ From 4de2bcdbfbd30869c22ca406a86e67a7cba62d42 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 24 Jan 2024 02:30:32 +0000 Subject: [PATCH 27/58] rust: Removed unused build flags --- mk/spksrc.tc-rust.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 652eb8c9a7e..29eb96cbd3a 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -112,9 +112,7 @@ else @(cd $(WORK_DIR)/rust && ./x setup compiler) (cd $(WORK_DIR)/rust && \ CFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ - CPPFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ - CXXFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ - CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_RUSTFLAGS="-Ctarget-cpu=e500" \ + CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_RUSTFLAGS="$(TC_RUSTFLAGS)" \ RUST_BACKTRACE=full \ ./x build --config $(TC_LOCAL_VARS_RUST)) rustup toolchain link $(TC_RUSTUP_TOOLCHAIN) $(WORK_DIR)/rust/build/host/stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) From 6a0669d713f76e0a7240a942c30783d90035510f Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 24 Jan 2024 03:12:19 +0000 Subject: [PATCH 28/58] rust: Enforce deleting config.toml prior to setting up compiler --- mk/spksrc.tc-rust.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 29eb96cbd3a..b9bfa35fa37 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -109,7 +109,7 @@ else @$(MAKE) -C ../../native/cmake @$(MSG) "Building Tier-3 rust target: $(RUST_TARGET)" @(cd $(WORK_DIR) && [ ! -d rust ] && git clone --depth 1 https://github.com/rust-lang/rust.git || true) - @(cd $(WORK_DIR)/rust && ./x setup compiler) + @(cd $(WORK_DIR)/rust && rm -f config.toml && ./x setup compiler) (cd $(WORK_DIR)/rust && \ CFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_RUSTFLAGS="$(TC_RUSTFLAGS)" \ From 9f4936b5d907c6d322cf49785d791934854232f1 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 24 Jan 2024 10:17:25 +0000 Subject: [PATCH 29/58] rust: Either use native/llvm-9.0 or include clang-llvm to docker --- mk/spksrc.cross-rust-env.mk | 6 ++---- mk/spksrc.tc-rust.mk | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index 3ac019d0388..0e46d9afdd7 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -5,12 +5,10 @@ ifneq ($(BASE_DISTRIB_DIR),) # Enforce newer cmake when building tier-3 toolchains CMAKE_PATH = $(abspath $(WORK_DIR)/../../../native/cmake/work-native/install/usr/local/bin) +LLVM_PATH = $(abspath $(WORK_DIR)/../../../native/llvm-9.0/work-native/install/usr/local/bin) export CARGO_HOME=$(BASE_DISTRIB_DIR)/cargo export RUSTUP_HOME=$(BASE_DISTRIB_DIR)/rustup -export PATH:=$(abspath $(BASE_DISTRIB_DIR)/cargo/bin):$(CMAKE_PATH):$(PATH) -export CFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" -export CXXFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" -export LDFLAGS_$(subst -,_,$(RUST_TARGET))="--sysroot=$(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT)" +export PATH:=$(abspath $(BASE_DISTRIB_DIR)/cargo/bin):$(CMAKE_PATH):$(LLVM_PATH):$(PATH) endif ifeq ($(RUSTUP_DEFAULT_TOOLCHAIN),) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index b9bfa35fa37..50af2dc3613 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -107,6 +107,8 @@ else @$(MSG) "Target $(RUST_TARGET) unavailable..." @$(MSG) "Enforce usage of CMake 3.20.0 or higher" @$(MAKE) -C ../../native/cmake + @$(MSG) "Enforce availability of native LLVM" + @$(MAKE) -C ../../native/llvm-9.0 @$(MSG) "Building Tier-3 rust target: $(RUST_TARGET)" @(cd $(WORK_DIR) && [ ! -d rust ] && git clone --depth 1 https://github.com/rust-lang/rust.git || true) @(cd $(WORK_DIR)/rust && rm -f config.toml && ./x setup compiler) From e1bb2ecfec84726ce3e5579dd754d68cbfad571c Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 24 Jan 2024 22:01:27 +0000 Subject: [PATCH 30/58] rust: Attempt at fixing LLVM error on github-action --- mk/spksrc.tc-rust.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 50af2dc3613..68e207badb6 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -107,10 +107,9 @@ else @$(MSG) "Target $(RUST_TARGET) unavailable..." @$(MSG) "Enforce usage of CMake 3.20.0 or higher" @$(MAKE) -C ../../native/cmake - @$(MSG) "Enforce availability of native LLVM" - @$(MAKE) -C ../../native/llvm-9.0 @$(MSG) "Building Tier-3 rust target: $(RUST_TARGET)" @(cd $(WORK_DIR) && [ ! -d rust ] && git clone --depth 1 https://github.com/rust-lang/rust.git || true) + @(cd $(WORK_DIR) && git submodule init && git submodule update --depth 1 src/llvm-project) @(cd $(WORK_DIR)/rust && rm -f config.toml && ./x setup compiler) (cd $(WORK_DIR)/rust && \ CFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ From b57b66bd43f7771cc59a50546b7c714b0e01b92a Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 24 Jan 2024 22:04:19 +0000 Subject: [PATCH 31/58] rust: Fix typo in precedent commit --- mk/spksrc.tc-rust.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 68e207badb6..080ca91a08b 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -109,7 +109,7 @@ else @$(MAKE) -C ../../native/cmake @$(MSG) "Building Tier-3 rust target: $(RUST_TARGET)" @(cd $(WORK_DIR) && [ ! -d rust ] && git clone --depth 1 https://github.com/rust-lang/rust.git || true) - @(cd $(WORK_DIR) && git submodule init && git submodule update --depth 1 src/llvm-project) + @(cd $(WORK_DIR)/rust && git submodule init && git submodule update --depth 1 src/llvm-project) @(cd $(WORK_DIR)/rust && rm -f config.toml && ./x setup compiler) (cd $(WORK_DIR)/rust && \ CFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ From e8856a1d1bd57a3329496ab62fbd95ab8f592179 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 25 Jan 2024 00:06:13 +0000 Subject: [PATCH 32/58] rust: Remove previous LLVM attempts --- mk/spksrc.cross-rust-env.mk | 3 +-- mk/spksrc.tc-rust.mk | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index 0e46d9afdd7..4593612cba6 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -5,10 +5,9 @@ ifneq ($(BASE_DISTRIB_DIR),) # Enforce newer cmake when building tier-3 toolchains CMAKE_PATH = $(abspath $(WORK_DIR)/../../../native/cmake/work-native/install/usr/local/bin) -LLVM_PATH = $(abspath $(WORK_DIR)/../../../native/llvm-9.0/work-native/install/usr/local/bin) export CARGO_HOME=$(BASE_DISTRIB_DIR)/cargo export RUSTUP_HOME=$(BASE_DISTRIB_DIR)/rustup -export PATH:=$(abspath $(BASE_DISTRIB_DIR)/cargo/bin):$(CMAKE_PATH):$(LLVM_PATH):$(PATH) +export PATH:=$(abspath $(BASE_DISTRIB_DIR)/cargo/bin):$(CMAKE_PATH):$(PATH) endif ifeq ($(RUSTUP_DEFAULT_TOOLCHAIN),) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 080ca91a08b..b9bfa35fa37 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -109,7 +109,6 @@ else @$(MAKE) -C ../../native/cmake @$(MSG) "Building Tier-3 rust target: $(RUST_TARGET)" @(cd $(WORK_DIR) && [ ! -d rust ] && git clone --depth 1 https://github.com/rust-lang/rust.git || true) - @(cd $(WORK_DIR)/rust && git submodule init && git submodule update --depth 1 src/llvm-project) @(cd $(WORK_DIR)/rust && rm -f config.toml && ./x setup compiler) (cd $(WORK_DIR)/rust && \ CFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ From d0354c605a9edc05844ac2403e11eaad75e46c32 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 25 Jan 2024 00:07:29 +0000 Subject: [PATCH 33/58] rust: Add llvm-13 and clang-13 part of the base install --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index db92d7f9a91..550053b22b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ bison \ build-essential \ check \ + clang-13 \ cmake \ curl \ cython3 \ @@ -50,6 +51,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ libssl-dev \ libtool \ libunistring-dev \ + llvm-13 \ lzip \ mercurial \ moreutils \ From 4046a28d4b3130d802f5203faf1794066693ba3c Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 25 Jan 2024 00:33:44 +0000 Subject: [PATCH 34/58] rust: Revert commit related to llvm-13 and clang-13 in Dockerfile --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 550053b22b7..db92d7f9a91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,6 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ bison \ build-essential \ check \ - clang-13 \ cmake \ curl \ cython3 \ @@ -51,7 +50,6 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ libssl-dev \ libtool \ libunistring-dev \ - llvm-13 \ lzip \ mercurial \ moreutils \ From 9523df8373d6bffc31febe28ae1cfa237928eb27 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 25 Jan 2024 00:34:21 +0000 Subject: [PATCH 35/58] rust: Enforce build to x86_64-unknown-linux-gnu --- mk/spksrc.tc-rust.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index b9bfa35fa37..6a727f4ae65 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -109,12 +109,12 @@ else @$(MAKE) -C ../../native/cmake @$(MSG) "Building Tier-3 rust target: $(RUST_TARGET)" @(cd $(WORK_DIR) && [ ! -d rust ] && git clone --depth 1 https://github.com/rust-lang/rust.git || true) - @(cd $(WORK_DIR)/rust && rm -f config.toml && ./x setup compiler) + @(cd $(WORK_DIR)/rust && rm -f config.toml && ./x --build x86_64-unknown-linux-gnu setup compiler) (cd $(WORK_DIR)/rust && \ CFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_RUSTFLAGS="$(TC_RUSTFLAGS)" \ RUST_BACKTRACE=full \ - ./x build --config $(TC_LOCAL_VARS_RUST)) + ./x --build x86_64-unknown-linux-gnu build --config $(TC_LOCAL_VARS_RUST)) rustup toolchain link $(TC_RUSTUP_TOOLCHAIN) $(WORK_DIR)/rust/build/host/stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) @for i in 0 1 2 ; do \ [ $${i} -lt $(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) ] && (cd $(WORK_DIR)/rust && ./x clean --stage $${i}) || true ; \ From ae8a838b5cf1eb9c1b95fa7c775d143af6b934bd Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 25 Jan 2024 00:45:34 +0000 Subject: [PATCH 36/58] rust: Revert enforcing build triplet --- mk/spksrc.tc-rust.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 6a727f4ae65..b9bfa35fa37 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -109,12 +109,12 @@ else @$(MAKE) -C ../../native/cmake @$(MSG) "Building Tier-3 rust target: $(RUST_TARGET)" @(cd $(WORK_DIR) && [ ! -d rust ] && git clone --depth 1 https://github.com/rust-lang/rust.git || true) - @(cd $(WORK_DIR)/rust && rm -f config.toml && ./x --build x86_64-unknown-linux-gnu setup compiler) + @(cd $(WORK_DIR)/rust && rm -f config.toml && ./x setup compiler) (cd $(WORK_DIR)/rust && \ CFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \ CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_RUSTFLAGS="$(TC_RUSTFLAGS)" \ RUST_BACKTRACE=full \ - ./x --build x86_64-unknown-linux-gnu build --config $(TC_LOCAL_VARS_RUST)) + ./x build --config $(TC_LOCAL_VARS_RUST)) rustup toolchain link $(TC_RUSTUP_TOOLCHAIN) $(WORK_DIR)/rust/build/host/stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) @for i in 0 1 2 ; do \ [ $${i} -lt $(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) ] && (cd $(WORK_DIR)/rust && ./x clean --stage $${i}) || true ; \ From 0bd11c3ec17ecf2101bf77e902d7f3462c1dfb86 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 25 Jan 2024 00:46:17 +0000 Subject: [PATCH 37/58] rust: Disable download-ci-llvm to enforce building of LLVM --- mk/spksrc.tc-rust.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index b9bfa35fa37..1ff9a34fed5 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -57,7 +57,6 @@ rust_toml: echo 'lto = "off"' ; \ echo @echo "[llvm]" ; \ - echo 'download-ci-llvm = "if-unchanged"' ; \ echo @echo "[install]" ; \ echo From 044cac0fad5fc6fb6d5e4f99e3937cf90afad242 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 25 Jan 2024 01:06:24 +0000 Subject: [PATCH 38/58] rust: Don't enforce building x86_64 and remove llvm to use default --- mk/spksrc.tc-rust.mk | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 1ff9a34fed5..6bc96c4a854 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -45,7 +45,7 @@ rust_toml: @echo 'profile = "compiler"' ; \ echo @echo "[build]" ; \ - echo 'target = ["x86_64-unknown-linux-gnu", "$(RUST_TARGET)"]' ; \ + echo 'target = ["$(RUST_TARGET)"]' ; \ echo "build-stage = $(RUSTUP_DEFAULT_TOOLCHAIN_STAGE)" ; \ echo "doc-stage = 2" ; \ echo "docs = false" ; \ @@ -56,14 +56,10 @@ rust_toml: echo 'channel = "stable"' ; \ echo 'lto = "off"' ; \ echo - @echo "[llvm]" ; \ - echo @echo "[install]" ; \ echo @echo "[dist]" ; \ echo - @echo "[target.x86_64-unknown-linux-gnu]" ; \ - echo @echo "[target.$(RUST_TARGET)]" ; \ echo 'cc = "$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)gcc"' ; \ echo 'cxx = "$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)g++"' ; \ From cfd2e6b97115e629e274c32d467bfd18f0b53f42 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 25 Jan 2024 01:15:31 +0000 Subject: [PATCH 39/58] rust: Enforce building LLVM --- mk/spksrc.tc-rust.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 6bc96c4a854..3af3a0bf0a2 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -56,6 +56,9 @@ rust_toml: echo 'channel = "stable"' ; \ echo 'lto = "off"' ; \ echo + @echo "[llvm]" ; \ + echo 'download-ci-llvm = "false"' ; \ + echo @echo "[install]" ; \ echo @echo "[dist]" ; \ From 56585289a64adb0b16a4cbb4069ba618b8f26e28 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 25 Jan 2024 01:32:01 +0000 Subject: [PATCH 40/58] rust: tentative typo fixing for llvm building --- mk/spksrc.tc-rust.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 3af3a0bf0a2..2ed2d83e7dc 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -57,7 +57,7 @@ rust_toml: echo 'lto = "off"' ; \ echo @echo "[llvm]" ; \ - echo 'download-ci-llvm = "false"' ; \ + echo "download-ci-llvm = false" ; \ echo @echo "[install]" ; \ echo From 79568b81ea30a8fe6e16329722f91c7ec521a9b5 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 25 Jan 2024 01:41:53 +0000 Subject: [PATCH 41/58] rust: Change default stage to 2 Hoping to solve github-action error message: failed: x.py should be run with `--stage 2` on CI, but was run with `--stage 1` --- mk/spksrc.cross-rust-env.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index 4593612cba6..752774add03 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -17,7 +17,7 @@ endif # When building toolchain Tier-3 arch support # While stage-2 is the truly current compiler, stage-1 suffice our needs # https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#stage-2-the-truly-current-compiler -RUSTUP_DEFAULT_TOOLCHAIN_STAGE = 1 +RUSTUP_DEFAULT_TOOLCHAIN_STAGE = 2 ifeq ($(TC_RUSTUP_TOOLCHAIN),) TC_RUSTUP_TOOLCHAIN = $(RUSTUP_DEFAULT_TOOLCHAIN) From ceb7783cd843c1f15c338bd85929328aa3b04426 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 25 Jan 2024 02:33:09 +0000 Subject: [PATCH 42/58] rust: Re-try downloading LLVM using if-unchanged option --- mk/spksrc.tc-rust.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 2ed2d83e7dc..fd30bc08684 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -57,7 +57,7 @@ rust_toml: echo 'lto = "off"' ; \ echo @echo "[llvm]" ; \ - echo "download-ci-llvm = false" ; \ + echo "download-ci-llvm = if-unchanged" ; \ echo @echo "[install]" ; \ echo From b5e7582d8971f5452313ccb15762b94ed4a025ad Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 25 Jan 2024 02:44:42 +0000 Subject: [PATCH 43/58] rust: llvm "if-unchanged" seem to reuquire quotes --- mk/spksrc.tc-rust.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index fd30bc08684..f95790ca6ef 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -57,7 +57,7 @@ rust_toml: echo 'lto = "off"' ; \ echo @echo "[llvm]" ; \ - echo "download-ci-llvm = if-unchanged" ; \ + echo 'download-ci-llvm = "if-unchanged"' ; \ echo @echo "[install]" ; \ echo From f9ac7b87094d2ef3de7bcbc687ff1b904bbaf7ae Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 25 Jan 2024 12:07:03 +0000 Subject: [PATCH 44/58] rust: re-introduce host target as otherwise missing crates This was fixed earlier by ensuring to build host rust as well part of that toolchain otherwise get errors such as: error[E0463]: can't find crate for `core` error[E0463]: can't find crate for `compiler_builtins` --- mk/spksrc.tc-rust.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index f95790ca6ef..b9bfa35fa37 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -45,7 +45,7 @@ rust_toml: @echo 'profile = "compiler"' ; \ echo @echo "[build]" ; \ - echo 'target = ["$(RUST_TARGET)"]' ; \ + echo 'target = ["x86_64-unknown-linux-gnu", "$(RUST_TARGET)"]' ; \ echo "build-stage = $(RUSTUP_DEFAULT_TOOLCHAIN_STAGE)" ; \ echo "doc-stage = 2" ; \ echo "docs = false" ; \ @@ -63,6 +63,8 @@ rust_toml: echo @echo "[dist]" ; \ echo + @echo "[target.x86_64-unknown-linux-gnu]" ; \ + echo @echo "[target.$(RUST_TARGET)]" ; \ echo 'cc = "$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)gcc"' ; \ echo 'cxx = "$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)g++"' ; \ From 9b4c31e0ca0a02b11aa9fc33a9410b09582d79ee Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 25 Jan 2024 17:52:06 +0000 Subject: [PATCH 45/58] rust: Specify RUSTUP_TOOLCHAIN so python wheel can build --- mk/spksrc.tc.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/mk/spksrc.tc.mk b/mk/spksrc.tc.mk index f301d2c9043..47ffb7a3085 100644 --- a/mk/spksrc.tc.mk +++ b/mk/spksrc.tc.mk @@ -154,6 +154,7 @@ tc_vars: flag echo TC_ENV += LDFLAGS=\"$(LDFLAGS) $$\(ADDITIONAL_LDFLAGS\)\" ; \ echo TC_ENV += CARGO_HOME=\"$(realpath $(CARGO_HOME))\" ; \ echo TC_ENV += RUSTUP_HOME=\"$(realpath $(RUSTUP_HOME))\" ; \ + echo TC_ENV += RUSTUP_TOOLCHAIN=\"$(TC_RUSTUP_TOOLCHAIN)\" ; \ echo TC_ENV += CARGO_BUILD_TARGET=\"$(RUST_TARGET)\" ; \ echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_AR=\"$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)ar\" ; \ echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_LINKER=\"$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)gcc\" ; \ From b2ccc55df35315e8aab828dfcafd7e9d107728db Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sat, 27 Jan 2024 15:48:21 +0000 Subject: [PATCH 46/58] native/rust-qoriq: Ability to download and use pre-built toolchain --- native/rust-qoriq/Makefile | 29 +++++++++++++++++++++++++++++ native/rust-qoriq/digests | 3 +++ 2 files changed, 32 insertions(+) create mode 100644 native/rust-qoriq/Makefile create mode 100644 native/rust-qoriq/digests diff --git a/native/rust-qoriq/Makefile b/native/rust-qoriq/Makefile new file mode 100644 index 00000000000..2cb9d067611 --- /dev/null +++ b/native/rust-qoriq/Makefile @@ -0,0 +1,29 @@ +PKG_NAME = rust-qoriq +PKG_VERS = 1.77.0-nightly +PKG_EXT = txz +PKG_DIST_NAME = stage2_powerpc-unknown-linux-gnuspe.txz +PKG_DIST_SITE = https://github.com/SynoCommunity/spksrc/releases/download/toolchains%2Frust%2F1.77.0-nightly +EXTRACT_PATH = $(INSTALL_DIR)/$(INSTALL_PREFIX) + +DEPENDS = + +HOMEPAGE = https://www.rust-lang.org/ +COMMENT = A language empowering everyone to build reliable and efficient software. +LICENSE = Apache-2.0, MIT licenses + +# extracted directly into install folder +INSTALL_TARGET = nop +POST_INSTALL_TARGET = rust-qoriq-postinstall + +CARGO_PATH=$(abspath $(BASE_DISTRIB_DIR)/cargo/bin) +RUSTUP_HOME=$(abspath $(BASE_DISTRIB_DIR)/rustup) + +include ../../mk/spksrc.native-install.mk + +.PHONY: rust-qoriq-postinstall +rust-qoriq-postinstall: + export PATH="$(CARGO_PATH):$${PATH}" ; \ + export RUSTUP_HOME="$(RUSTUP_HOME)" ; \ + which rustup ; \ + rustup toolchain link stage2-powerpc-unknown-linux-gnuspe $(abspath $(INSTALL_DIR)/$(INSTALL_PREFIX)) ; \ + rustup show diff --git a/native/rust-qoriq/digests b/native/rust-qoriq/digests new file mode 100644 index 00000000000..cb2db960228 --- /dev/null +++ b/native/rust-qoriq/digests @@ -0,0 +1,3 @@ +stage2_powerpc-unknown-linux-gnuspe.txz SHA1 377911465d0364e13136fa50d19bfd0a3660a373 +stage2_powerpc-unknown-linux-gnuspe.txz SHA256 e02030225a6e6e1f680f4bdc4e902506f8742a73ba02673a80640d9aaf336fea +stage2_powerpc-unknown-linux-gnuspe.txz MD5 1129e9a88ccfaa94217a18e26d8adc00 From 39fa1200fbe9a7a92b816925c5578b1bdd65c3ba Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sat, 27 Jan 2024 16:13:39 +0000 Subject: [PATCH 47/58] rust: Enable usage of native/rust-qoriq --- mk/spksrc.cross-rust-env.mk | 28 ++++++++++++++++++---------- mk/spksrc.tc-rust.mk | 10 +++++++++- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index 752774add03..1b0b06ee805 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -19,20 +19,15 @@ endif # https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#stage-2-the-truly-current-compiler RUSTUP_DEFAULT_TOOLCHAIN_STAGE = 2 -ifeq ($(TC_RUSTUP_TOOLCHAIN),) -TC_RUSTUP_TOOLCHAIN = $(RUSTUP_DEFAULT_TOOLCHAIN) +# When calling directly from +# toolchain/syno-- +# ARCH variable is still unset +ifeq ($(ARCH),) +ARCH=$(TC_ARCH) endif -RUST_TARGET = # map archs to rust targets -ifeq ($(findstring $(ARCH), $(x64_ARCHS)),$(ARCH)) -RUST_TARGET = x86_64-unknown-linux-gnu -endif -ifeq ($(findstring $(ARCH), $(i686_ARCHS)),$(ARCH)) -RUST_TARGET = i686-unknown-linux-gnu -endif ifeq ($(findstring $(ARCH), $(ARMv5_ARCHS)),$(ARCH)) -# may be not supported for cargo RUST_TARGET = armv5te-unknown-linux-gnueabi endif ifeq ($(findstring $(ARCH), $(ARMv7_ARCHS)),$(ARCH)) @@ -45,9 +40,22 @@ ifeq ($(findstring $(ARCH), $(ARMv8_ARCHS)),$(ARCH)) RUST_TARGET = aarch64-unknown-linux-gnu endif ifeq ($(findstring $(ARCH), $(PPC_ARCHS)),$(ARCH)) +RUST_FORCE_TOOLCHAIN = 0 RUST_TARGET = powerpc-unknown-linux-gnuspe TC_RUSTUP_TOOLCHAIN = stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE)-$(RUST_TARGET) endif +ifeq ($(findstring $(ARCH), $(x64_ARCHS)),$(ARCH)) +RUST_TARGET = x86_64-unknown-linux-gnu +endif +ifeq ($(findstring $(ARCH), $(i686_ARCHS)),$(ARCH)) +RUST_TARGET = i686-unknown-linux-gnu +endif + ifeq ($(RUST_TARGET),) $(error Arch $(ARCH) not supported) endif + +# By default use the default toolchain if unset +ifeq ($(TC_RUSTUP_TOOLCHAIN),) +TC_RUSTUP_TOOLCHAIN = $(RUSTUP_DEFAULT_TOOLCHAIN) +endif diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index b9bfa35fa37..840a9997f79 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -103,10 +103,17 @@ ifeq ($(TC_RUSTUP_TOOLCHAIN),$(RUSTUP_DEFAULT_TOOLCHAIN)) @$(MSG) "rustup target add $(RUST_TARGET)" rustup override set stable rustup target add $(RUST_TARGET) + rustup show else @$(MSG) "Target $(RUST_TARGET) unavailable..." +ifeq ($(RUST_BUILD_TOOLCHAIN),0) + @$(MSG) "Install rust target $(RUST_TARGET) from native" + @$(MAKE) -C ../../native/rust-qoriq +else + @$(MSG) "Build rust target $(RUST_TARGET) from sources" @$(MSG) "Enforce usage of CMake 3.20.0 or higher" @$(MAKE) -C ../../native/cmake + exit 2 @$(MSG) "Building Tier-3 rust target: $(RUST_TARGET)" @(cd $(WORK_DIR) && [ ! -d rust ] && git clone --depth 1 https://github.com/rust-lang/rust.git || true) @(cd $(WORK_DIR)/rust && rm -f config.toml && ./x setup compiler) @@ -120,8 +127,9 @@ else [ $${i} -lt $(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) ] && (cd $(WORK_DIR)/rust && ./x clean --stage $${i}) || true ; \ done @$(MSG) "Building Tier 3 rust target: $(RUST_TARGET) - stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) complete" -endif rustup show +endif +endif post_rustc_target: $(RUSTC_TARGET) From acb36a36cee26621314dad5c8bf156d68477c784 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sat, 27 Jan 2024 20:55:05 +0000 Subject: [PATCH 48/58] rust: Fix toolchain setting-up dues to TC_ARCH vs ARCH usages --- mk/spksrc.cross-rust-env.mk | 26 +++++++++++--------------- mk/spksrc.tc-rust.mk | 1 - 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index 1b0b06ee805..b92135686e8 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -19,40 +19,36 @@ endif # https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#stage-2-the-truly-current-compiler RUSTUP_DEFAULT_TOOLCHAIN_STAGE = 2 -# When calling directly from -# toolchain/syno-- -# ARCH variable is still unset -ifeq ($(ARCH),) -ARCH=$(TC_ARCH) -endif +# When calling directly from toolchain/syno-- +# ARCH variable is still unset thus using $(or $(ARCH),$(TC_ARCH)) # map archs to rust targets -ifeq ($(findstring $(ARCH), $(ARMv5_ARCHS)),$(ARCH)) +ifeq ($(findstring $(or $(ARCH),$(TC_ARCH)), $(ARMv5_ARCHS)),$(or $(ARCH),$(TC_ARCH))) RUST_TARGET = armv5te-unknown-linux-gnueabi endif -ifeq ($(findstring $(ARCH), $(ARMv7_ARCHS)),$(ARCH)) +ifeq ($(findstring $(or $(ARCH),$(TC_ARCH)), $(ARMv7_ARCHS)),$(or $(ARCH),$(TC_ARCH))) RUST_TARGET = armv7-unknown-linux-gnueabihf endif -ifeq ($(findstring $(ARCH), $(ARMv7L_ARCHS)),$(ARCH)) +ifeq ($(findstring $(or $(ARCH),$(TC_ARCH)), $(ARMv7L_ARCHS)),$(or $(ARCH),$(TC_ARCH))) RUST_TARGET = armv7-unknown-linux-gnueabi endif -ifeq ($(findstring $(ARCH), $(ARMv8_ARCHS)),$(ARCH)) +ifeq ($(findstring $(or $(ARCH),$(TC_ARCH)), $(ARMv8_ARCHS)),$(or $(ARCH),$(TC_ARCH))) RUST_TARGET = aarch64-unknown-linux-gnu endif -ifeq ($(findstring $(ARCH), $(PPC_ARCHS)),$(ARCH)) -RUST_FORCE_TOOLCHAIN = 0 +ifeq ($(findstring $(or $(ARCH),$(TC_ARCH)), $(PPC_ARCHS)),$(or $(ARCH),$(TC_ARCH))) +RUST_BUILD_TOOLCHAIN = 0 RUST_TARGET = powerpc-unknown-linux-gnuspe TC_RUSTUP_TOOLCHAIN = stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE)-$(RUST_TARGET) endif -ifeq ($(findstring $(ARCH), $(x64_ARCHS)),$(ARCH)) +ifeq ($(findstring $(or $(ARCH),$(TC_ARCH)), $(x64_ARCHS)),$(or $(ARCH),$(TC_ARCH))) RUST_TARGET = x86_64-unknown-linux-gnu endif -ifeq ($(findstring $(ARCH), $(i686_ARCHS)),$(ARCH)) +ifeq ($(findstring $(or $(ARCH),$(TC_ARCH)), $(i686_ARCHS)),$(or $(ARCH),$(TC_ARCH))) RUST_TARGET = i686-unknown-linux-gnu endif ifeq ($(RUST_TARGET),) -$(error Arch $(ARCH) not supported) +$(error Arch $(or $(ARCH),$(TC_ARCH)) not supported) endif # By default use the default toolchain if unset diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index 840a9997f79..d1783dceaca 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -98,7 +98,6 @@ rustc_target: $(PRE_RUSTC_TARGET) $(TC_LOCAL_VARS_RUST) $(MSG) "rustup default $(RUSTUP_DEFAULT_TOOLCHAIN)" ; \ rustup default $(RUSTUP_DEFAULT_TOOLCHAIN) ; \ flock -u 5 - rustup show ifeq ($(TC_RUSTUP_TOOLCHAIN),$(RUSTUP_DEFAULT_TOOLCHAIN)) @$(MSG) "rustup target add $(RUST_TARGET)" rustup override set stable From cffe77476147ccb0ca010ea04dad07ac6ff0c665 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sat, 27 Jan 2024 21:20:18 +0000 Subject: [PATCH 49/58] rust: "ARCH" detection for toolchain independantly from location When called from cross or spk usage of $(ARCH) When called from toolchain: - Usage of $(TC_ARCH) when $(TC_NAME) does not exist - Usage of $(TC_NAME) for generic archs --- mk/spksrc.cross-rust-env.mk | 24 +++++++++++++----------- mk/spksrc.tc-rust.mk | 4 ++++ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index b92135686e8..9a3a1a138fd 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -14,41 +14,43 @@ ifeq ($(RUSTUP_DEFAULT_TOOLCHAIN),) RUSTUP_DEFAULT_TOOLCHAIN = stable endif +# When calling directly from toolchain/syno-- +# ARCH variable is still unset thus using $(TC_ARCH) although +# in generic archs we must rely on $(TC_NANE) +RUST_ARCH = $(or $(ARCH),$(lastword $(subst -, ,$(TC_NAME))),$(TC_ARCH)) + # When building toolchain Tier-3 arch support # While stage-2 is the truly current compiler, stage-1 suffice our needs # https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#stage-2-the-truly-current-compiler RUSTUP_DEFAULT_TOOLCHAIN_STAGE = 2 -# When calling directly from toolchain/syno-- -# ARCH variable is still unset thus using $(or $(ARCH),$(TC_ARCH)) - # map archs to rust targets -ifeq ($(findstring $(or $(ARCH),$(TC_ARCH)), $(ARMv5_ARCHS)),$(or $(ARCH),$(TC_ARCH))) +ifeq ($(findstring $(RUST_ARCH), $(ARMv5_ARCHS)),$(RUST_ARCH)) RUST_TARGET = armv5te-unknown-linux-gnueabi endif -ifeq ($(findstring $(or $(ARCH),$(TC_ARCH)), $(ARMv7_ARCHS)),$(or $(ARCH),$(TC_ARCH))) +ifeq ($(findstring $(RUST_ARCH), $(ARMv7_ARCHS)),$(RUST_ARCH)) RUST_TARGET = armv7-unknown-linux-gnueabihf endif -ifeq ($(findstring $(or $(ARCH),$(TC_ARCH)), $(ARMv7L_ARCHS)),$(or $(ARCH),$(TC_ARCH))) +ifeq ($(findstring $(RUST_ARCH), $(ARMv7L_ARCHS)),$(RUST_ARCH)) RUST_TARGET = armv7-unknown-linux-gnueabi endif -ifeq ($(findstring $(or $(ARCH),$(TC_ARCH)), $(ARMv8_ARCHS)),$(or $(ARCH),$(TC_ARCH))) +ifeq ($(findstring $(RUST_ARCH), $(ARMv8_ARCHS)),$(RUST_ARCH)) RUST_TARGET = aarch64-unknown-linux-gnu endif -ifeq ($(findstring $(or $(ARCH),$(TC_ARCH)), $(PPC_ARCHS)),$(or $(ARCH),$(TC_ARCH))) +ifeq ($(findstring $(RUST_ARCH), $(PPC_ARCHS)),$(RUST_ARCH)) RUST_BUILD_TOOLCHAIN = 0 RUST_TARGET = powerpc-unknown-linux-gnuspe TC_RUSTUP_TOOLCHAIN = stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE)-$(RUST_TARGET) endif -ifeq ($(findstring $(or $(ARCH),$(TC_ARCH)), $(x64_ARCHS)),$(or $(ARCH),$(TC_ARCH))) +ifeq ($(findstring $(RUST_ARCH), $(x64_ARCHS)),$(RUST_ARCH)) RUST_TARGET = x86_64-unknown-linux-gnu endif -ifeq ($(findstring $(or $(ARCH),$(TC_ARCH)), $(i686_ARCHS)),$(or $(ARCH),$(TC_ARCH))) +ifeq ($(findstring $(RUST_ARCH), $(i686_ARCHS)),$(RUST_ARCH)) RUST_TARGET = i686-unknown-linux-gnu endif ifeq ($(RUST_TARGET),) -$(error Arch $(or $(ARCH),$(TC_ARCH)) not supported) +$(error Arch $(RUST_ARCH) not supported) endif # By default use the default toolchain if unset diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index d1783dceaca..a4b348eec42 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -8,7 +8,11 @@ # Define rustc configuration toml file location # when rebuilding for unsupported archs (i.e. Tier 3) +ifeq ($(strip $(TC_NAME)),) TC_LOCAL_VARS_RUST = $(WORK_DIR)/$(TC_ARCH).toml +else +TC_LOCAL_VARS_RUST = $(WORK_DIR)/$(lastword $(subst -, ,$(TC_NAME))).toml +endif # Configure file descriptor lock timeout ifeq ($(strip $(FLOCK_TIMEOUT)),) From f6ef3973970f014a17638c8956f9b3325cc7a7e1 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sun, 4 Feb 2024 21:26:57 +0000 Subject: [PATCH 50/58] python311: Remove duplicate code kept from rebasing --- spk/python311/Makefile | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/spk/python311/Makefile b/spk/python311/Makefile index 18c83a5e65e..9af26ad5886 100644 --- a/spk/python311/Makefile +++ b/spk/python311/Makefile @@ -101,18 +101,6 @@ include ../../mk/spksrc.common.mk # Enable debug_info symgols for all archs GCC_DEBUG_INFO := 1 -# Force compiler LTO optimizations except: -# - when testing all wheels -# - when including debug_info symbols -# - when using PPC arch (fails on qoriq) -ifneq ($(strip $(WHEELS_TEST_ALL)),1) -ifneq ($(strip $(GCC_DEBUG_INFO)),1) -ifneq ($(findstring $(ARCH),$(PPC_ARCHS)),$(ARCH)) -ENV += PYTHON_OPTIMIZE=1 -endif -endif -endif - # Force compiler LTO optimizations except: # - when testing all wheels # - when including debug_info symbols From aeec0d03f0a012a92fbf544c33fca8490a86d952 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sun, 4 Feb 2024 21:31:17 +0000 Subject: [PATCH 51/58] homeassistant: Disable GCC_DEBUG_INFO --- spk/homeassistant/Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/spk/homeassistant/Makefile b/spk/homeassistant/Makefile index 2586684f00b..b69d396c98b 100644 --- a/spk/homeassistant/Makefile +++ b/spk/homeassistant/Makefile @@ -107,9 +107,6 @@ DEPENDS += cross/libxslt include ../../mk/spksrc.python.mk -# Enable debug_info symgols for all archs -GCC_DEBUG_INFO := 1 - # prefer native python tools (pip, maturin, ...) ENV += PATH=$(realpath $(WORK_DIR)/../../../native/$(PYTHON_PACKAGE)/work-native/install/usr/local/bin):$(PATH) From 83a61c97c714f0dd6ba736d32d5ee3969ad0cb30 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sun, 4 Feb 2024 21:32:17 +0000 Subject: [PATCH 52/58] python311: Disable GCC_DEBUG_INFO --- spk/python311/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spk/python311/Makefile b/spk/python311/Makefile index 9af26ad5886..95fb05a3708 100644 --- a/spk/python311/Makefile +++ b/spk/python311/Makefile @@ -99,7 +99,7 @@ endif include ../../mk/spksrc.common.mk # Enable debug_info symgols for all archs -GCC_DEBUG_INFO := 1 +#GCC_DEBUG_INFO := 1 # Force compiler LTO optimizations except: # - when testing all wheels From 7761c8d84693a7fc8f1bed3852a10d2b1eed3bf6 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sun, 4 Feb 2024 21:32:47 +0000 Subject: [PATCH 53/58] sabnzbd: Disable GCC_DEBUG_INFO --- spk/sabnzbd/Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/spk/sabnzbd/Makefile b/spk/sabnzbd/Makefile index 5f6f434d151..ea63a1ef3ef 100644 --- a/spk/sabnzbd/Makefile +++ b/spk/sabnzbd/Makefile @@ -49,9 +49,6 @@ include ../../mk/spksrc.python.mk # prefer native python tools (pip, maturin, ...) used for orjson ENV += PATH=$(realpath $(WORK_DIR)/../../../native/$(PYTHON_PACKAGE)/work-native/install/usr/local/bin):$(PATH) -# Enable debug_info symgols for all archs -GCC_DEBUG_INFO := 1 - .PHONY: sabnzbd_extra_install sabnzbd_extra_install: install -m 755 -d $(STAGING_DIR)/var/scripts From e2ad7dc308875825dbb44746c0836289d210b50e Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sun, 4 Feb 2024 21:35:09 +0000 Subject: [PATCH 54/58] qoriq-6.2.4: convert test to -L and using ln -sf (@hgy59) --- toolchain/syno-qoriq-6.2.4/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchain/syno-qoriq-6.2.4/Makefile b/toolchain/syno-qoriq-6.2.4/Makefile index bb9ce030568..ab31fc4a80b 100644 --- a/toolchain/syno-qoriq-6.2.4/Makefile +++ b/toolchain/syno-qoriq-6.2.4/Makefile @@ -19,6 +19,6 @@ include ../../mk/spksrc.tc.mk qoriq_post_fix_target: @cd $(WORK_DIR)/$(TC_TARGET)/bin ; \ for gnutool in $$(ls -1); do \ - [ ! -h "powerpc-linux-gnuspe-$${gnutool##*-}" ] && ln -s $${gnutool} "powerpc-linux-gnuspe-$${gnutool##*-}" ; \ - [ ! -h "powerpc-unknown-linux-gnuspe-$${gnutool##*-}" ] && ln -s $${gnutool} "powerpc-unknown-linux-gnuspe-$${gnutool##*-}" ; \ + [ ! -L "powerpc-linux-gnuspe-$${gnutool##*-}" ] && ln -sf $${gnutool} "powerpc-linux-gnuspe-$${gnutool##*-}" ; \ + [ ! -L "powerpc-unknown-linux-gnuspe-$${gnutool##*-}" ] && ln -sf $${gnutool} "powerpc-unknown-linux-gnuspe-$${gnutool##*-}" ; \ done From ba0114cf14fbcb04fbb3f1261ab00962314959fb Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sun, 4 Feb 2024 21:36:38 +0000 Subject: [PATCH 55/58] rust: Enable RUST_BUILD_TOOLCHAIN=1 to test rebuild still works --- mk/spksrc.cross-rust-env.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index 9a3a1a138fd..9b8b1ecc34c 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -38,7 +38,7 @@ ifeq ($(findstring $(RUST_ARCH), $(ARMv8_ARCHS)),$(RUST_ARCH)) RUST_TARGET = aarch64-unknown-linux-gnu endif ifeq ($(findstring $(RUST_ARCH), $(PPC_ARCHS)),$(RUST_ARCH)) -RUST_BUILD_TOOLCHAIN = 0 +RUST_BUILD_TOOLCHAIN = 1 RUST_TARGET = powerpc-unknown-linux-gnuspe TC_RUSTUP_TOOLCHAIN = stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE)-$(RUST_TARGET) endif From 9f4dcb82d84934ffea9b267cc860d450e54c9509 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sun, 4 Feb 2024 21:57:05 +0000 Subject: [PATCH 56/58] python311: Fix typo relatively to failure on old ppc only --- spk/python311/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spk/python311/Makefile b/spk/python311/Makefile index 95fb05a3708..f798fc7989b 100644 --- a/spk/python311/Makefile +++ b/spk/python311/Makefile @@ -104,7 +104,7 @@ include ../../mk/spksrc.common.mk # Force compiler LTO optimizations except: # - when testing all wheels # - when including debug_info symbols -# - when using PPC arch (fails on qoriq) +# - when using OLD_PPC_ARCHS arch ifneq ($(strip $(WHEELS_TEST_ALL)),1) ifneq ($(strip $(GCC_DEBUG_INFO)),1) ifneq ($(findstring $(ARCH),$(OLD_PPC_ARCHS)),$(ARCH)) From ab26d53310d5fdcd27e18b6a0f72b0878fb74e84 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Mon, 5 Feb 2024 11:45:36 +0000 Subject: [PATCH 57/58] tc-rust.mk: Removing left-over exit 2 for debugging purpose --- mk/spksrc.tc-rust.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index a4b348eec42..bb47ed3860f 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -116,7 +116,6 @@ else @$(MSG) "Build rust target $(RUST_TARGET) from sources" @$(MSG) "Enforce usage of CMake 3.20.0 or higher" @$(MAKE) -C ../../native/cmake - exit 2 @$(MSG) "Building Tier-3 rust target: $(RUST_TARGET)" @(cd $(WORK_DIR) && [ ! -d rust ] && git clone --depth 1 https://github.com/rust-lang/rust.git || true) @(cd $(WORK_DIR)/rust && rm -f config.toml && ./x setup compiler) From 9ea4b3a98edaae81d27061ee8d1ea20c1a2db0d6 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Mon, 5 Feb 2024 21:33:24 +0000 Subject: [PATCH 58/58] rust-qoriq: Disable toolchain testing building in favor of native --- mk/spksrc.cross-rust-env.mk | 2 +- mk/spksrc.tc-rust.mk | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mk/spksrc.cross-rust-env.mk b/mk/spksrc.cross-rust-env.mk index 9b8b1ecc34c..9a3a1a138fd 100644 --- a/mk/spksrc.cross-rust-env.mk +++ b/mk/spksrc.cross-rust-env.mk @@ -38,7 +38,7 @@ ifeq ($(findstring $(RUST_ARCH), $(ARMv8_ARCHS)),$(RUST_ARCH)) RUST_TARGET = aarch64-unknown-linux-gnu endif ifeq ($(findstring $(RUST_ARCH), $(PPC_ARCHS)),$(RUST_ARCH)) -RUST_BUILD_TOOLCHAIN = 1 +RUST_BUILD_TOOLCHAIN = 0 RUST_TARGET = powerpc-unknown-linux-gnuspe TC_RUSTUP_TOOLCHAIN = stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE)-$(RUST_TARGET) endif diff --git a/mk/spksrc.tc-rust.mk b/mk/spksrc.tc-rust.mk index bb47ed3860f..df6ba910779 100644 --- a/mk/spksrc.tc-rust.mk +++ b/mk/spksrc.tc-rust.mk @@ -109,10 +109,7 @@ ifeq ($(TC_RUSTUP_TOOLCHAIN),$(RUSTUP_DEFAULT_TOOLCHAIN)) rustup show else @$(MSG) "Target $(RUST_TARGET) unavailable..." -ifeq ($(RUST_BUILD_TOOLCHAIN),0) - @$(MSG) "Install rust target $(RUST_TARGET) from native" - @$(MAKE) -C ../../native/rust-qoriq -else +ifeq ($(RUST_BUILD_TOOLCHAIN),1) @$(MSG) "Build rust target $(RUST_TARGET) from sources" @$(MSG) "Enforce usage of CMake 3.20.0 or higher" @$(MAKE) -C ../../native/cmake @@ -130,6 +127,9 @@ else done @$(MSG) "Building Tier 3 rust target: $(RUST_TARGET) - stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE) complete" rustup show +else + @$(MSG) "Install rust target $(RUST_TARGET) from native" + @$(MAKE) -C ../../native/rust-qoriq endif endif