Skip to content

Conversation

@tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Oct 24, 2025

To support loading dependencies with target modifiers and avoid ABI mismatch errors.

Fixes #146465.

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 24, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 24, 2025

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Oct 24, 2025
@jieyouxu
Copy link
Member

r? rustdoc

@rustbot rustbot assigned GuillaumeGomez and unassigned jieyouxu Oct 24, 2025
@tmiasko tmiasko force-pushed the doctest-target-modifiers branch from 6d2dee6 to 8c7ead4 Compare October 24, 2025 15:57
@tmiasko tmiasko added the F-target_modifiers `#![feature(target_modifiers)]` label Oct 26, 2025
ojeda added a commit to ojeda/linux that referenced this pull request Nov 2, 2025
The `rustdoc` modifiers bug [1] was fixed in Rust 1.90.0 [2], for which
we added a workaround in commit abbf9a4 ("rust: workaround `rustdoc`
target modifiers bug").

However, `rustdoc`'s doctest generation still has a similar issue [3],
being fixed at [4], which does not affect us because we apply the
workaround to both, and now, starting with Rust 1.91.0 (released
2025-10-30), `-Zsanitizer` is a target modifier too [4], which means we
fail with:

      RUSTDOC TK rust/kernel/lib.rs
    error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `kernel`
     --> rust/kernel/lib.rs:3:1
      |
    3 | //! The `kernel` crate.
      | ^
      |
      = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
      = note: unset `-Zsanitizer` in this crate is incompatible with `-Zsanitizer=kernel-address` in dependency `core`
      = help: set `-Zsanitizer=kernel-address` in this crate or unset `-Zsanitizer` in `core`
      = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

A simple way around is to add the sanitizer to the list in the existing
workaround (especially if we had not started to pass the sanitizer
flags in the previous commit, since in that case that would not be
necessary). However, that still applies the workaround in more cases
than necessary.

Instead, only modify the doctests flags to ignore the check for
sanitizers, so that it is more local (and thus the compiler keeps checking
it for us in the normal `rustdoc` calls). Since the previous commit
already treated the `rustdoc` calls as kernel objects, this should allow
us in the future to easily remove this workaround when the time comes.

By the way, the `-Cunsafe-allow-abi-mismatch` flag overwrites previous
ones rather than appending, so it needs to be all done in the same flag.
Moreover, unknown modifiers are rejected, and thus we have to gate based
on the version too.

Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs).
Link: rust-lang/rust#144521 [1]
Link: rust-lang/rust#144523 [2]
Link: rust-lang/rust#146465 [3]
Link: rust-lang/rust#148068 [4]
Link: rust-lang/rust#138736 [5]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
ojeda added a commit to ojeda/linux that referenced this pull request Nov 2, 2025
The `rustdoc` modifiers bug [1] was fixed in Rust 1.90.0 [2], for which
we added a workaround in commit abbf9a4 ("rust: workaround `rustdoc`
target modifiers bug").

However, `rustdoc`'s doctest generation still has a similar issue [3],
being fixed at [4], which does not affect us because we apply the
workaround to both, and now, starting with Rust 1.91.0 (released
2025-10-30), `-Zsanitizer` is a target modifier too [4], which means we
fail with:

      RUSTDOC TK rust/kernel/lib.rs
    error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `kernel`
     --> rust/kernel/lib.rs:3:1
      |
    3 | //! The `kernel` crate.
      | ^
      |
      = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
      = note: unset `-Zsanitizer` in this crate is incompatible with `-Zsanitizer=kernel-address` in dependency `core`
      = help: set `-Zsanitizer=kernel-address` in this crate or unset `-Zsanitizer` in `core`
      = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

A simple way around is to add the sanitizer to the list in the existing
workaround (especially if we had not started to pass the sanitizer
flags in the previous commit, since in that case that would not be
necessary). However, that still applies the workaround in more cases
than necessary.

Instead, only modify the doctests flags to ignore the check for
sanitizers, so that it is more local (and thus the compiler keeps checking
it for us in the normal `rustdoc` calls). Since the previous commit
already treated the `rustdoc` calls as kernel objects, this should allow
us in the future to easily remove this workaround when the time comes.

By the way, the `-Cunsafe-allow-abi-mismatch` flag overwrites previous
ones rather than appending, so it needs to be all done in the same flag.
Moreover, unknown modifiers are rejected, and thus we have to gate based
on the version too.

Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs).
Link: rust-lang/rust#144521 [1]
Link: rust-lang/rust#144523 [2]
Link: rust-lang/rust#146465 [3]
Link: rust-lang/rust#148068 [4]
Link: rust-lang/rust#138736 [5]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request Nov 2, 2025
The `rustdoc` modifiers bug [1] was fixed in Rust 1.90.0 [2], for which
we added a workaround in commit abbf9a4 ("rust: workaround `rustdoc`
target modifiers bug").

However, `rustdoc`'s doctest generation still has a similar issue [3],
being fixed at [4], which does not affect us because we apply the
workaround to both, and now, starting with Rust 1.91.0 (released
2025-10-30), `-Zsanitizer` is a target modifier too [5], which means we
fail with:

      RUSTDOC TK rust/kernel/lib.rs
    error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `kernel`
     --> rust/kernel/lib.rs:3:1
      |
    3 | //! The `kernel` crate.
      | ^
      |
      = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
      = note: unset `-Zsanitizer` in this crate is incompatible with `-Zsanitizer=kernel-address` in dependency `core`
      = help: set `-Zsanitizer=kernel-address` in this crate or unset `-Zsanitizer` in `core`
      = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

A simple way around is to add the sanitizer to the list in the existing
workaround (especially if we had not started to pass the sanitizer
flags in the previous commit, since in that case that would not be
necessary). However, that still applies the workaround in more cases
than necessary.

Instead, only modify the doctests flags to ignore the check for
sanitizers, so that it is more local (and thus the compiler keeps checking
it for us in the normal `rustdoc` calls). Since the previous commit
already treated the `rustdoc` calls as kernel objects, this should allow
us in the future to easily remove this workaround when the time comes.

By the way, the `-Cunsafe-allow-abi-mismatch` flag overwrites previous
ones rather than appending, so it needs to be all done in the same flag.
Moreover, unknown modifiers are rejected, and thus we have to gate based
on the version too.

Finally, `-Zsanitizer-cfi-normalize-integers` is not affected, so it is
not needed in the workaround.

Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs).
Link: rust-lang/rust#144521 [1]
Link: rust-lang/rust#144523 [2]
Link: rust-lang/rust#146465 [3]
Link: rust-lang/rust#148068 [4]
Link: rust-lang/rust#138736 [5]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
@ojeda
Copy link
Contributor

ojeda commented Nov 2, 2025

I was adding a workaround for this in Linux and I noticed that, given something like:

RUSTC_BOOTSTRAP=1 rustc -Cpanic=abort --edition=2024 --sysroot=/dev/null --crate-type rlib -Zsanitizer=kcfi -Zsanitizer-cfi-normalize-integers --emit=metadata=libcore.rmeta --crate-name core `rustc --print sysroot`/lib/rustlib/src/rust/library/core/src/lib.rs

echo -e '#![allow(internal_features)]\n#![feature(compiler_builtins)]\n#![compiler_builtins]\n#![no_builtins]\n#![no_std]' | RUSTC_BOOTSTRAP=1 rustc -Cpanic=abort --edition=2024 --sysroot=/dev/null -L. --crate-type rlib -Zsanitizer=kcfi -Zsanitizer-cfi-normalize-integers --crate-name compiler_builtins --emit=metadata=libcompiler_builtins.rmeta -

echo -e '#![no_std]\nfn main(){}' | RUSTC_BOOTSTRAP=1 rustdoc -Cpanic=abort --edition=2024 --sysroot=/dev/null -L. --crate-type rlib -Zsanitizer=kcfi --test -

The rustdoc --test line (last one) complains only about -Zsanitizer=kcfi but not -Zsanitizer-cfi-normalize-integers. In fact, it passes if we add a -Cunsafe-allow-abi-mismatch=sanitizer to workaround the existing bug, without needing to add ,sanitizer-cfi-normalize-integers to it.

Could we add a test that checks that with this PR we still get an error for that third line for -Zsanitizer-cfi-normalize-integers?

Thanks!

@tmiasko
Copy link
Contributor Author

tmiasko commented Nov 3, 2025

@ojeda I cannot reproduce the behavior you are describing. I consistently receive errors about ABI mismatch caused by -Zsanitizer-cfi-normalize-integers: without the fix, with the fix, without -Cunsafe-allow-abi-mismatch=sanitizer, with -Cunsafe-allow-abi-mismatch=sanitizer.

Perhaps, the minimization is incorrect and originally there was an actual mismatch in -Zsanitizer option, that is, it was missing in rustdoc execution? In that case, I can reproduce the behavior. If you think that is a bug, I would suggest reporting is separately. It seems like a moot question to me.

To support loading dependencies with target modifiers and avoid ABI
mismatch errors.
@tmiasko tmiasko force-pushed the doctest-target-modifiers branch from 8c7ead4 to accd1fe Compare November 3, 2025 10:13
@GuillaumeGomez
Copy link
Member

Looks good to me, thanks!

r=me once CI pass

@tmiasko
Copy link
Contributor Author

tmiasko commented Nov 3, 2025

@bors r=GuillaumeGomez

@bors
Copy link
Collaborator

bors commented Nov 3, 2025

📌 Commit accd1fe has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 3, 2025
@ojeda
Copy link
Contributor

ojeda commented Nov 3, 2025

@ojeda I cannot reproduce the behavior you are describing. I consistently receive errors about ABI mismatch caused by -Zsanitizer-cfi-normalize-integers: without the fix, with the fix, without -Cunsafe-allow-abi-mismatch=sanitizer, with -Cunsafe-allow-abi-mismatch=sanitizer.

Perhaps, the minimization is incorrect and originally there was an actual mismatch in -Zsanitizer option, that is, it was missing in rustdoc execution? In that case, I can reproduce the behavior. If you think that is a bug, I would suggest reporting is separately. It seems like a moot question to me.

No, the reproduction is correct, but it only happens in 1.91.0, not beta and nightly, so probably independent of this PR. If something changed that may be subtle, then having the test may still be a good idea.

From a quick look, it seemed to happen between nightly-2025-10-04 and nightly-2025-10-05, so I am guessing #147292. If that is correct, then I guess it will be rare it will break again.

bors added a commit that referenced this pull request Nov 3, 2025
Rollup of 8 pull requests

Successful merges:

 - #135099 (Add FileCheck annotations to mir-opt/copy-prop)
 - #145903 (Give correct suggestion for a typo in raw pointers)
 - #147520 (Port the remaining SIMD intrinsics to const-eval)
 - #148068 (rustdoc: Use configured target modifiers when collecting doctests)
 - #148099 (Prepare to move debugger discovery from compiletest to bootstrap)
 - #148268 (rustdoc: fix `--emit=dep-info` on scraped examples)
 - #148306 (Remove double check when decoding ExpnId to avoid races)
 - #148378 (Fix documentation for std::panic::update_hook)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c0bbebf into rust-lang:master Nov 3, 2025
11 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Nov 3, 2025
rust-timer added a commit that referenced this pull request Nov 3, 2025
Rollup merge of #148068 - tmiasko:doctest-target-modifiers, r=GuillaumeGomez

rustdoc: Use configured target modifiers when collecting doctests

To support loading dependencies with target modifiers and avoid ABI mismatch errors.

Fixes #146465.
@tmiasko tmiasko deleted the doctest-target-modifiers branch November 3, 2025 19:56
ojeda added a commit to Rust-for-Linux/linux that referenced this pull request Nov 3, 2025
The `rustdoc` modifiers bug [1] was fixed in Rust 1.90.0 [2], for which
we added a workaround in commit abbf9a4 ("rust: workaround `rustdoc`
target modifiers bug").

However, `rustdoc`'s doctest generation still has a similar issue [3],
being fixed at [4], which does not affect us because we apply the
workaround to both, and now, starting with Rust 1.91.0 (released
2025-10-30), `-Zsanitizer` is a target modifier too [5], which means we
fail with:

      RUSTDOC TK rust/kernel/lib.rs
    error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `kernel`
     --> rust/kernel/lib.rs:3:1
      |
    3 | //! The `kernel` crate.
      | ^
      |
      = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
      = note: unset `-Zsanitizer` in this crate is incompatible with `-Zsanitizer=kernel-address` in dependency `core`
      = help: set `-Zsanitizer=kernel-address` in this crate or unset `-Zsanitizer` in `core`
      = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

A simple way around is to add the sanitizer to the list in the existing
workaround (especially if we had not started to pass the sanitizer
flags in the previous commit, since in that case that would not be
necessary). However, that still applies the workaround in more cases
than necessary.

Instead, only modify the doctests flags to ignore the check for
sanitizers, so that it is more local (and thus the compiler keeps checking
it for us in the normal `rustdoc` calls). Since the previous commit
already treated the `rustdoc` calls as kernel objects, this should allow
us in the future to easily remove this workaround when the time comes.

By the way, the `-Cunsafe-allow-abi-mismatch` flag overwrites previous
ones rather than appending, so it needs to be all done in the same flag.
Moreover, unknown modifiers are rejected, and thus we have to gate based
on the version too.

Finally, `-Zsanitizer-cfi-normalize-integers` is not affected (in Rust
1.91.0), so it is not needed in the workaround for the moment.

Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs).
Link: rust-lang/rust#144521 [1]
Link: rust-lang/rust#144523 [2]
Link: rust-lang/rust#146465 [3]
Link: rust-lang/rust#148068 [4]
Link: rust-lang/rust#138736 [5]
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
Link: https://patch.msgid.link/20251102212853.1505384-2-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Nov 4, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#135099 (Add FileCheck annotations to mir-opt/copy-prop)
 - rust-lang/rust#145903 (Give correct suggestion for a typo in raw pointers)
 - rust-lang/rust#147520 (Port the remaining SIMD intrinsics to const-eval)
 - rust-lang/rust#148068 (rustdoc: Use configured target modifiers when collecting doctests)
 - rust-lang/rust#148099 (Prepare to move debugger discovery from compiletest to bootstrap)
 - rust-lang/rust#148268 (rustdoc: fix `--emit=dep-info` on scraped examples)
 - rust-lang/rust#148306 (Remove double check when decoding ExpnId to avoid races)
 - rust-lang/rust#148378 (Fix documentation for std::panic::update_hook)

r? `@ghost`
`@rustbot` modify labels: rollup
jannau pushed a commit to AsahiLinux/linux that referenced this pull request Nov 5, 2025
The `rustdoc` modifiers bug [1] was fixed in Rust 1.90.0 [2], for which
we added a workaround in commit abbf9a4 ("rust: workaround `rustdoc`
target modifiers bug").

However, `rustdoc`'s doctest generation still has a similar issue [3],
being fixed at [4], which does not affect us because we apply the
workaround to both, and now, starting with Rust 1.91.0 (released
2025-10-30), `-Zsanitizer` is a target modifier too [5], which means we
fail with:

      RUSTDOC TK rust/kernel/lib.rs
    error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `kernel`
     --> rust/kernel/lib.rs:3:1
      |
    3 | //! The `kernel` crate.
      | ^
      |
      = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
      = note: unset `-Zsanitizer` in this crate is incompatible with `-Zsanitizer=kernel-address` in dependency `core`
      = help: set `-Zsanitizer=kernel-address` in this crate or unset `-Zsanitizer` in `core`
      = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

A simple way around is to add the sanitizer to the list in the existing
workaround (especially if we had not started to pass the sanitizer
flags in the previous commit, since in that case that would not be
necessary). However, that still applies the workaround in more cases
than necessary.

Instead, only modify the doctests flags to ignore the check for
sanitizers, so that it is more local (and thus the compiler keeps checking
it for us in the normal `rustdoc` calls). Since the previous commit
already treated the `rustdoc` calls as kernel objects, this should allow
us in the future to easily remove this workaround when the time comes.

By the way, the `-Cunsafe-allow-abi-mismatch` flag overwrites previous
ones rather than appending, so it needs to be all done in the same flag.
Moreover, unknown modifiers are rejected, and thus we have to gate based
on the version too.

Finally, `-Zsanitizer-cfi-normalize-integers` is not affected (in Rust
1.91.0), so it is not needed in the workaround for the moment.

Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs).
Link: rust-lang/rust#144521 [1]
Link: rust-lang/rust#144523 [2]
Link: rust-lang/rust#146465 [3]
Link: rust-lang/rust#148068 [4]
Link: rust-lang/rust#138736 [5]
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
Link: https://patch.msgid.link/20251102212853.1505384-2-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
jannau pushed a commit to AsahiLinux/linux that referenced this pull request Nov 5, 2025
The `rustdoc` modifiers bug [1] was fixed in Rust 1.90.0 [2], for which
we added a workaround in commit abbf9a4 ("rust: workaround `rustdoc`
target modifiers bug").

However, `rustdoc`'s doctest generation still has a similar issue [3],
being fixed at [4], which does not affect us because we apply the
workaround to both, and now, starting with Rust 1.91.0 (released
2025-10-30), `-Zsanitizer` is a target modifier too [5], which means we
fail with:

      RUSTDOC TK rust/kernel/lib.rs
    error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `kernel`
     --> rust/kernel/lib.rs:3:1
      |
    3 | //! The `kernel` crate.
      | ^
      |
      = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
      = note: unset `-Zsanitizer` in this crate is incompatible with `-Zsanitizer=kernel-address` in dependency `core`
      = help: set `-Zsanitizer=kernel-address` in this crate or unset `-Zsanitizer` in `core`
      = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

A simple way around is to add the sanitizer to the list in the existing
workaround (especially if we had not started to pass the sanitizer
flags in the previous commit, since in that case that would not be
necessary). However, that still applies the workaround in more cases
than necessary.

Instead, only modify the doctests flags to ignore the check for
sanitizers, so that it is more local (and thus the compiler keeps checking
it for us in the normal `rustdoc` calls). Since the previous commit
already treated the `rustdoc` calls as kernel objects, this should allow
us in the future to easily remove this workaround when the time comes.

By the way, the `-Cunsafe-allow-abi-mismatch` flag overwrites previous
ones rather than appending, so it needs to be all done in the same flag.
Moreover, unknown modifiers are rejected, and thus we have to gate based
on the version too.

Finally, `-Zsanitizer-cfi-normalize-integers` is not affected (in Rust
1.91.0), so it is not needed in the workaround for the moment.

Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs).
Link: rust-lang/rust#144521 [1]
Link: rust-lang/rust#144523 [2]
Link: rust-lang/rust#146465 [3]
Link: rust-lang/rust#148068 [4]
Link: rust-lang/rust#138736 [5]
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
Link: https://patch.msgid.link/20251102212853.1505384-2-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
zhuyj pushed a commit to zhuyj/linux that referenced this pull request Nov 6, 2025
The `rustdoc` modifiers bug [1] was fixed in Rust 1.90.0 [2], for which
we added a workaround in commit abbf9a4 ("rust: workaround `rustdoc`
target modifiers bug").

However, `rustdoc`'s doctest generation still has a similar issue [3],
being fixed at [4], which does not affect us because we apply the
workaround to both, and now, starting with Rust 1.91.0 (released
2025-10-30), `-Zsanitizer` is a target modifier too [5], which means we
fail with:

      RUSTDOC TK rust/kernel/lib.rs
    error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `kernel`
     --> rust/kernel/lib.rs:3:1
      |
    3 | //! The `kernel` crate.
      | ^
      |
      = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
      = note: unset `-Zsanitizer` in this crate is incompatible with `-Zsanitizer=kernel-address` in dependency `core`
      = help: set `-Zsanitizer=kernel-address` in this crate or unset `-Zsanitizer` in `core`
      = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

A simple way around is to add the sanitizer to the list in the existing
workaround (especially if we had not started to pass the sanitizer
flags in the previous commit, since in that case that would not be
necessary). However, that still applies the workaround in more cases
than necessary.

Instead, only modify the doctests flags to ignore the check for
sanitizers, so that it is more local (and thus the compiler keeps checking
it for us in the normal `rustdoc` calls). Since the previous commit
already treated the `rustdoc` calls as kernel objects, this should allow
us in the future to easily remove this workaround when the time comes.

By the way, the `-Cunsafe-allow-abi-mismatch` flag overwrites previous
ones rather than appending, so it needs to be all done in the same flag.
Moreover, unknown modifiers are rejected, and thus we have to gate based
on the version too.

Finally, `-Zsanitizer-cfi-normalize-integers` is not affected (in Rust
1.91.0), so it is not needed in the workaround for the moment.

Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs).
Link: rust-lang/rust#144521 [1]
Link: rust-lang/rust#144523 [2]
Link: rust-lang/rust#146465 [3]
Link: rust-lang/rust#148068 [4]
Link: rust-lang/rust#138736 [5]
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
Link: https://patch.msgid.link/20251102212853.1505384-2-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
gendx added a commit to gendx/paralight that referenced this pull request Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs F-target_modifiers `#![feature(target_modifiers)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

error: mixing -Zsanitizer will cause an ABI mismatch - when running doctests

6 participants