forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 450
GCC support #167
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
Labels
• misc
Related to other topics (e.g. CI).
Comments
fengguang
pushed a commit
to 0day-ci/linux
that referenced
this issue
Apr 14, 2021
To support Rust under GCC-built kernels, we need to save the flags that would have been passed if the kernel was being compiled with Clang. The reason is that bindgen -- the tool we use to generate Rust bindings to the C side of the kernel -- relies on libclang to parse C. Ideally: - bindgen would support a GCC backend (requested at [1]), - or the Clang driver would be perfectly compatible with GCC, including plugins. Unlikely, of course, but perhaps a big subset of configs may be possible to guarantee to be kept compatible nevertheless. This is also the reason why GCC builds are very experimental and some configurations may not work (e.g. GCC_PLUGIN_RANDSTRUCT). However, we keep GCC builds working (for some example configs) in the CI to avoid diverging/regressing further, so that we are better prepared for the future when a solution might become available. [1] rust-lang/rust-bindgen#1949 Link: Rust-for-Linux#167 Co-developed-by: Alex Gaynor <[email protected]> Signed-off-by: Alex Gaynor <[email protected]> Co-developed-by: Geoffrey Thomas <[email protected]> Signed-off-by: Geoffrey Thomas <[email protected]> Co-developed-by: Finn Behrens <[email protected]> Signed-off-by: Finn Behrens <[email protected]> Co-developed-by: Adam Bratschi-Kaye <[email protected]> Signed-off-by: Adam Bratschi-Kaye <[email protected]> Co-developed-by: Wedson Almeida Filho <[email protected]> Signed-off-by: Wedson Almeida Filho <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
ojeda
added a commit
to ojeda/linux
that referenced
this issue
Jul 4, 2021
To support Rust under GCC-built kernels, we need to save the flags that would have been passed if the kernel was being compiled with Clang. The reason is that `bindgen` -- the tool we use to generate Rust bindings to the C side of the kernel -- relies on `libclang` to parse C. Ideally: - `bindgen` would support a GCC backend (requested at [1]), - or the Clang driver would be perfectly compatible with GCC, including plugins. Unlikely, of course, but perhaps a big subset of configs may be possible to guarantee to be kept compatible nevertheless. This is also the reason why GCC builds are very experimental and some configurations may not work (e.g. `GCC_PLUGIN_RANDSTRUCT`). However, we keep GCC builds working (for some example configs) in the CI to avoid diverging/regressing further, so that we are better prepared for the future when a solution might become available. [1] rust-lang/rust-bindgen#1949 Link: Rust-for-Linux#167 Co-developed-by: Alex Gaynor <[email protected]> Signed-off-by: Alex Gaynor <[email protected]> Co-developed-by: Geoffrey Thomas <[email protected]> Signed-off-by: Geoffrey Thomas <[email protected]> Co-developed-by: Finn Behrens <[email protected]> Signed-off-by: Finn Behrens <[email protected]> Co-developed-by: Adam Bratschi-Kaye <[email protected]> Signed-off-by: Adam Bratschi-Kaye <[email protected]> Co-developed-by: Wedson Almeida Filho <[email protected]> Signed-off-by: Wedson Almeida Filho <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
ojeda
added a commit
to ojeda/linux
that referenced
this issue
Jul 4, 2021
To support Rust under GCC-built kernels, we need to save the flags that would have been passed if the kernel was being compiled with Clang. The reason is that `bindgen` -- the tool we use to generate Rust bindings to the C side of the kernel -- relies on `libclang` to parse C. Ideally: - `bindgen` would support a GCC backend (requested at [1]), - or the Clang driver would be perfectly compatible with GCC, including plugins. Unlikely, of course, but perhaps a big subset of configs may be possible to guarantee to be kept compatible nevertheless. This is also the reason why GCC builds are very experimental and some configurations may not work (e.g. `GCC_PLUGIN_RANDSTRUCT`). However, we keep GCC builds working (for some example configs) in the CI to avoid diverging/regressing further, so that we are better prepared for the future when a solution might become available. [1] rust-lang/rust-bindgen#1949 Link: Rust-for-Linux#167 Co-developed-by: Alex Gaynor <[email protected]> Signed-off-by: Alex Gaynor <[email protected]> Co-developed-by: Geoffrey Thomas <[email protected]> Signed-off-by: Geoffrey Thomas <[email protected]> Co-developed-by: Finn Behrens <[email protected]> Signed-off-by: Finn Behrens <[email protected]> Co-developed-by: Adam Bratschi-Kaye <[email protected]> Signed-off-by: Adam Bratschi-Kaye <[email protected]> Co-developed-by: Wedson Almeida Filho <[email protected]> Signed-off-by: Wedson Almeida Filho <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
fengguang
pushed a commit
to 0day-ci/linux
that referenced
this issue
Jul 4, 2021
To support Rust under GCC-built kernels, we need to save the flags that would have been passed if the kernel was being compiled with Clang. The reason is that `bindgen` -- the tool we use to generate Rust bindings to the C side of the kernel -- relies on `libclang` to parse C. Ideally: - `bindgen` would support a GCC backend (requested at [1]), - or the Clang driver would be perfectly compatible with GCC, including plugins. Unlikely, of course, but perhaps a big subset of configs may be possible to guarantee to be kept compatible nevertheless. This is also the reason why GCC builds are very experimental and some configurations may not work (e.g. `GCC_PLUGIN_RANDSTRUCT`). However, we keep GCC builds working (for some example configs) in the CI to avoid diverging/regressing further, so that we are better prepared for the future when a solution might become available. [1] rust-lang/rust-bindgen#1949 Link: Rust-for-Linux#167 Co-developed-by: Alex Gaynor <[email protected]> Signed-off-by: Alex Gaynor <[email protected]> Co-developed-by: Geoffrey Thomas <[email protected]> Signed-off-by: Geoffrey Thomas <[email protected]> Co-developed-by: Finn Behrens <[email protected]> Signed-off-by: Finn Behrens <[email protected]> Co-developed-by: Adam Bratschi-Kaye <[email protected]> Signed-off-by: Adam Bratschi-Kaye <[email protected]> Co-developed-by: Wedson Almeida Filho <[email protected]> Signed-off-by: Wedson Almeida Filho <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
BuptOs
pushed a commit
to BUPT-OS/RROS
that referenced
this issue
Dec 5, 2023
To support Rust under GCC-built kernels, we need to save the flags that would have been passed if the kernel was being compiled with Clang. The reason is that `bindgen` -- the tool we use to generate Rust bindings to the C side of the kernel -- relies on `libclang` to parse C. Ideally: - `bindgen` would support a GCC backend (requested at [1]), - or the Clang driver would be perfectly compatible with GCC, including plugins. Unlikely, of course, but perhaps a big subset of configs may be possible to guarantee to be kept compatible nevertheless. This is also the reason why GCC builds are very experimental and some configurations may not work (e.g. `GCC_PLUGIN_RANDSTRUCT`). However, we keep GCC builds working (for some example configs) in the CI to avoid diverging/regressing further, so that we are better prepared for the future when a solution might become available. [1] rust-lang/rust-bindgen#1949 Link: Rust-for-Linux/linux#167 Co-developed-by: Alex Gaynor <[email protected]> Signed-off-by: Alex Gaynor <[email protected]> Co-developed-by: Geoffrey Thomas <[email protected]> Signed-off-by: Geoffrey Thomas <[email protected]> Co-developed-by: Finn Behrens <[email protected]> Signed-off-by: Finn Behrens <[email protected]> Co-developed-by: Adam Bratschi-Kaye <[email protected]> Signed-off-by: Adam Bratschi-Kaye <[email protected]> Co-developed-by: Wedson Almeida Filho <[email protected]> Signed-off-by: Wedson Almeida Filho <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
bindgen
-- the tool we use to generate Rust bindings to the C side of the kernel -- relies onlibclang
to parse C. Ideally:bindgen
would support a GCC backend (requested at Support for a GCC-based backend rust-lang/rust-bindgen#1949),or the Clang driver would be perfectly compatible with GCC, including plugins. Unlikely, of course, but perhaps a big subset of configs may be possible to guarantee to be kept compatible nevertheless.
This is the reason why GCC builds are very experimental and some configurations may not work (e.g.
GCC_PLUGIN_RANDSTRUCT
). However, we keep GCC builds working (for some example configs) in the CI to avoid diverging/regressing further, so that we are better prepared for the future when a solution might become available.This issue is meant to keep track of any developments, news, etc. related to GCC support.
The text was updated successfully, but these errors were encountered: