Repository navigation
Conversation
thedataking
left a comment
There was a problem hiding this comment.
Thanks for catching this!
Could you add a small regression snapshot for transpiling an empty C file with --target=riscv32? Existing CI already has LLVM 17 and 18, so this should fit in tests/snapshots.rs without workflow changes. A standalone test
passing the target argument directly would be fine.
|
Unfortunately I'm not quite sure how to do that? From my understanding, this is what I would have to add to diff --git a/c2rust-transpile/tests/snapshots.rs b/c2rust-transpile/tests/snapshots.rs
index fb47993bf..482b43182 100644
--- a/c2rust-transpile/tests/snapshots.rs
+++ b/c2rust-transpile/tests/snapshots.rs
@@ -532,6 +532,12 @@ fn test_vm_x86() {
transpile("vm_x86.c").arch_specific(true).run();
}
+#[test]
+fn test_empty() {
+ #[cfg(target_arch = "riscv32")]
+ transpile("empty.h").arch_specific(true).run();
+}
+
// os-specific
#[test]But I don't understand how to generate the |
|
From what I could tell, there was no possibility to specify the I added a parameter to specify extra clang arguments, but this is waaaay out of my league. I'm not a Rust programmer 😅 |
Description
Similarly to #692 and #693, LLVM 17 introduced new vector tuple types for RISC-V that cause build issues.
Context: in RIOT OS, we are currently updating our build container that now uses Ubuntu 26.04LTS, which ships with at least LLVM 17 and there we ran into this issue.
Unrelated note: there are some code paths for LLVM<15 versions, which are not supported anymore according to the README, I guess they could be deleted?
Minimal Example
Note: I bumped the version to distinguish between the installations.
Behavior with
master:Behavior with this PR:
Less Minimal Example
To see whether or not the types are actually interpreted correctly, I created a less minimal example that defines four functions that use the tuple types.
The transpilation still fails because there is no support for the resulting vector types, but it shows that the vectors are interpreted correctly, there is just no further support for them.
This is beyond the scope of the PR though I guess.
From the error message together with the according type.