Miguel Ojeda
dc01dfb37b
rust: rust_is_available: warn for bindgen < 0.72.1 && libclang >= 22
Starting with LLVM 22, `clang_getTypeDeclaration()` may return a forward
declaration instead of the type definition. This made `bindgen` generate
opaque types [1][2], which in turn made us fail with e.g.
error[E0609]: no field `__bindgen_anon_1` on type `bindings::kernel_param`
--> rust/kernel/module_param.rs:78:46
|
78 | let container = unsafe { &*((*param).__bindgen_anon_1.arg.cast::<SetOnce<T>>()) };
| ^^^^^^^^^^^^^^^^ unknown field
|
= note: available field is: `_address`
This was fixed in `bindgen` 0.72.1 [3].
In order to clarify what is going on and avoid confusion [4][5], add
a warning to `rust_is_available.sh` about it when the versions match,
similar to past warnings like the one removed in:
commit ae64324ad5 ("rust: rust_is_available: remove warning for `bindgen` < 0.69.5 && libclang >= 19.1")
In addition, even if the versions match, check if the issue appears to
not reproduce with the given binaries, to avoid a warning in such a case.
Finally, include tests.
[ Nathan, in parallel, updated the instructions of the LLVM+Rust
kernel.org toolchains [6] so that `--version` is not passed to
`cargo` for `bindgen`, and thus the latest `bindgen` is installed
by default, which should help to avoid some of these situations.
Thanks!
- Miguel ]
Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs).
Link: https://github.com/rust-lang/rust-bindgen/issues/3264 [1]
Link: https://github.com/Rust-for-Linux/linux/issues/353 [2] # "Missing fields in nested class with LLVM 22."
Link: https://github.com/rust-lang/rust-bindgen/pull/3278 [3]
Reported-by: Burak Emir <burak.emir@gmail.com>
Link: https://github.com/Rust-for-Linux/linux/issues/1247 [4]
Link: https://lore.kernel.org/rust-for-linux/CABwQupNfMAJOGqRM9ke6tj4f53dCCsBDKU7Vp+zf8mwk7bqt8Q@mail.gmail.com/ [5]
Link: https://mirrors.edge.kernel.org/pub/tools/llvm/rust/ [6]
Tested-by: Burak Emir <burak.emir@gmail.com>
Link: https://patch.msgid.link/20260719120514.159914-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2026-08-03 14:08:42 +02:00
..
2026-01-09 19:01:42 +08:00
2025-03-15 21:22:52 +09:00
2025-05-08 09:42:06 -07:00
2026-06-16 16:33:57 +05:30
2026-03-20 10:52:52 -07:00
2026-03-23 17:50:59 -07:00
2026-06-10 13:37:06 -05:00
2026-01-29 17:12:13 -07:00
2026-05-14 09:24:32 -07:00
2026-06-15 13:48:52 +05:30
2025-12-22 16:35:54 +00:00
2026-02-26 11:53:05 -07:00
2024-10-07 02:12:27 +09:00
2024-11-19 13:57:03 -08:00
2026-06-25 09:06:12 -07:00
2026-05-04 21:16:06 -07:00
2026-06-25 09:06:12 -07:00
2026-07-29 16:21:42 -07:00
2026-05-22 13:14:41 +02:00
2025-08-18 10:45:43 -06:00
2025-03-20 07:02:21 -04:00
2025-10-29 08:46:05 -04:00
2023-01-26 12:41:38 +09:00
2023-04-21 08:58:00 -07:00
2026-05-28 21:24:48 -07:00
2025-10-04 09:05:23 -07:00
2024-07-16 01:08:37 +09:00
2026-02-13 14:23:06 -05:00
2023-04-24 10:18:32 -07:00
2026-01-14 14:13:41 +01:00
2023-03-16 22:46:12 +09:00
2025-07-23 11:57:05 +02:00
2026-03-20 21:43:56 +01:00
2026-01-18 10:32:03 +01:00
2023-01-26 12:43:33 +09:00
2026-06-21 13:20:19 -07:00
2023-12-29 12:22:28 -08:00
2026-04-05 09:21:31 +02:00
2026-02-21 17:22:30 +01:00
2025-03-15 21:22:42 +09:00
2025-06-17 10:44:07 +02:00
2026-01-22 15:30:48 -07:00
2026-03-08 11:06:53 +01:00
2026-03-27 21:19:45 -07:00
2026-03-27 21:19:48 -07:00
2024-11-27 09:38:27 +09:00
2023-01-26 12:43:33 +09:00
2025-10-24 16:43:14 -04:00
2025-10-24 16:43:14 -04:00
2025-03-16 22:30:46 -07:00
2025-08-28 15:25:48 -07:00
2025-10-14 14:45:20 -07:00
2024-12-11 20:13:00 -08:00
2026-01-21 12:36:32 -08:00
2025-03-10 09:29:08 -07:00
2025-03-15 21:22:52 +09:00
2026-06-09 04:13:23 +02:00
2026-06-16 05:08:13 +05:30
2026-05-28 21:24:42 -07:00
2024-09-01 17:59:01 -07:00
2025-04-25 15:54:24 +02:00
2023-12-29 22:25:20 +09:00
2024-12-10 12:04:19 +00:00
2026-01-30 16:46:17 +01:00
2024-07-20 13:34:54 +09:00
2025-03-07 19:58:05 -08:00
2026-06-10 13:37:05 -05:00
2026-01-22 15:58:22 -07:00
2024-11-27 09:38:27 +09:00
2026-02-03 15:29:17 -07:00
2026-01-20 15:57:06 -07:00
2024-07-15 03:13:32 +09:00
2024-02-29 13:38:03 -08:00
2026-02-11 13:40:35 -08:00
2024-09-01 20:43:28 -07:00
2026-02-13 14:24:01 -05:00
2026-03-24 21:42:37 +00:00
2024-07-18 10:01:55 -07:00
2026-06-04 09:26:57 +02:00
2026-03-26 13:53:57 -07:00
2026-06-09 04:13:23 +02:00
2025-03-04 09:40:13 -08:00
2024-11-28 08:10:23 +09:00
2026-05-26 09:44:54 +02:00
2026-01-05 16:43:33 +01:00
2024-04-02 17:41:22 +02:00
2025-01-10 23:01:21 +09:00
2024-06-26 00:18:57 +09:00
2026-02-03 20:58:12 -06:00
2025-07-21 21:40:57 -07:00
2024-11-28 08:11:55 +09:00
2026-05-27 01:54:22 +02:00
2025-06-02 16:00:26 -07:00
2025-07-29 17:17:46 -07:00
2026-06-15 14:31:58 +05:30
2026-04-29 18:03:49 -07:00
2025-11-08 12:17:58 +01:00
2025-01-11 02:36:32 +09:00
2026-03-30 07:38:26 +02:00
2024-11-27 09:38:27 +09:00
2026-05-29 13:44:29 -07:00
2025-05-29 08:10:01 -07:00
2023-11-01 23:26:01 +09:00
2026-04-02 17:50:40 +02:00
2026-02-10 11:26:21 -08:00
2026-06-02 18:41:50 -07:00
2025-11-21 10:04:10 +01:00
2026-05-27 15:20:05 -07:00
2026-06-16 05:08:13 +05:30
2025-08-26 12:00:17 -07:00
2025-09-24 09:10:45 -07:00
2024-09-07 17:24:08 +09:00
2026-04-17 15:46:46 +02:00
2022-12-14 15:42:40 +09:00
2024-12-03 08:22:25 -08:00
2023-04-14 16:08:28 +02:00
2023-06-16 17:17:42 +02:00
2023-12-03 18:51:48 +09:00
2025-07-22 20:15:56 -04:00
2023-04-19 07:46:31 -07:00
2024-10-03 16:07:51 -04:00
2026-08-03 14:08:42 +02:00
2026-08-03 14:08:42 +02:00
2026-08-03 14:08:42 +02:00
2024-10-28 00:27:16 +01:00
2024-09-05 22:44:18 +02:00
2026-06-19 09:39:50 +02:00
2026-02-10 11:53:01 -08:00
2024-11-28 08:11:56 +09:00
2025-03-15 21:19:44 +09:00
2026-03-24 21:42:37 +00:00
2026-06-25 13:15:03 -06:00
2026-01-11 06:09:11 -10:00
2026-06-17 15:37:47 -07:00
2024-09-20 19:49:52 +03:00
2024-09-10 13:56:37 +09:00
2026-01-22 11:11:17 +01:00
2024-06-28 15:23:38 +02:00
2026-01-05 16:43:37 +01:00
2026-05-06 08:33:07 +02:00
2023-04-17 11:23:06 +09:00
2026-01-23 13:34:45 -05:00
2024-04-23 00:09:41 +09:00
2026-04-29 15:53:19 -07:00
2026-03-30 10:36:11 -06:00
2024-09-20 09:21:52 +09:00
2024-09-01 20:43:27 -07:00