-
Notifications
You must be signed in to change notification settings - Fork 13k
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
global_asm!
macro causes non-fatal errors to be printed during compilation for some RISC-V extension instructions when targeting the GC extensions
#80608
Comments
I can't seem to reproduce this: https://rust.godbolt.org/z/5hW8jn |
Ah, finally was able to reproduce it, looks like its not |
asm!
macro causes non-fatal errors to be printed during compilation for some RISC-V extension instructions when targeting the GC extensionsglobal_asm!
macro causes non-fatal errors to be printed during compilation for some RISC-V extension instructions when targeting the GC extensions
I saw |
I still don't know what the cause of this problem is (it seems to be in LLVM?). However I have found a workaround: you need to add |
I see the following in a release build with
|
Upstream bug: llvm/llvm-project#61991 |
https://bugs.webkit.org/show_bug.cgi?id=282900 Reviewed by NOBODY (OOPS!). This is a llvm bug, passing `-march=riscv64gc -cpu=lp64d` from clang will lost after it got llvm side. So we have to set arch here. More related infomations are here: - rust-lang/rust#80608 - llvm/llvm-project#61991 - llvm/llvm-project#97685 * Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.cpp: * Source/JavaScriptCore/llint/LowLevelInterpreter.cpp:
https://bugs.webkit.org/show_bug.cgi?id=282900 Reviewed by NOBODY (OOPS!). This is a llvm bug, passing `-march=riscv64gc -cpu=lp64d` from clang will lost after it got llvm side. So we have to set arch here. More related infomations are here: - rust-lang/rust#80608 - llvm/llvm-project#61991 - llvm/llvm-project#97685 * Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.cpp: * Source/JavaScriptCore/llint/LowLevelInterpreter.cpp:
https://bugs.webkit.org/show_bug.cgi?id=282900 Reviewed by NOBODY (OOPS!). This is a llvm bug, passing `-march=riscv64gc -cpu=lp64d` from clang will lost after it got llvm side. So we have to set arch here. More related infomations are here: - rust-lang/rust#80608 - llvm/llvm-project#61991 - llvm/llvm-project#97685 * Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.cpp: * Source/JavaScriptCore/llint/LowLevelInterpreter.cpp:
https://bugs.webkit.org/show_bug.cgi?id=282900 Reviewed by NOBODY (OOPS!). This is a llvm bug, passing `-march=riscv64gc -cpu=lp64d` from clang will lost after it got llvm side. So we have to set arch here. More related infomations are here: - rust-lang/rust#80608 - llvm/llvm-project#61991 - llvm/llvm-project#97685 * Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.cpp: * Source/JavaScriptCore/llint/LowLevelInterpreter.cpp:
https://bugs.webkit.org/show_bug.cgi?id=282900 Reviewed by Yusuke Suzuki. This is a llvm bug, passing `-march=riscv64gc -cpu=lp64d` from clang will lost after it got llvm side. So we have to set arch here. More related infomations are here: - rust-lang/rust#80608 - llvm/llvm-project#61991 - llvm/llvm-project#97685 * Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.cpp: * Source/JavaScriptCore/llint/LowLevelInterpreter.cpp: Canonical link: https://commits.webkit.org/286815@main
This is now also affecting naked functions after the codegen switch. cc @folkertdev (example: https://github.com/nbdd0121/unwinding/actions/runs/12341696455/job/34440632980) |
Well, that's unfortunate. The LLVM changes don't have any action since August, are there any strings we can pull to give that some extra attention? |
…gi?id=282900 [RISCV] Fix instruction requires the following: 'D'/'F'/'M' https://bugs.webkit.org/show_bug.cgi?id=282900 Reviewed by Yusuke Suzuki. This is a llvm bug, passing `-march=riscv64gc -cpu=lp64d` from clang will lost after it got llvm side. So we have to set arch here. More related infomations are here: - rust-lang/rust#80608 - llvm/llvm-project#61991 - llvm/llvm-project#97685 * Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.cpp: * Source/JavaScriptCore/llint/LowLevelInterpreter.cpp: Canonical link: https://commits.webkit.org/286815@main Canonical link: https://commits.webkit.org/282416.360@webkitglib/2.46
Here's a minimal reproduction: #![feature(naked_functions)]
#[naked]
pub extern "C-unwind" fn example() {
#[cfg(target_feature = "d")]
unsafe {
core::arch::naked_asm!("fsd fs0, 0x140(sp)");
}
} Compile with |
https://bugs.webkit.org/show_bug.cgi?id=282900 Reviewed by Yusuke Suzuki. This is a llvm bug, passing `-march=riscv64gc -cpu=lp64d` from clang will lost after it got llvm side. So we have to set arch here. More related infomations are here: - rust-lang/rust#80608 - llvm/llvm-project#61991 - llvm/llvm-project#97685 * Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.cpp: * Source/JavaScriptCore/llint/LowLevelInterpreter.cpp: Canonical link: https://commits.webkit.org/286815@main
Since 2024-12-12 the Rust compiler now requires all naked ASM functions to include `.cfi_startproc` and `.cfi_endproc`. Without these directives, the build will fail. Add these directives to all supported platforms. This also works around rust-lang/rust#80608 by forcing LLVM to consider that code with the "d" extension has an FPU. Signed-off-by: Sean Cross <sean@xobs.io>
With rust-lang#80608 the `unwinding` crate no longer builds. The upstream crate has been updated to build by manually adding directives to the naked_asm stream. Bump the dependency in Rust to get this newer version. This fixes the build for Xous, and closes rust-lang#134403. Signed-off-by: Sean Cross <sean@xobs.io>
…5.0, r=Mark-Simulacrum unwinding: bump version to fix naked_asm on Xous With rust-lang#80608 the `unwinding` crate no longer builds. The upstream crate has been updated to build by manually adding directives to the naked_asm stream. Bump the dependency in Rust to get this newer version. This fixes the build for Xous, and closes rust-lang#134403.
Rollup merge of rust-lang#134789 - betrusted-io:bump-unwinding-to-0.25.0, r=Mark-Simulacrum unwinding: bump version to fix naked_asm on Xous With rust-lang#80608 the `unwinding` crate no longer builds. The upstream crate has been updated to build by manually adding directives to the naked_asm stream. Bump the dependency in Rust to get this newer version. This fixes the build for Xous, and closes rust-lang#134403.
With rust-lang#80608 the `unwinding` crate no longer builds. The upstream crate has been updated to build by manually adding directives to the naked_asm stream. Bump the dependency in Rust to get this newer version. This fixes the build for Xous, and closes rust-lang#134403. Signed-off-by: Sean Cross <sean@xobs.io>
…5.0, r=Mark-Simulacrum unwinding: bump version to fix naked_asm on Xous With rust-lang#80608 the `unwinding` crate no longer builds. The upstream crate has been updated to build by manually adding directives to the naked_asm stream. Bump the dependency in Rust to get this newer version. This fixes the build for Xous, and closes rust-lang#134403.
* Update to the latest nightly Rust. Update to origin 0.24 and the latest nightly Rust. * Fix setjmp on riscv64 with soft-float. * Add a workaround for rust-lang/rust#80608 for riscv64.
I'm currently using the
asm!
macro on theriscv64gc-unknown-none-elf
target, and have been getting some "errors" for a while about instructions requiring extensions -- except that GC includes the extensions of the instructions I'm using (IMAFDC). So far I've seen errors for F, D, and A instructions, everything else seems to be fine that I've used so far. Despite them being reported as errors, the build still succeeds however. @nbdd0121 suggested this may be an LLVM bug.Example:
The text was updated successfully, but these errors were encountered: