Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Commit 8950ddf

Browse files
committed
Make packed+aligned types from the kernel opaque
1 parent 9ac0479 commit 8950ddf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

build.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ const INCLUDED_VARS: &[&str] = &[
3434
"KERN_INFO",
3535
"VERIFY_WRITE",
3636
];
37+
const OPAQUE_TYPES: &[&str] = &[
38+
// This needs to be opaque because it's both packed and aligned, which rustc
39+
// doesn't support yet. See https://github.com/rust-lang/rust/issues/59154
40+
// and https://github.com/rust-lang/rust-bindgen/issues/1538
41+
"xregs_state",
42+
];
3743

3844
fn main() {
3945
let mut builder = bindgen::Builder::default()
@@ -69,6 +75,9 @@ fn main() {
6975
for v in INCLUDED_VARS {
7076
builder = builder.whitelist_var(v);
7177
}
78+
for t in OPAQUE_TYPES {
79+
builder = builder.opaque_type(t);
80+
}
7281
let bindings = builder.generate().expect("Unable to generate bindings");
7382

7483
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());

0 commit comments

Comments
 (0)