|
Revision tags: v6.15 |
|
| #
0ff41df1 |
| 25-May-2025 |
Linus Torvalds <[email protected]> |
Linux 6.15
|
|
Revision tags: v6.15-rc7 |
|
| #
a5806cd5 |
| 18-May-2025 |
Linus Torvalds <[email protected]> |
Linux 6.15-rc7
|
|
Revision tags: v6.15-rc6 |
|
| #
8cf5b3f8 |
| 11-May-2025 |
Thomas Weißschuh <[email protected]> |
Revert "kbuild, rust: use -fremap-path-prefix to make paths relative"
This reverts commit dbdffaf50ff9cee3259a7cef8a7bd9e0f0ba9f13.
--remap-path-prefix breaks the ability of debuggers to find the s
Revert "kbuild, rust: use -fremap-path-prefix to make paths relative"
This reverts commit dbdffaf50ff9cee3259a7cef8a7bd9e0f0ba9f13.
--remap-path-prefix breaks the ability of debuggers to find the source file corresponding to object files. As there is no simple or uniform way to specify the source directory explicitly, this breaks developers workflows.
Revert the unconditional usage of --remap-path-prefix, equivalent to the same change for -ffile-prefix-map in KBUILD_CPPFLAGS.
Fixes: dbdffaf50ff9 ("kbuild, rust: use -fremap-path-prefix to make paths relative") Signed-off-by: Thomas Weißschuh <[email protected]> Acked-by: Miguel Ojeda <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
020d7f14 |
| 11-May-2025 |
Thomas Weißschuh <[email protected]> |
Revert "kbuild: make all file references relative to source root"
This reverts commit cacd22ce69585a91c386243cd662ada962431e63.
-ffile-prefix-map breaks the ability of debuggers to find the source
Revert "kbuild: make all file references relative to source root"
This reverts commit cacd22ce69585a91c386243cd662ada962431e63.
-ffile-prefix-map breaks the ability of debuggers to find the source file corresponding to object files. As there is no simple or uniform way to specify the source directory explicitly, this breaks developers workflows.
Revert the unconditional usage of -ffile-prefix-map.
Reported-by: Matthieu Baerts <[email protected]> Closes: https://lore.kernel.org/lkml/[email protected]/ Reported-by: Ville Syrjälä <[email protected]> Closes: https://lore.kernel.org/lkml/[email protected]/ Fixes: cacd22ce6958 ("kbuild: make all file references relative to source root") Signed-off-by: Thomas Weißschuh <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
82f2b0b9 |
| 11-May-2025 |
Linus Torvalds <[email protected]> |
Linux 6.15-rc6
|
|
Revision tags: v6.15-rc5 |
|
| #
92a09c47 |
| 04-May-2025 |
Linus Torvalds <[email protected]> |
Linux 6.15-rc5
|
| #
4f79eaa2 |
| 30-Apr-2025 |
Nathan Chancellor <[email protected]> |
kbuild: Properly disable -Wunterminated-string-initialization for clang
Clang and GCC have different behaviors around disabling warnings included in -Wall and -Wextra and the order in which flags ar
kbuild: Properly disable -Wunterminated-string-initialization for clang
Clang and GCC have different behaviors around disabling warnings included in -Wall and -Wextra and the order in which flags are specified, which is exposed by clang's new support for -Wunterminated-string-initialization.
$ cat test.c const char foo[3] = "FOO"; const char bar[3] __attribute__((__nonstring__)) = "BAR";
$ clang -fsyntax-only -Wextra test.c test.c:1:21: warning: initializer-string for character array is too long, array size is 3 but initializer has size 4 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Wunterminated-string-initialization] 1 | const char foo[3] = "FOO"; | ^~~~~ $ clang -fsyntax-only -Wextra -Wno-unterminated-string-initialization test.c $ clang -fsyntax-only -Wno-unterminated-string-initialization -Wextra test.c test.c:1:21: warning: initializer-string for character array is too long, array size is 3 but initializer has size 4 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Wunterminated-string-initialization] 1 | const char foo[3] = "FOO"; | ^~~~~
$ gcc -fsyntax-only -Wextra test.c test.c:1:21: warning: initializer-string for array of ‘char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (4 chars into 3 available) [-Wunterminated-string-initialization] 1 | const char foo[3] = "FOO"; | ^~~~~ $ gcc -fsyntax-only -Wextra -Wno-unterminated-string-initialization test.c $ gcc -fsyntax-only -Wno-unterminated-string-initialization -Wextra test.c
Move -Wextra up right below -Wall in Makefile.extrawarn to ensure these flags are at the beginning of the warning options list. Move the couple of warning options that have been added to the main Makefile since commit e88ca24319e4 ("kbuild: consolidate warning flags in scripts/Makefile.extrawarn") to scripts/Makefile.extrawarn after -Wall / -Wextra to ensure they get properly disabled for all compilers.
Fixes: 9d7a0577c9db ("gcc-15: disable '-Wunterminated-string-initialization' entirely for now") Link: https://github.com/llvm/llvm-project/issues/10359 Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
show more ...
|
|
Revision tags: v6.15-rc4 |
|
| #
b4432656 |
| 27-Apr-2025 |
Linus Torvalds <[email protected]> |
Linux 6.15-rc4
|
| #
a79be02b |
| 23-Apr-2025 |
Linus Torvalds <[email protected]> |
Fix mis-uses of 'cc-option' for warning disablement
This was triggered by one of my mis-uses causing odd build warnings on sparc in linux-next, but while figuring out why the "obviously correct" use
Fix mis-uses of 'cc-option' for warning disablement
This was triggered by one of my mis-uses causing odd build warnings on sparc in linux-next, but while figuring out why the "obviously correct" use of cc-option caused such odd breakage, I found eight other cases of the same thing in the tree.
The root cause is that 'cc-option' doesn't work for checking negative warning options (ie things like '-Wno-stringop-overflow') because gcc will silently accept options it doesn't recognize, and so 'cc-option' ends up thinking they are perfectly fine.
And it all works, until you have a situation where _another_ warning is emitted. At that point the compiler will go "Hmm, maybe the user intended to disable this warning but used that wrong option that I didn't recognize", and generate a warning for the unrecognized negative option.
Which explains why we have several cases of this in the tree: the 'cc-option' test really doesn't work for this situation, but most of the time it simply doesn't matter that ity doesn't work.
The reason my recently added case caused problems on sparc was pointed out by Thomas Weißschuh: the sparc build had a previous explicit warning that then triggered the new one.
I think the best fix for this would be to make 'cc-option' a bit smarter about this sitation, possibly by adding an intentional warning to the test case that then triggers the unrecognized option warning reliably.
But the short-term fix is to replace 'cc-option' with an existing helper designed for this exact case: 'cc-disable-warning', which picks the negative warning but uses the positive form for testing the compiler support.
Reported-by: Stephen Rothwell <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Explained-by: Thomas Weißschuh <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
show more ...
|
| #
9d7a0577 |
| 20-Apr-2025 |
Linus Torvalds <[email protected]> |
gcc-15: disable '-Wunterminated-string-initialization' entirely for now
I had left the warning around but as a non-fatal error to get my gcc-15 builds going, but fixed up some of the most annoying w
gcc-15: disable '-Wunterminated-string-initialization' entirely for now
I had left the warning around but as a non-fatal error to get my gcc-15 builds going, but fixed up some of the most annoying warning cases so that it wouldn't be *too* verbose.
Because I like the _concept_ of the warning, even if I detested the implementation to shut it up.
It turns out the implementation to shut it up is even more broken than I thought, and my "shut up most of the warnings" patch just caused fatal errors on gcc-14 instead.
I had tested with clang, but when I upgrade my development environment, I try to do it on all machines because I hate having different systems to maintain, and hadn't realized that gcc-14 now had issues.
The ACPI case is literally why I wanted to have a *type* that doesn't trigger the warning (see commit d5d45a7f2619: "gcc-15: make 'unterminated string initialization' just a warning"), instead of marking individual places as "__nonstring".
But gcc-14 doesn't like that __nonstring location that shut gcc-15 up, because it's on an array of char arrays, not on one single array:
drivers/acpi/tables.c:399:1: error: 'nonstring' attribute ignored on objects of type 'const char[][4]' [-Werror=attributes] 399 | static const char table_sigs[][ACPI_NAMESEG_SIZE] __initconst __nonstring = { | ^~~~~~
and my attempts to nest it properly with a type had failed, because of how gcc doesn't like marking the types as having attributes, only symbols.
There may be some trick to it, but I was already annoyed by the bad attribute design, now I'm just entirely fed up with it.
I wish gcc had a proper way to say "this type is a *byte* array, not a string".
The obvious thing would be to distinguish between "char []" and an explicitly signed "unsigned char []" (as opposed to an implicitly unsigned char, which is typically an architecture-specific default, but for the kernel is universal thanks to '-funsigned-char').
But any "we can typedef a 8-bit type to not become a string just because it's an array" model would be fine.
But "__attribute__((nonstring))" is sadly not that sane model.
Reported-by: Chris Clayton <[email protected]> Fixes: 4b4bd8c50f48 ("gcc-15: acpi: sprinkle random '__nonstring' crumbles around") Fixes: d5d45a7f2619 ("gcc-15: make 'unterminated string initialization' just a warning") Signed-off-by: Linus Torvalds <[email protected]>
show more ...
|
|
Revision tags: v6.15-rc3 |
|
| #
9c32cda4 |
| 20-Apr-2025 |
Linus Torvalds <[email protected]> |
Linux 6.15-rc3
|
| #
d5d45a7f |
| 20-Apr-2025 |
Linus Torvalds <[email protected]> |
gcc-15: make 'unterminated string initialization' just a warning
gcc-15 enabling -Wunterminated-string-initialization in -Wextra by default was done with the best intentions, but the warning is stil
gcc-15: make 'unterminated string initialization' just a warning
gcc-15 enabling -Wunterminated-string-initialization in -Wextra by default was done with the best intentions, but the warning is still quite broken.
What annoys me about the warning is that this is a very traditional AND CORRECT way to initialize fixed byte arrays in C:
unsigned char hex[16] = "0123456789abcdef";
and we use this all over the kernel. And the warning is fine, but gcc developers apparently never made a reasonable way to disable it. As is (sadly) tradition with these things.
Yes, there's "__attribute__((nonstring))", and we have a macro to make that absolutely disgusting syntax more palatable (ie the kernel syntax for that monstrosity is just "__nonstring").
But that attribute is misdesigned. What you'd typically want to do is tell the compiler that you are using a type that isn't a string but a byte array, but that doesn't work at all:
warning: ‘nonstring’ attribute does not apply to types [-Wattributes]
and because of this fundamental mis-design, you then have to mark each instance of that pattern.
This is particularly noticeable in our ACPI code, because ACPI has this notion of a 4-byte "type name" that gets used all over, and is exactly this kind of byte array.
This is a sad oversight, because the warning is useful, but really would be so much better if gcc had also given a sane way to indicate that we really just want a byte array type at a type level, not the broken "each and every array definition" level.
So now instead of creating a nice "ACPI name" type using something like
typedef char acpi_name_t[4] __nonstring;
we have to do things like
char name[ACPI_NAMESEG_SIZE] __nonstring;
in every place that uses this concept and then happens to have the typical initializers.
This is annoying me mainly because I think the warning _is_ a good warning, which is why I'm not just turning it off in disgust. But it is hampered by this bad implementation detail.
[ And obviously I'm doing this now because system upgrades for me are something that happen in the middle of the release cycle: don't do it before or during travel, or just before or during the busy merge window period. ]
Signed-off-by: Linus Torvalds <[email protected]>
show more ...
|
|
Revision tags: v6.15-rc2, v6.15-rc1 |
|
| #
0866ee8e |
| 03-Apr-2025 |
Miguel Ojeda <[email protected]> |
rust: disable `clippy::needless_continue`
Starting with Rust 1.86.0, Clippy's `needless_continue` lint complains about the last statement of a loop [1], including cases like:
while ... {
rust: disable `clippy::needless_continue`
Starting with Rust 1.86.0, Clippy's `needless_continue` lint complains about the last statement of a loop [1], including cases like:
while ... { match ... { ... if ... => { ... return ...; } _ => continue, } }
as well as nested `match`es in a loop.
One solution is changing `continue` for `()` [2], but arguably using `continue` shows the intent better when it is alone in an arm like that.
Moreover, I am not sure we want to force people to try to find other ways to write the code either, in cases when that applies.
In addition, the help text does not really apply in the new cases the lint has introduced, e.g. here one cannot simply "drop" the expression:
warning: this `continue` expression is redundant --> rust/macros/helpers.rs:85:18 | 85 | _ => continue, | ^^^^^^^^ | = help: consider dropping the `continue` expression = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_continue = note: requested on the command line with `-W clippy::needless-continue`
The examples in the documentation do not show a case like this, either, so the second "help" line does not help.
In addition, locally disabling the lint is not possible with `expect`, since the behavior differs across versions. Using `allow` would be possible, but, even then, an extra line just for this is a bit too much, especially if there are other ways to satisfy the lint.
Finally, the lint is still in the "pedantic" category and disabled by default by Clippy.
Thus disable the lint, at least for the time being.
Feedback was submitted to upstream Clippy, in case this can be improved or perhaps the lint split into several [3].
Cc: [email protected] # Needed in 6.12.y and later (Rust is pinned in older LTSs). Link: https://github.com/rust-lang/rust-clippy/pull/13891 [1] Link: https://lore.kernel.org/rust-for-linux/[email protected]/ [2] Link: https://github.com/rust-lang/rust-clippy/issues/14536 [3] Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Alice Ryhl <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
show more ...
|
| #
8ffd015d |
| 13-Apr-2025 |
Linus Torvalds <[email protected]> |
Linux 6.15-rc2
|
| #
84ffc79b |
| 07-Apr-2025 |
Nathan Chancellor <[email protected]> |
kbuild: Add '-fno-builtin-wcslen'
A recent optimization change in LLVM [1] aims to transform certain loop idioms into calls to strlen() or wcslen(). This change transforms the first while loop in Un
kbuild: Add '-fno-builtin-wcslen'
A recent optimization change in LLVM [1] aims to transform certain loop idioms into calls to strlen() or wcslen(). This change transforms the first while loop in UniStrcat() into a call to wcslen(), breaking the build when UniStrcat() gets inlined into alloc_path_with_tree_prefix():
ld.lld: error: undefined symbol: wcslen >>> referenced by nls_ucs2_utils.h:54 (fs/smb/client/../../nls/nls_ucs2_utils.h:54) >>> vmlinux.o:(alloc_path_with_tree_prefix) >>> referenced by nls_ucs2_utils.h:54 (fs/smb/client/../../nls/nls_ucs2_utils.h:54) >>> vmlinux.o:(alloc_path_with_tree_prefix)
Disable this optimization with '-fno-builtin-wcslen', which prevents the compiler from assuming that wcslen() is available in the kernel's C library.
[ More to the point - it's not that we couldn't implement wcslen(), it's that this isn't an optimization at all in the context of the kernel.
Replacing a simple inlined loop with a function call to the same loop is just stupid and pointless if you don't have long strings and fancy libraries with vectorization support etc.
For the regular 'strlen()' cases, we want the compiler to do this in order to handle the trivial case of constant strings. And we do have optimized versions of 'strlen()' on some architectures. But for wcslen? Just no. - Linus ]
Cc: [email protected] Link: https://github.com/llvm/llvm-project/commit/9694844d7e36fd5e01011ab56b64f27b867aa72d [1] Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
show more ...
|
| #
0af2f6be |
| 06-Apr-2025 |
Linus Torvalds <[email protected]> |
Linux 6.15-rc1
|
|
Revision tags: v6.14 |
|
| #
38fec10e |
| 24-Mar-2025 |
Linus Torvalds <[email protected]> |
Linux 6.14
|
|
Revision tags: v6.14-rc7 |
|
| #
cacd22ce |
| 15-Mar-2025 |
Thomas Weißschuh <[email protected]> |
kbuild: make all file references relative to source root
-fmacro-prefix-map only affects __FILE__ and __BASE_FILE__. Other references, for example in debug information, are not affected. This makes
kbuild: make all file references relative to source root
-fmacro-prefix-map only affects __FILE__ and __BASE_FILE__. Other references, for example in debug information, are not affected. This makes handling of file references in the compiler outputs harder to use and creates problems for reproducible builds.
Switch to -ffile-prefix map which affects all references.
Also drop the documentation section advising manual specification of -fdebug-prefix-map for reproducible builds, as it is not necessary anymore.
Suggested-by: Ben Hutchings <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Thomas Weißschuh <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
00e81f4f |
| 12-Mar-2025 |
Xin Li (Intel) <[email protected]> |
kbuild: Add a help message for "headers"
Meanwhile explicitly state that the headers are uapi headers.
Suggested-by: Borislav Petkov <[email protected]> Signed-off-by: Xin Li (Intel) <[email protected]> Sig
kbuild: Add a help message for "headers"
Meanwhile explicitly state that the headers are uapi headers.
Suggested-by: Borislav Petkov <[email protected]> Signed-off-by: Xin Li (Intel) <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
4701f33a |
| 16-Mar-2025 |
Linus Torvalds <[email protected]> |
Linux 6.14-rc7
|
| #
ac4f0678 |
| 11-Mar-2025 |
Ard Biesheuvel <[email protected]> |
kbuild: Create intermediate vmlinux build with relocations preserved
The imperative paradigm used to build vmlinux, extract some info from it or perform some checks on it, and subsequently modify it
kbuild: Create intermediate vmlinux build with relocations preserved
The imperative paradigm used to build vmlinux, extract some info from it or perform some checks on it, and subsequently modify it again goes against the declarative paradigm that is usually employed for defining make rules.
In particular, the Makefile.postlink files that consume their input via an output rule result in some dodgy logic in the decompressor makefiles for RISC-V and x86, given that the vmlinux.relocs input file needed to generate the arch-specific relocation tables may not exist or be out of date, but cannot be constructed using the ordinary Make dependency based rules, because the info needs to be extracted while vmlinux is in its ephemeral, non-stripped form.
So instead, for architectures that require the static relocations that are emitted into vmlinux when passing --emit-relocs to the linker, and are subsequently stripped out again, introduce an intermediate vmlinux target called vmlinux.unstripped, and organize the reset of the build logic accordingly:
- vmlinux.unstripped is created only once, and not updated again - build rules under arch/*/boot can depend on vmlinux.unstripped without running the risk of the data disappearing or being out of date - the final vmlinux generated by the build is not bloated with static relocations that are never needed again after the build completes.
Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
9b400d17 |
| 11-Mar-2025 |
Ard Biesheuvel <[email protected]> |
kbuild: Introduce Kconfig symbol for linking vmlinux with relocations
Some architectures build vmlinux with static relocations preserved, but strip them again from the final vmlinux image. Arch spec
kbuild: Introduce Kconfig symbol for linking vmlinux with relocations
Some architectures build vmlinux with static relocations preserved, but strip them again from the final vmlinux image. Arch specific tools consume these static relocations in order to construct relocation tables for KASLR.
The fact that vmlinux is created, consumed and subsequently updated goes against the typical, declarative paradigm used by Make, which is based on rules and dependencies. So as a first step towards cleaning this up, introduce a Kconfig symbol to declare that the arch wants to consume the static relocations emitted into vmlinux. This will be wired up further in subsequent patches.
Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc6, v6.14-rc5, v6.14-rc4 |
|
| #
dbdffaf5 |
| 19-Feb-2025 |
Thomas Weißschuh <[email protected]> |
kbuild, rust: use -fremap-path-prefix to make paths relative
Remap source path prefixes in all output, including compiler diagnostics, debug information, macro expansions, etc. This removes a few ab
kbuild, rust: use -fremap-path-prefix to make paths relative
Remap source path prefixes in all output, including compiler diagnostics, debug information, macro expansions, etc. This removes a few absolute paths from the binary and also makes it possible to use core::panic::Location properly.
Equivalent to the same configuration done for C sources in commit 1d3730f0012f ("kbuild: support -fmacro-prefix-map for external modules") and commit a73619a845d5 ("kbuild: use -fmacro-prefix-map to make __FILE__ a relative path").
Link: https://doc.rust-lang.org/rustc/command-line-arguments.html#--remap-path-prefix-remap-source-names-in-output Acked-by: Miguel Ojeda <[email protected]> Signed-off-by: Thomas Weißschuh <[email protected]> Tested-by: Gary Guo <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
268d191a |
| 17-Feb-2025 |
Thomas Weißschuh <[email protected]> |
kbuild: implement CONFIG_HEADERS_INSTALL for Usermode Linux
userprogs sometimes need access to UAPI headers. This is currently not possible for Usermode Linux, as UM is only a pseudo architecture bu
kbuild: implement CONFIG_HEADERS_INSTALL for Usermode Linux
userprogs sometimes need access to UAPI headers. This is currently not possible for Usermode Linux, as UM is only a pseudo architecture built on top of a regular architecture and does not have its own UAPI. Instead use the UAPI headers from the underlying regular architecture.
Signed-off-by: Thomas Weißschuh <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
d0beb73d |
| 17-Feb-2025 |
Masahiro Yamada <[email protected]> |
kbuild: remove KBUILD_ENABLE_EXTRA_GCC_CHECKS support
Commit e27128db6283 ("kbuild: rename KBUILD_ENABLE_EXTRA_GCC_CHECKS to KBUILD_EXTRA_WARN") renamed KBUILD_ENABLE_EXTRA_GCC_CHECKS in 2019. The m
kbuild: remove KBUILD_ENABLE_EXTRA_GCC_CHECKS support
Commit e27128db6283 ("kbuild: rename KBUILD_ENABLE_EXTRA_GCC_CHECKS to KBUILD_EXTRA_WARN") renamed KBUILD_ENABLE_EXTRA_GCC_CHECKS in 2019. The migration in downstream code should be complete.
Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]>
show more ...
|