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

[stdlib] Unable to compile for riscv64-unknown-linux-gnu #78349

Open
colemancda opened this issue Dec 23, 2024 · 3 comments
Open

[stdlib] Unable to compile for riscv64-unknown-linux-gnu #78349

colemancda opened this issue Dec 23, 2024 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. cross-compilation Area → utils: Cross-compilation of project sources riscv Architecture: RISC-V

Comments

@colemancda
Copy link
Contributor

Description

The Swift Std library fails to compile for RISCV64, with the error /workspaces/buildroot/output/build/swift-6.0.3/include/swift/ABI/Metadata.h:85:50: error: 'swift_context' parameter can only be used with swiftcall or swiftasynccall calling convention

Reproduction

Compile the Swift Std Library for riscv64-unknown-linux-gnu. I have Buildroot scripts setup to cross compile, but it should be reproducible building on host as well.

Expected behavior

The Swift Std library should compile for RISCV64

Environment

Swift version 6.0.3 (swift-6.0.3-RELEASE)
Target: x86_64-unknown-linux-gnu

Additional information

swift-6.0.3-riscv64-compile.log

@colemancda colemancda added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Dec 23, 2024
@finagolfin finagolfin added cross-compilation Area → utils: Cross-compilation of project sources riscv Architecture: RISC-V and removed triage needed This issue needs more specific labels labels Dec 24, 2024
@finagolfin
Copy link
Member

@futurejones, are you seeing this too?

@colemancda
Copy link
Contributor Author

This patch applied to LLVM seems to resolve that specific error
0001-clang-Added-Swift-support-for-RISCV64.patch

@colemancda
Copy link
Contributor Author

Now I am getting another error with those patches applied.

cannot guarantee tail call due to mismatched parameter counts
  musttail call swiftcc void @"$ss23withCheckedContinuation9isolation8function_xScA_pSgYi_SSyScCyxs5NeverOGXEtYalF.1"(ptr @"$ss23withCheckedContinuation9isolation8function_xScA_pSgYi_SSyScCyxs5NeverOGXEtYalFTY0_", i64 %39, i64 %40, ptr %1)
<unknown>:0: error: fatal error encountered during compilation; please submit a bug report (https://swift.org/contributing/#reporting-bugs)
<unknown>:0: note: Broken function

riscv64-tail-call-crash.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. cross-compilation Area → utils: Cross-compilation of project sources riscv Architecture: RISC-V
Projects
None yet
Development

No branches or pull requests

2 participants