Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure valid custom toolchain name for qoriq-6.2.4 (powerpc-unknown-linux-gnuspe) #6477

Merged
merged 6 commits into from
Mar 8, 2025

Conversation

mreid-tt
Copy link
Contributor

@mreid-tt mreid-tt commented Mar 8, 2025

Description

This resolves recent build failures in #6454 and #6471 when building qoriq-6.2.4 packages, which reported an "invalid custom toolchain name" after a recent Rust update. The fix applies a custom toolchain channel prefix aligned with the documented standard for toolchain files.

Follow-on from #5879.

Fixes #

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • Includes small framework changes

@mreid-tt
Copy link
Contributor Author

mreid-tt commented Mar 8, 2025

@th0ma7, this should resolve the build issue with qoriq-6.2.4. I’ve successfully built memcached on my private branch with this fix. Shall I proceed with the merge so we can rebase with the update?

@mreid-tt mreid-tt added framework build/rust-qoriq related to rust target powerpc-unknown-linux-gnuspe (instead of powerpc-unknown-linux-gnu) labels Mar 8, 2025
@mreid-tt mreid-tt removed the framework label Mar 8, 2025
@mreid-tt mreid-tt requested a review from th0ma7 March 8, 2025 06:06
@hgy59
Copy link
Contributor

hgy59 commented Mar 8, 2025

I suppose this is an upstream issue.

Instead of setting a toolchain version like stable, nightly, ... it was always supported to use a specific version like 1.82.0.
We do so for qoriq with RUST_BUILD_VERSION = 1.82.0:

ifeq ($(findstring $(RUST_ARCH), $(PPC_ARCHS)),$(RUST_ARCH))
RUST_TARGET = powerpc-unknown-linux-gnuspe
TC_RUSTUP_TOOLCHAIN = $(RUST_BUILD_VERSION)-$(RUST_TARGET)
endif

I have no idea if it has anything to do with the launch of "Rust 2024".
https://blog.rust-lang.org/2025/02/20/Rust-1.85.0.html

Rust 1.85.0 was released on 20 Feb 2025 so this issue may pop up in other use cases shortly...

@hgy59
Copy link
Contributor

hgy59 commented Mar 8, 2025

Currently this issue is not fixed.

Building diyspk/ripgrep fails for qoriq-6.2.4:

===>  Extracting for ripgrep
tar -xzpf /spksrc/cross/ripgrep/../../distrib/ripgrep-14.1.1.tar.gz -C /spksrc/diyspk/ripgrep/work-qoriq-6.2.4
===>  Patching for ripgrep
===>  Configuring for ripgrep
===>  - Configure ARGS:
===>  - Install prefix: /var/packages/ripgrep/target
===>  Compiling for ripgrep
===>  Installing for ripgrep
find /spksrc/diyspk/ripgrep/work-qoriq-6.2.4/install//var/packages/ripgrep/target/ \! -type d -printf '%P\n' | sed 's?^target/??g' | sort > /spksrc/diyspk/ripgrep/work-qoriq-6.2.4/ripgrep.plist.tmp
  ==> Cargo install rust package ripgrep (rustc +1.82.0-powerpc-unknown-linux-gnuspe -vV)
info: syncing channel updates for '1.82.0-powerpc-unknown-linux-gnuspe'
info: latest update on 2024-10-17, rust version 1.82.0 (f6e511eec 2024-10-15)
error: target 'powerpc-unknown-linux-gnuspe' not found in channel.  Perhaps check https://doc.rust-lang.org/nightly/rustc/platform-support.html for available targets
make[3]: *** [../../mk/spksrc.cross-rust.mk:69: rust_install_target] Error 1
make[3]: Leaving directory '/spksrc/cross/ripgrep'
make[2]: *** [../../mk/spksrc.depend.mk:54: depend_target] Error 2
make[2]: Leaving directory '/spksrc/diyspk/ripgrep'
make[1]: *** [../../mk/spksrc.supported.mk:74: build-arch-qoriq-6.2.4] Error 1
make[1]: Leaving directory '/spksrc/diyspk/ripgrep'

@hgy59
Copy link
Contributor

hgy59 commented Mar 8, 2025

@mreid-tt I have updated the custom rust version to include the stable- prefix and will shortly commit here.

hgy59 added 3 commits March 8, 2025 13:32
- add stable- prefix
- remarks: 1.82.0 is the final version that can be built with qoriq-6.2.4 toolchain
@hgy59
Copy link
Contributor

hgy59 commented Mar 8, 2025

I have recreated the custom qoriq toolchain and uploaded to https://github.com/SynoCommunity/spksrc/releases/tag/rust%2Fqoriq

