Skip to content

Commit 571a9e0

Browse files
committed
rust: build_error: export rust_build_error
Export the `rust_build_error` symbol so that kernel modules can take advantage of the `build_error!` and `build_assert!` macros. Otherwise, kernel modules would fail to compile if there is a call under `RUST_BUILD_ASSERT_{ALLOW,WARN}`. Fixes: b8b9cab ("Implement build-time error and assertion") Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent d805877 commit 571a9e0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rust/exports.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,8 @@
1919
#include "exports_alloc_generated.h"
2020
#include "exports_bindings_generated.h"
2121
#include "exports_kernel_generated.h"
22+
23+
// For modules using `rust/build_error.rs`.
24+
#ifndef CONFIG_RUST_BUILD_ASSERT_DENY
25+
EXPORT_SYMBOL_RUST_GPL(rust_build_error);
26+
#endif

0 commit comments

Comments
 (0)