Commit f2a7bfe
committed
rust: build_error: remove
There are several problems with `RUST_BUILD_ASSERT_WARN`:
- ld.lld behaves differently than ld.bfd and emits warnings even
when all calls are correct and optimized away in `DENY` mode.
This could be solved by restricting the `WARN` mode so that
it can only be used when the GNU linker is used.
- Since we need to export the `rust_build_error` for loadable
kernel modules, even ld.bfd considers that as a use.
- For loadable modules, we do not get warnings since the section
is in `build_error`, not the module.
These last two issues may be possible to solve all by creating
a symbol and section per loadable kernel module.
While all the above may be possible to solve, supporting the `WARN`
mode gets more complex and it is not worth to support. It was
introduced back when we had configurable optimization levels, but
nowadays optimizations are always enabled. Therefore, `DENY` is
probably good enough for all use cases, with `ALLOW` being
the escape hatch.
Thus remove the `WARN` support.
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>RUST_BUILD_ASSERT_WARN support1 parent 571a9e0 commit f2a7bfe
2 files changed
+0
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2820 | 2820 | | |
2821 | 2821 | | |
2822 | 2822 | | |
2823 | | - | |
2824 | | - | |
2825 | | - | |
2826 | | - | |
2827 | | - | |
2828 | | - | |
2829 | 2823 | | |
2830 | 2824 | | |
2831 | 2825 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
0 commit comments