Open SheldonHH opened 1 year ago
The relevant warning from your log appears to be:
warning: c2rust: Encountered unsupported generic selection expression
Which is caused by the definition of the page_folio
macro in the kernel, which uses _Generic
. This is tracked by issue #760.
Thank you. I am curious as to how the conversion of the Linux Kernel Module to C2Rust was successful back in 2020. https://immunant.com/blog/2020/06/kernel_modules/
What versions of C2Rust, Clang, GCC, and the Linux kernel were used in this process? the article is a bit vague about the specific versions of tools.
I'd like to replicate the same successful transpilation, and use C2Rust to translate more simple Linux Kernel Modules to improve on C2Rust.
Thank you. I am curious as to how the conversion of the Linux Kernel Module to C2Rust was successful back in 2020. https://immunant.com/blog/2020/06/kernel_modules/
What versions of C2Rust, Clang, GCC, and the Linux kernel were used in this process? the article is a bit vague about the specific versions of tools.
I'd like to replicate the same successful transpilation, and use C2Rust to translate more simple Linux Kernel Modules to improve on C2Rust.
I am currently having the same issue, following the same tutorial. I wonder what these steps were:
"After making some fixes and additions to C2Rust and fix the subsequent compilation errors, we compiled the resulting Rust code with:"
It seems that in the tutorial the author was able to fix these. Did you find any solution to the problem?
Hi @brechtvandesijpe, the issue is missing support for _Generic
types as mentioned here https://github.com/immunant/c2rust/issues/982#issuecomment-1630869003
@ahomescu do you remember how/whether we worked around this issue?
I don't remember anything about _Generic
. Keep in mind this was 4 years ago, so it's very likely that the kernel code has also changed significantly. I didn't document the exact versions of Linux or clang that we used, but the blog post mentions 5.0.
The relevant warning from your log appears to be:
warning: c2rust: Encountered unsupported generic selection expression
Which is caused by the definition of the
page_folio
macro in the kernel, which uses_Generic
. This is tracked by issue #760.
It looks like page_folio
was introduced in Linux 5.16, so any kernel before that should be good (unless there are other uses of _Generic
).
by following the guide from https://immunant.com/blog/2020/06/kernel_modules/ from @Immunant
C2Rust with errors
complete error.txt
total 57 headers files in the warning message
result: