#
53632ba8 |
| 23-Jun-2022 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS (2nd attempt)
If CONFIG_TRIM_UNUSED_KSYMS is enabled and the kernel is built from a pristine state, the vmlinux is linked twice.
Commit 3
kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS (2nd attempt)
If CONFIG_TRIM_UNUSED_KSYMS is enabled and the kernel is built from a pristine state, the vmlinux is linked twice.
Commit 3fdc7d3fe4c0 ("kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS") explains why this happens, but it did not fix the issue at all.
Now I realized I had applied a wrong patch.
In v1 patch [1], the autoksyms_recursive target correctly recurses to "$(MAKE) -f $(srctree)/Makefile autoksyms_recursive".
In v2 patch [2], I accidentally dropped the diff line, and it recurses to "$(MAKE) -f $(srctree)/Makefile vmlinux".
Restore the code I intended in v1.
[1]: https://lore.kernel.org/linux-kbuild/1521045861-22418-8-git-send-email-yamada.masahiro@socionext.com/ [2]: https://lore.kernel.org/linux-kbuild/1521166725-24157-8-git-send-email-yamada.masahiro@socionext.com/
Fixes: 3fdc7d3fe4c0 ("kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS") Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Tested-by: Sami Tolvanen <samitolvanen@google.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
show more ...
|
#
a111daf0 |
| 19-Jun-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 5.19-rc3
|
#
b13baccc |
| 12-Jun-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 5.19-rc2
|
#
f0be87c4 |
| 09-Jun-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
gcc-12: disable '-Warray-bounds' universally for now
In commit 8b202ee21839 ("s390: disable -Warray-bounds") the s390 people disabled the '-Warray-bounds' warning for gcc-12, because the new logic i
gcc-12: disable '-Warray-bounds' universally for now
In commit 8b202ee21839 ("s390: disable -Warray-bounds") the s390 people disabled the '-Warray-bounds' warning for gcc-12, because the new logic in gcc would cause warnings for their use of the S390_lowcore macro, which accesses absolute pointers.
It turns out gcc-12 has many other issues in this area, so this takes that s390 warning disable logic, and turns it into a kernel build config entry instead.
Part of the intent is that we can make this all much more targeted, and use this conflig flag to disable it in only particular configurations that cause problems, with the s390 case as an example:
select GCC12_NO_ARRAY_BOUNDS
and we could do that for other configuration cases that cause issues.
Or we could possibly use the CONFIG_CC_NO_ARRAY_BOUNDS thing in a more targeted way, and disable the warning only for particular uses: again the s390 case as an example:
KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_CC_NO_ARRAY_BOUNDS),-Wno-array-bounds)
but this ends up just doing it globally in the top-level Makefile, since the current issues are spread fairly widely all over:
KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds
We'll try to limit this later, since the gcc-12 problems are rare enough that *much* of the kernel can be built with it without disabling this warning.
Cc: Kees Cook <keescook@chromium.org> Cc: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
show more ...
|
#
49beadbd |
| 09-Jun-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
gcc-12: disable '-Wdangling-pointer' warning for now
While the concept of checking for dangling pointers to local variables at function exit is really interesting, the gcc-12 implementation is not c
gcc-12: disable '-Wdangling-pointer' warning for now
While the concept of checking for dangling pointers to local variables at function exit is really interesting, the gcc-12 implementation is not compatible with reality, and results in false positives.
For example, gcc sees us putting things on a local list head allocated on the stack, which involves exactly those kinds of pointers to the local stack entry:
In function ‘__list_add’, inlined from ‘list_add_tail’ at include/linux/list.h:102:2, inlined from ‘rebuild_snap_realms’ at fs/ceph/snap.c:434:2: include/linux/list.h:74:19: warning: storing the address of local variable ‘realm_queue’ in ‘*&realm_27(D)->rebuild_item.prev’ [-Wdangling-pointer=] 74 | new->prev = prev; | ~~~~~~~~~~^~~~~~
But then gcc - understandably - doesn't really understand the big picture how the doubly linked list works, so doesn't see how we then end up emptying said list head in a loop and the pointer we added has been removed.
Gcc also complains about us (intentionally) using this as a way to store a kind of fake stack trace, eg
drivers/acpi/acpica/utdebug.c:40:38: warning: storing the address of local variable ‘current_sp’ in ‘acpi_gbl_entry_stack_pointer’ [-Wdangling-pointer=] 40 | acpi_gbl_entry_stack_pointer = ¤t_sp; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
which is entirely reasonable from a compiler standpoint, and we may want to change those kinds of patterns, but not not.
So this is one of those "it would be lovely if the compiler were to complain about us leaving dangling pointers to the stack", but not this way.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
show more ...
|
#
f2906aa8 |
| 05-Jun-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 5.19-rc1
|
#
b0d6207b |
| 28-May-2022 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: clean .tmp_* pattern by make clean
Change the "make clean" rule to remove all the .tmp_* files.
.tmp_objdiff is the only exception, which should be removed by "make mrproper".
Rename the r
kbuild: clean .tmp_* pattern by make clean
Change the "make clean" rule to remove all the .tmp_* files.
.tmp_objdiff is the only exception, which should be removed by "make mrproper".
Rename the record directory of objdiff, .tmp_objdiff to .objdiff to avoid the removal by "make clean".
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # LLVM-14 (x86-64)
show more ...
|
#
4b0986a3 |
| 22-May-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 5.18
|
#
42226c98 |
| 15-May-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 5.18-rc7
|
#
f774f5bb |
| 02-May-2022 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: factor out the common installation code into scripts/install.sh
Many architectures have similar install.sh scripts.
The first half is really generic; it verifies that the kernel image and S
kbuild: factor out the common installation code into scripts/install.sh
Many architectures have similar install.sh scripts.
The first half is really generic; it verifies that the kernel image and System.map exist, then executes ~/bin/${INSTALLKERNEL} or /sbin/${INSTALLKERNEL} if available.
The second half is kind of arch-specific; it copies the kernel image and System.map to the destination, but the code is slightly different.
Factor out the generic part into scripts/install.sh.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <n.schier@avm.de>
show more ...
|
#
c5eb0a61 |
| 08-May-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 5.18-rc6
|
#
613f4b3e |
| 03-May-2022 |
Kees Cook <keescook@chromium.org> |
randstruct: Split randstruct Makefile and CFLAGS
To enable the new Clang randstruct implementation[1], move randstruct into its own Makefile and split the CFLAGS from GCC_PLUGINS_CFLAGS into RANDSTR
randstruct: Split randstruct Makefile and CFLAGS
To enable the new Clang randstruct implementation[1], move randstruct into its own Makefile and split the CFLAGS from GCC_PLUGINS_CFLAGS into RANDSTRUCT_CFLAGS.
[1] https://reviews.llvm.org/D121556
Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20220503205503.3054173-5-keescook@chromium.org
show more ...
|
#
75ef3122 |
| 25-Apr-2022 |
Randy Dunlap <rdunlap@infradead.org> |
Makefile: fix 2 typos
Fix typos in comments so that they make sense.
Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
#
c77d06e7 |
| 08-Apr-2022 |
Yann Droneaud <ydroneaud@opteya.com> |
kbuild: support W=e to make build abort in case of warning
When developing new code/feature, CONFIG_WERROR is most often turned off, especially for people using make W=12 to get more warnings.
In s
kbuild: support W=e to make build abort in case of warning
When developing new code/feature, CONFIG_WERROR is most often turned off, especially for people using make W=12 to get more warnings.
In such case, turning on -Werror temporarily would require switching on CONFIG_WERROR in the configuration, building, then switching off CONFIG_WERROR.
For this use case, this patch introduces a new 'e' modifier to W= as a short hand for KCFLAGS+=-Werror" so that -Werror got added to the kernel (built-in) and modules' CFLAGS.
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
fc93a4cd |
| 06-Apr-2022 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: make *.mod not depend on *.o
The dependency
$(obj)/%.mod: $(obj)/%$(mod-prelink-ext).o
... exists because *.mod files previously contained undefined symbols, which are computed from *.
kbuild: make *.mod not depend on *.o
The dependency
$(obj)/%.mod: $(obj)/%$(mod-prelink-ext).o
... exists because *.mod files previously contained undefined symbols, which are computed from *.o files when CONFIG_TRIM_UNUSED_KSYMS=y.
Now that the undefined symbols are put into separate *.usyms files, there is no reason to make *.mod depend on *.o files.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
9413e764 |
| 06-Apr-2022 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: split the second line of *.mod into *.usyms
The *.mod files have two lines; the first line lists the member objects of the module, and the second line, if CONFIG_TRIM_UNUSED_KSYMS=y, lists t
kbuild: split the second line of *.mod into *.usyms
The *.mod files have two lines; the first line lists the member objects of the module, and the second line, if CONFIG_TRIM_UNUSED_KSYMS=y, lists the undefined symbols.
Currently, we generate *.mod after constructing composite modules, otherwise, we cannot compute the second line. No prerequisite is required to print the first line.
They are orthogonal. Splitting them into separate commands will ease further cleanups.
This commit splits the list of undefined symbols out to *.usyms files.
Previously, the list of undefined symbols ended up with a very long line, but now it has one symbol per line.
Use sed like we did before commit 7d32358be8ac ("kbuild: avoid split lines in .mod files").
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
show more ...
|
#
672c0c51 |
| 01-May-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 5.18-rc5
|
#
af2d861d |
| 24-Apr-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 5.18-rc4
|
#
03f16cd0 |
| 18-Apr-2022 |
Josh Poimboeuf <jpoimboe@redhat.com> |
objtool: Add CONFIG_OBJTOOL
Now that stack validation is an optional feature of objtool, add CONFIG_OBJTOOL and replace most usages of CONFIG_STACK_VALIDATION with it.
CONFIG_STACK_VALIDATION can n
objtool: Add CONFIG_OBJTOOL
Now that stack validation is an optional feature of objtool, add CONFIG_OBJTOOL and replace most usages of CONFIG_STACK_VALIDATION with it.
CONFIG_STACK_VALIDATION can now be considered to be frame-pointer specific. CONFIG_UNWINDER_ORC is already inherently valid for live patching, so no need to "validate" it.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Link: https://lkml.kernel.org/r/939bf3d85604b2a126412bf11af6e3bd3b872bcb.1650300597.git.jpoimboe@redhat.com
show more ...
|
#
b2d229d4 |
| 17-Apr-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 5.18-rc3
|
#
ce522ba9 |
| 10-Apr-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 5.18-rc2
|
#
d5ea4fec |
| 01-Apr-2022 |
Chun-Tse Shao <ctshao@google.com> |
kbuild: Allow kernel installation packaging to override pkg-config
Add HOSTPKG_CONFIG to allow tooling that builds the kernel to override what pkg-config and parameters are used.
Signed-off-by: Chu
kbuild: Allow kernel installation packaging to override pkg-config
Add HOSTPKG_CONFIG to allow tooling that builds the kernel to override what pkg-config and parameters are used.
Signed-off-by: Chun-Tse Shao <ctshao@google.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
31231092 |
| 03-Apr-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 5.18-rc1
|
#
cf300b83 |
| 30-Mar-2022 |
Nathan Chancellor <nathan@kernel.org> |
kbuild: Remove '-mno-global-merge'
This flag is specific to clang, where it is only used by the 32-bit and 64-bit ARM backends. In certain situations, the presence of this flag will cause a warning,
kbuild: Remove '-mno-global-merge'
This flag is specific to clang, where it is only used by the 32-bit and 64-bit ARM backends. In certain situations, the presence of this flag will cause a warning, as shown by commit 6580c5c18fb3 ("um: clang: Strip out -mno-global-merge from USER_CFLAGS").
Since commit 61163efae020 ("kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang") that added this flag back in 2014, there have been quite a few changes to the GlobalMerge pass in LLVM. Building several different ARCH=arm and ARCH=arm64 configurations with LLVM 11 (minimum) and 15 (current main version) with this flag removed (i.e., with the default of '-mglobal-merge') reveals no modpost warnings, so it is likely that the issue noted in the comment is no longer relevant due to changes in LLVM or modpost, meaning this flag can be removed.
If any new warnings show up that are a result of the removal of this flag, it can be added back under arch/arm{,64}/Makefile to avoid warnings on other architectures.
Signed-off-by: Nathan Chancellor <nathan@kernel.org> Tested-by: David Gow <davidgow@google.com> Reviewed-by: Kees Cook <keescook@chromium.org> Tested-by: Sedat Dilek <sedat.dilek@gmail.com> Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
e9c28192 |
| 04-Mar-2022 |
Nathan Chancellor <nathan@kernel.org> |
kbuild: Make $(LLVM) more flexible
The LLVM make variable allows a developer to quickly switch between the GNU and LLVM tools. However, it does not handle versioned binaries, such as the ones shippe
kbuild: Make $(LLVM) more flexible
The LLVM make variable allows a developer to quickly switch between the GNU and LLVM tools. However, it does not handle versioned binaries, such as the ones shipped by Debian, as LLVM=1 just defines the tool variables with the unversioned binaries.
There was some discussion during the review of the patch that introduces LLVM=1 around versioned binaries, ultimately coming to the conclusion that developers can just add the folder that contains the unversioned binaries to their PATH, as Debian's versioned suffixed binaries are really just symlinks to the unversioned binaries in /usr/lib/llvm-#/bin:
$ realpath /usr/bin/clang-14 /usr/lib/llvm-14/bin/clang
$ PATH=/usr/lib/llvm-14/bin:$PATH make ... LLVM=1
However, that can be cumbersome to developers who are constantly testing series with different toolchains and versions. It is simple enough to support these versioned binaries directly in the Kbuild system by allowing the developer to specify the version suffix with LLVM=, which is shorter than the above suggestion:
$ make ... LLVM=-14
It does not change the meaning of LLVM=1 (which will continue to use unversioned binaries) and it does not add too much additional complexity to the existing $(LLVM) code, while allowing developers to quickly test their series with different versions of the whole LLVM suite of tools.
Some developers may build LLVM from source but not add the binaries to their PATH, as they may not want to use that toolchain systemwide. Support those developers by allowing them to supply the directory that the LLVM tools are available in, as it is no more complex to support than the version suffix change above.
$ make ... LLVM=/path/to/llvm/
Update and reorder the documentation to reflect these new additions. At the same time, notate that LLVM=0 is not the same as just omitting it altogether, which has confused people in the past.
Link: https://lore.kernel.org/r/20200317215515.226917-1-ndesaulniers@google.com/ Link: https://lore.kernel.org/r/20220224151322.072632223@infradead.org/ Suggested-by: Masahiro Yamada <masahiroy@kernel.org> Suggested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|