Unfortunately version 1.82.0 is the latest version that can be built.
Versions >= 1.83.0 fail in the final stage with:


  cargo:warning=In file included from /spksrc/toolchain/syno-qoriq-6.2.4/work/rust/src/llvm-project/compiler-rt/lib/builtins/divdc3.c:14:0:
  cargo:warning=/spksrc/toolchain/syno-qoriq-6.2.4/work/rust/src/llvm-project/compiler-rt/lib/builtins/fp_lib.h: In function '__compiler_rt_scalbnX':
  cargo:warning=/spksrc/toolchain/syno-qoriq-6.2.4/work/rust/src/llvm-project/compiler-rt/lib/builtins/fp_lib.h:305:3: error: implicit declaration of function '__builtin_sadd_overflow' [-Werror=implicit-function-declaration]
  cargo:warning=   if (__builtin_sadd_overflow(exp, y, &exp)) {
  cargo:warning=   ^
  cargo:warning=/spksrc/toolchain/syno-qoriq-6.2.4/work/rust/src/llvm-project/compiler-rt/lib/builtins/divdc3.c: At top level:
  cargo:warning=/spksrc/toolchain/syno-qoriq-6.2.4/work/rust/src/llvm-project/compiler-rt/lib/builtins/divdc3.c:20:26: warning: conflicting types for built-in function '__divdc3'
  cargo:warning= COMPILER_RT_ABI Dcomplex __divdc3(double __a, double __b, double __c,
  cargo:warning=                          ^
  cargo:warning=cc1: some warnings being treated as errors

  --- stderr


  error occurred: Command "/spksrc/toolchain/syno-qoriq-6.2.4/work/powerpc-e500v2-linux-gnuspe/bin/powerpc-e500v2-linux-gnuspe-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-ffunction-sections" "-fdata-sections" "-fPIC" "-mcpu=8548" "-mhard-float" "-mfloat-gprs=double" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-Werror=implicit-function-declaration" "-fomit-frame-pointer" "-DCOMPILER_RT_HAS_FLOAT16" "-DVISIBILITY_HIDDEN" "-o" "/spksrc/toolchain/syno-qoriq-6.2.4/work/rust/build/x86_64-unknown-linux-gnu/stage2-std/powerpc-unknown-linux-gnuspe/release/build/compiler_builtins-a0f1bafb312c5255/out/f5903a5d5e0eaa45-divdc3.o" "-c" "/spksrc/toolchain/syno-qoriq-6.2.4/work/rust/src/llvm-project/compiler-rt/lib/builtins/divdc3.c" with args powerpc-e500v2-linux-gnuspe-gcc did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...
Build completed unsuccessfully in 0:19:38
make: *** [../../mk/spksrc.tc-rust.mk:104: rustc_target] Error 1
root@mreid_qoriq:/spksrc/toolchain/syno-qoriq-6.2.4#

@hgy59 hgy59 added the framework label Mar 8, 2025
@mreid-tt
Copy link
Contributor Author

mreid-tt commented Mar 8, 2025

@mreid-tt I have updated the custom rust version to include the stable- prefix and will shortly commit here.

Okay, I'll keep an eye on this. The last change I made before your commits allowed synocli-file to build successfully, so I trust your changes will maintain that outcome.

However, I did notice a different error in the build for 88f6281-6.2.4 as follows:

$ make arch-88f6281-6.2.4 -C ./spk/synocli-file
error: failed to compile `eza v0.20.18 (/github/workspace/spk/synocli-file/work-88f6[28](https://github.com/mreid-tt/spksrc/actions/runs/13737504706/job/38422993713#step:7:29)1-6.2.4/eza-0.20.18)`, intermediate artifacts can be found at `/github/workspace/spk/synocli-file/work-88f6281-6.2.4/eza-0.20.18/target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Caused by:
  package `litemap v0.7.5` cannot be built because it requires rustc 1.81 or newer, while the currently active rustc version is 1.77.2
  Either upgrade to rustc 1.81 or newer, or use
  cargo update litemap@0.7.5 --precise ver
  where `ver` is the latest version of `litemap` supporting rustc 1.77.2

Should we address this in the same PR, or is it a separate issue that requires a new PR?

@hgy59
Copy link
Contributor

hgy59 commented Mar 8, 2025

LGTM:
The error with ARMv5 (88f6281) is related to rust but not to this PR.

@mreid-tt mreid-tt merged commit 8a670b2 into SynoCommunity:master Mar 8, 2025
1 check passed
@mreid-tt mreid-tt deleted the framework-rust-qoriq-fix branch March 8, 2025 13:07
@th0ma7
Copy link
Contributor

th0ma7 commented Mar 8, 2025

Out of curiosity, was it even needed to rebuild the toolchain? Or was it just a naming issue?

And thnx for fixing this 🙂

@mreid-tt
Copy link
Contributor Author

mreid-tt commented Mar 8, 2025

Out of curiosity, was it even needed to rebuild the toolchain? Or was it just a naming issue?

The changes I made were primarily related to renaming. @hgy59 added a correctly named version to the repository and referenced it more elegantly, along with a few minor cleanups. However, from my perspective, the main issue was the custom toolchain naming syntax.

And thnx for fixing this 🙂

You're welcome! Happy to support your work with Python. You should be able to merge this into your branch and achieve a successful build, as I did with memcached.

@hgy59
Copy link
Contributor

hgy59 commented Mar 8, 2025

Out of curiosity, was it even needed to rebuild the toolchain? Or was it just a naming issue?

Just renaming fixed it, but since the rebuilt package was some bytes smaller I replaced the renamed with the rebuilt package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build/rust-qoriq related to rust target powerpc-unknown-linux-gnuspe (instead of powerpc-unknown-linux-gnu) framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants