Skip to contentSkip to conversation

ABI mismatch build error for 6.17.y and rustc 1.91.0

DISCUSSION Greg KH 3 participants 8 messages Nov 4, 2025 – Nov 9, 2025 Rust

lore
Share & tools
lore

Greg KH

author
#0 lore raw

My laptop just upgraded rustc to 1.91.0 and now I get the following build error in 6.17.y when doing a 'allmodconfig' build:

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

I don't see that on Linus's branch, but maybe I don't have the same build options enabled there. Is 6.17.y missing a patch that is in 6.18-rc to resolve this that I just can't seem to find?

thanks,

greg k-h

#1 lore raw
Quoted 15 lines · Greg KH

My laptop just upgraded rustc to 1.91.0 and now I get the following build error in 6.17.y when doing a 'allmodconfig' build:

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

Quoted 3 lines

I don't see that on Linus's branch, but maybe I don't have the same build options enabled there. Is 6.17.y missing a patch that is in 6.18-rc to resolve this that I just can't seem to find?

This one

https://github.com/Rust-for-Linux/linux/commit/16c43a56b79e2c3220b043236369a129d508c65a

https://lore.kernel.org/rust-for-linux/CANiq72=0JJz5XDHGpiyQBd9AmPCr4veJ=2oJywyyqQB8iMxqvA@mail.gmail.com/

?

Dirk

author
#2 lore raw
Quoted 16 lines · Dirk Behme
Quoted 15 lines · Greg KH

My laptop just upgraded rustc to 1.91.0 and now I get the following build error in 6.17.y when doing a 'allmodconfig' build:

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

Quoted 7 lines
Quoted 3 lines

I don't see that on Linus's branch, but maybe I don't have the same build options enabled there. Is 6.17.y missing a patch that is in 6.18-rc to resolve this that I just can't seem to find?

This one

https://github.com/Rust-for-Linux/linux/commit/16c43a56b79e2c3220b043236369a129d508c65a

That is not a valid git id in linux-next :(

Quoted 1 line

https://lore.kernel.org/rust-for-linux/CANiq72=0JJz5XDHGpiyQBd9AmPCr4veJ=2oJywyyqQB8iMxqvA@mail.gmail.com/

Ok, but why am I not seeing this on 6.18-rc?

thanks,

greg k-h

#3 lore raw
Quoted 2 lines · Greg KH

Ok, but why am I not seeing this on 6.18-rc?

It happens in mainline too, so a few possibilities are:

- You have the toolchain forced to an older one (can happen e.g. if
you are using rustup and you have an override on a path, even if the default elsewhere is another).

- You are not enabling doctests (KUnit).

- You are not enabling KASAN.

Please let me know if you still do not see it, because that it is definitely not expected.

I committed the fix yesterday -- it should be in tomorrow's -next.

Cheers,
Miguel

author
#4 lore raw
Quoted 9 lines · Miguel Ojeda
Quoted 2 lines · Greg KH

Ok, but why am I not seeing this on 6.18-rc?

It happens in mainline too, so a few possibilities are:

- You have the toolchain forced to an older one (can happen e.g. if
you are using rustup and you have an override on a path, even if the default elsewhere is another).

I am using:

	make CC=gcc-14 -j32

as my build command line. Hm, that's a mix of gcc and rustc, does that even work?

Quoted 1 line

- You are not enabling doctests (KUnit).

CONFIG_KUNIT=y

Quoted 1 line

- You are not enabling KASAN.

CONFIG_KASAN=y

The full .config can be found here:
https://github.com/gregkh/gregkh-linux/blob/master/stable/configs/6.17.y

The issue only started showing up when I moved rustc from 1.90.0 to 1.91.0, nothing else changed on my system that I can determine.

Quoted 2 lines

Please let me know if you still do not see it, because that it is definitely not expected.

I have those options as set above, so this is not expected :)

Quoted 1 line

I committed the fix yesterday -- it should be in tomorrow's -next.

Cool, what's the git id? I'll be glad to try it.

thanks,

greg k-h

#5 lore raw
Quoted 3 lines · Greg KH

Hm, that's a mix of gcc and rustc, does that
even work?

It "works" -- it is a best-effort hack as we always warn, but some distributions do use it.

GCC being used is unrelated to this issue though.

Quoted 2 lines

The full .config can be found here:
https://github.com/gregkh/gregkh-linux/blob/master/stable/configs/6.17.y

I picked this one and run it in v6.18-rc4, and I see the issue as expected:

git clean -xdf
git checkout v6.18-rc4
curl -o .config
https://raw.githubusercontent.com/gregkh/gregkh-linux/refs/heads/master/stable/configs/6.17.y
make olddefconfig
make

What is the config where you do not see the issue (after it gets sync'd, not before the build), i.e. the one for 6.18 that does not fail your build?

Quoted 2 lines

The issue only started showing up when I moved rustc from 1.90.0 to 1.91.0, nothing else changed on my system that I can determine.

Yes, the issue starts with Rust 1.91.0, so that is expected.

Quoted 1 line

Cool, what's the git id? I'll be glad to try it.

It is the one from the rust-fixes branch:

    fad472efab0a805dd939f017c5b8669a786a4bcf

It is the top one in the rust-fixes branch at either:

https://github.com/Rust-for-Linux/linux.git rust-fixes
https://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux.git rust-fixes

(Dirk gave the parent commit of that one, but in your case you need the top one too)

Cheers,
Miguel

author
#6 lore raw
Quoted 37 lines · Miguel Ojeda
Quoted 3 lines · Greg KH

Hm, that's a mix of gcc and rustc, does that
even work?

It "works" -- it is a best-effort hack as we always warn, but some distributions do use it.

GCC being used is unrelated to this issue though.

Quoted 2 lines

The full .config can be found here:
https://github.com/gregkh/gregkh-linux/blob/master/stable/configs/6.17.y

I picked this one and run it in v6.18-rc4, and I see the issue as expected:

git clean -xdf
git checkout v6.18-rc4
curl -o .config
https://raw.githubusercontent.com/gregkh/gregkh-linux/refs/heads/master/stable/configs/6.17.y
make olddefconfig
make

What is the config where you do not see the issue (after it gets sync'd, not before the build), i.e. the one for 6.18 that does not fail your build?

Quoted 2 lines

The issue only started showing up when I moved rustc from 1.90.0 to 1.91.0, nothing else changed on my system that I can determine.

Yes, the issue starts with Rust 1.91.0, so that is expected.

Quoted 1 line

Cool, what's the git id? I'll be glad to try it.

It is the one from the rust-fixes branch:

    fad472efab0a805dd939f017c5b8669a786a4bcf
Quoted 7 lines

It is the top one in the rust-fixes branch at either:

https://github.com/Rust-for-Linux/linux.git rust-fixes
https://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux.git rust-fixes

(Dirk gave the parent commit of that one, but in your case you need the top one too)

This is now fixed up with the patches tagged for stable, thanks, and sorry for the noise, I didn't know it was already queued up.

greg k-h

#7 lore raw
Quoted 3 lines · Greg KH

This is now fixed up with the patches tagged for stable, thanks, and sorry for the noise, I didn't know it was already queued up.

Nice, thanks for confirming!

Cheers,
Miguel