#
fc5d57a9 |
| 22-Dec-2022 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: refactor silent mode detection
Factor out $(findstring s,...).
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Nic
kbuild: refactor silent mode detection
Factor out $(findstring s,...).
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
show more ...
|
#
2241ab53 |
| 22-Jan-2023 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 6.2-rc5
|
#
5dc4c995 |
| 15-Jan-2023 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 6.2-rc4
|
#
74d3320f |
| 10-Jan-2023 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: fix 'make modules' error when CONFIG_DEBUG_INFO_BTF_MODULES=y
When CONFIG_DEBUG_INFO_BTF_MODULES=y, running 'make modules' in the clean kernel tree will get the following error.
$ grep CO
kbuild: fix 'make modules' error when CONFIG_DEBUG_INFO_BTF_MODULES=y
When CONFIG_DEBUG_INFO_BTF_MODULES=y, running 'make modules' in the clean kernel tree will get the following error.
$ grep CONFIG_DEBUG_INFO_BTF_MODULES .config CONFIG_DEBUG_INFO_BTF_MODULES=y $ make -s clean $ make modules [snip] AR vmlinux.a ar: ./built-in.a: No such file or directory make: *** [Makefile:1241: vmlinux.a] Error 1
'modules' depends on 'vmlinux', but builtin objects are not built.
Define KBUILD_BUILTIN.
Fixes: f73edc8951b2 ("kbuild: unify two modpost invocations") Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
8debed3e |
| 08-Jan-2023 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: export top-level LDFLAGS_vmlinux only to scripts/Makefile.vmlinux
Nathan Chancellor reports that $(NM) emits an error message when GNU Make 4.4 is used to build the ARM zImage.
$ make-4.4
kbuild: export top-level LDFLAGS_vmlinux only to scripts/Makefile.vmlinux
Nathan Chancellor reports that $(NM) emits an error message when GNU Make 4.4 is used to build the ARM zImage.
$ make-4.4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=build defconfig zImage [snip] LD vmlinux NM System.map SORTTAB vmlinux OBJCOPY arch/arm/boot/Image Kernel: arch/arm/boot/Image is ready arm-linux-gnueabi-nm: 'arch/arm/boot/compressed/../../../../vmlinux': No such file /bin/sh: 1: arithmetic expression: expecting primary: " " LDS arch/arm/boot/compressed/vmlinux.lds AS arch/arm/boot/compressed/head.o GZIP arch/arm/boot/compressed/piggy_data AS arch/arm/boot/compressed/piggy.o CC arch/arm/boot/compressed/misc.o
This occurs since GNU Make commit 98da874c4303 ("[SV 10593] Export variables to $(shell ...) commands"), and the O= option is needed to reproduce it. The generated zImage is correct despite the error message.
As the commit description of 98da874c4303 [1] says, exported variables are passed down to $(shell ) functions, which means exported recursive variables might be expanded earlier than before, in the parse stage.
The following test code demonstrates the change for GNU Make 4.4.
[Test Makefile]
$(shell echo hello > foo) export foo = $(shell cat bar/../foo) $(shell mkdir bar)
all: @echo $(foo)
[GNU Make 4.3]
$ rm -rf bar; make-4.3 hello
[GNU Make 4.4]
$ rm -rf bar; make-4.4 cat: bar/../foo: No such file or directory hello
The 'foo' is a resursively expanded (i.e. lazily expanded) variable.
GNU Make 4.3 expands 'foo' just before running the recipe '@echo $(foo)', at this point, the directory 'bar' exists.
GNU Make 4.4 expands 'foo' to evaluate $(shell mkdir bar) because it is exported. At this point, the directory 'bar' does not exit yet. The cat command cannot resolve the bar/../foo path, hence the error message.
Let's get back to the kernel Makefile.
In arch/arm/boot/compressed/Makefile, KBSS_SZ is referenced by LDFLAGS_vmlinux, which is recursive and also exported by the top Makefile.
GNU Make 4.3 expands KBSS_SZ just before running the recipes, so no error message.
GNU Make 4.4 expands KBSS_SZ in the parse stage, where the directory arm/arm/boot/compressed does not exit yet. When compiled with O=, the output directory is created by $(shell mkdir -p $(obj-dirs)) in scripts/Makefile.build.
There are two ways to fix this particular issue:
- change "$(obj)/../../../../vmlinux" in KBSS_SZ to "vmlinux" - unexport LDFLAGS_vmlinux
This commit takes the latter course because it is what I originally intended.
Commit 3ec8a5b33dea ("kbuild: do not export LDFLAGS_vmlinux") unexported LDFLAGS_vmlinux.
Commit 5d4aeffbf709 ("kbuild: rebuild .vmlinux.export.o when its prerequisite is updated") accidentally exported it again.
We can clean up arch/arm/boot/compressed/Makefile later.
[1]: https://git.savannah.gnu.org/cgit/make.git/commit/?id=98da874c43035a490cdca81331724f233a3d0c9a
Link: https://lore.kernel.org/all/Y7i8+EjwdnhHtlrr@dev-arch.thelio-3990X/ Fixes: 5d4aeffbf709 ("kbuild: rebuild .vmlinux.export.o when its prerequisite is updated") Reported-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu> Tested-by: Nathan Chancellor <nathan@kernel.org>
show more ...
|
#
b7bfaa76 |
| 08-Jan-2023 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 6.2-rc3
|
#
a53da43d |
| 01-Jan-2023 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: fix single *.ko build
The single *.ko build is broken since commit f65a486821cf ("kbuild: change module.order to list *.o instead of *.ko").
Fixes: f65a486821cf ("kbuild: change module.orde
kbuild: fix single *.ko build
The single *.ko build is broken since commit f65a486821cf ("kbuild: change module.order to list *.o instead of *.ko").
Fixes: f65a486821cf ("kbuild: change module.order to list *.o instead of *.ko") Reported-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Tested-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
#
88603b6d |
| 01-Jan-2023 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 6.2-rc2
|
#
aa4847db |
| 29-Dec-2022 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: sort single-targets alphabetically again
This was previously alphabetically sorted. Sort it again.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Miguel Ojeda <ojeda@ker
kbuild: sort single-targets alphabetically again
This was previously alphabetically sorted. Sort it again.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Miguel Ojeda <ojeda@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
show more ...
|
#
ec201955 |
| 20-Dec-2022 |
Rob Herring <robh@kernel.org> |
kbuild: Optionally enable schema checks for %.dtb targets
While not documented, schema checks for single dtb targets mostly work already by setting 'CHECK_DTBS=1'. However, the dependencies are not
kbuild: Optionally enable schema checks for %.dtb targets
While not documented, schema checks for single dtb targets mostly work already by setting 'CHECK_DTBS=1'. However, the dependencies are not handled and it only works if 'make dt_bindings_check' was run first and generated processed-schema.json. In addition, changing a binding file doesn't cause the schema to be rebuilt and dtb to be revalidated.
Making this work turns out to be simple. Whenever CHECK_DTBS is set, make 'dt_binding_check' a 'dtbs_prepare' dependency.
I reimplemented here what Masahiro had originally come up with a while back.
Suggested-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Tested-by: Marek Vasut <marex@denx.de> Link: https://lore.kernel.org/r/20221220013233.2890335-1-robh@kernel.org Signed-off-by: Rob Herring <robh@kernel.org>
show more ...
|
#
1b929c02 |
| 25-Dec-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 6.2-rc1
|
#
87d599fc |
| 13-Dec-2022 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: ensure Make >= 3.82 is used
Documentation/process/changes.rst notes the minimal GNU Make version, but it is not checked anywhere.
We could check $(MAKE_VERSION), but another simple way is t
kbuild: ensure Make >= 3.82 is used
Documentation/process/changes.rst notes the minimal GNU Make version, but it is not checked anywhere.
We could check $(MAKE_VERSION), but another simple way is to check $(.FEATURES) since the feature list always grows.
GNU Make 3.81 expands $(.FEATURES) to: target-specific order-only second-expansion else-if archives jobserver check-symlink
GNU Make 3.82 expands $(.FEATURES) to: target-specific order-only second-expansion else-if shortest-stem undefine archives jobserver check-symlink
To ensure Make >= 3.82, you can check either 'shortest-stem' or 'undefine'.
This way is not always possible. For example, Make 4.0 through 4.2 have the same set of $(.FEATURES). At that point, we will need to come up with a different approach.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
show more ...
|
#
f65a4868 |
| 11-Dec-2022 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: change module.order to list *.o instead of *.ko
scripts/Makefile.build replaces the suffix .o with .ko, then scripts/Makefile.modpost calls the sed command to change .ko back to the original
kbuild: change module.order to list *.o instead of *.ko
scripts/Makefile.build replaces the suffix .o with .ko, then scripts/Makefile.modpost calls the sed command to change .ko back to the original .o suffix.
Instead of converting the suffixes back-and-forth, store the .o paths in modules.order, and replace it with .ko in 'make modules_install'.
This avoids the unneeded sed command.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
show more ...
|
#
6768fa4b |
| 11-Dec-2022 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: add read-file macro
Since GNU Make 4.2, $(file ...) supports the read operater '<', which is useful to read a file without forking a new process. No warning is shown even if the input file i
kbuild: add read-file macro
Since GNU Make 4.2, $(file ...) supports the read operater '<', which is useful to read a file without forking a new process. No warning is shown even if the input file is missing.
For older Make versions, it falls back to the cat command.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu> Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com> Tested-by: Alexander Lobakin <alexandr.lobakin@intel.com>
show more ...
|
#
fccb3d3e |
| 11-Dec-2022 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: add test-{ge,gt,le,lt} macros
GNU Make 4.4 introduced $(intcmp ...), which is useful to compare two integers without forking a new process.
Add test-{ge,gt,le,lt} macros, which work more ef
kbuild: add test-{ge,gt,le,lt} macros
GNU Make 4.4 introduced $(intcmp ...), which is useful to compare two integers without forking a new process.
Add test-{ge,gt,le,lt} macros, which work more efficiently with GNU Make >= 4.4. For older Make versions, they fall back to the 'test' shell command.
The first two parameters to $(intcmp ...) must not be empty. To avoid the syntax error, I appended '0' to them. Fortunately, '00' is treated as '0'. This is needed because CONFIG options may expand to an empty string when the kernel configuration is not included.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Palmer Dabbelt <palmer@rivosinc.com> # RISC-V Reviewed-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
show more ...
|
#
830b3c68 |
| 11-Dec-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 6.1
|
#
efa80b02 |
| 06-Dec-2022 |
Masahiro Yamada <masahiroy@kernel.org> |
kbuild: move -Werror from KBUILD_CFLAGS to KBUILD_CPPFLAGS
CONFIG_WERROR turns warnings into errors, which happens only for *.c files because -Werror is added to KBUILD_CFLAGS.
Adding it to KBUILD_
kbuild: move -Werror from KBUILD_CFLAGS to KBUILD_CPPFLAGS
CONFIG_WERROR turns warnings into errors, which happens only for *.c files because -Werror is added to KBUILD_CFLAGS.
Adding it to KBUILD_CPPFLAGS makes more sense because preprocessors understand the -Werror option.
For example, you can put a #warning directive in any preprocessed code.
warning: #warning "this is a warning message" [-Wcpp]
If -Werror is added, it is promoted to an error.
error: #warning "this is a warning message" [-Werror=cpp]
This commit moves -Werror to KBUILD_CPPFLAGS so it works in the same way for *.c, *.S, *.lds.S or whatever needs preprocessing.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
show more ...
|
#
4bf73588 |
| 05-Dec-2022 |
Dmitry Goncharov <dgoncharov@users.sf.net> |
kbuild: Port silent mode detection to future gnu make.
Port silent mode detection to the future (post make-4.4) versions of gnu make.
Makefile contains the following piece of make code to detect if
kbuild: Port silent mode detection to future gnu make.
Port silent mode detection to the future (post make-4.4) versions of gnu make.
Makefile contains the following piece of make code to detect if option -s is specified on the command line.
ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
This code is executed by make at parse time and assumes that MAKEFLAGS does not contain command line variable definitions. Currently if the user defines a=s on the command line, then at build only time MAKEFLAGS contains " -- a=s". However, starting with commit dc2d963989b96161472b2cd38cef5d1f4851ea34 MAKEFLAGS contains command line definitions at both parse time and build time.
This '-s' detection code then confuses a command line variable definition which contains letter 's' with option -s.
$ # old make $ make net/wireless/ocb.o a=s CALL scripts/checksyscalls.sh DESCEND objtool $ # this a new make which defines makeflags at parse time $ ~/src/gmake/make/l64/make net/wireless/ocb.o a=s $
We can see here that the letter 's' from 'a=s' was confused with -s.
This patch checks for presence of -s using a method recommended by the make manual here https://www.gnu.org/software/make/manual/make.html#Testing-Flags.
Link: https://lists.gnu.org/archive/html/bug-make/2022-11/msg00190.html Reported-by: Jan Palus <jpalus+gnu@fastmail.com> Signed-off-by: Dmitry Goncharov <dgoncharov@users.sf.net> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
#
76dcd734 |
| 04-Dec-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 6.1-rc8
|
#
b7b275e6 |
| 27-Nov-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 6.1-rc7
|
#
1f050e90 |
| 16-Nov-2022 |
Maxim Cournoyer <maxim.cournoyer@gmail.com> |
doc: add texinfodocs and infodocs targets
Sphinx supports generating Texinfo sources and Info documentation, which can be navigated easily and is convenient to search (via the indexed nodes or ancho
doc: add texinfodocs and infodocs targets
Sphinx supports generating Texinfo sources and Info documentation, which can be navigated easily and is convenient to search (via the indexed nodes or anchors, for example).
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Link: https://lore.kernel.org/r/20221116190210.28407-2-maxim.cournoyer@gmail.com Signed-off-by: Jonathan Corbet <corbet@lwn.net>
show more ...
|
#
eb708140 |
| 21-Nov-2022 |
Linus Torvalds <torvalds@linux-foundation.org> |
Linux 6.1-rc6
|
#
3bc753c0 |
| 19-Oct-2022 |
Jason A. Donenfeld <Jason@zx2c4.com> |
kbuild: treat char as always unsigned
Recently, some compile-time checking I added to the clamp_t family of functions triggered a build error when a poorly written driver was compiled on ARM, becaus
kbuild: treat char as always unsigned
Recently, some compile-time checking I added to the clamp_t family of functions triggered a build error when a poorly written driver was compiled on ARM, because the driver assumed that the naked `char` type is signed, but ARM treats it as unsigned, and the C standard says it's architecture-dependent.
I doubt this particular driver is the only instance in which unsuspecting authors make assumptions about `char` with no `signed` or `unsigned` specifier. We were lucky enough this time that that driver used `clamp_t(char, negative_value, positive_value)`, so the new checking code found it, and I've sent a patch to fix it, but there are likely other places lurking that won't be so easily unearthed.
So let's just eliminate this particular variety of heisensign bugs entirely. Set `-funsigned-char` globally, so that gcc makes the type unsigned on all architectures.
This will break things in some places and fix things in others, so this will likely cause a bit of churn while reconciling the type misuse.
Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: Kees Cook <keescook@chromium.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/lkml/202210190108.ESC3pc3D-lkp@intel.com/ Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
show more ...
|
#
dcad240c |
| 14-Nov-2022 |
Andrew Davis <afd@ti.com> |
kbuild: Cleanup DT Overlay intermediate files as appropriate
%.dtbo.o and %.dtbo.S files are used to build-in DT Overlay. They should should not be removed by Make or the kernel will be needlessly r
kbuild: Cleanup DT Overlay intermediate files as appropriate
%.dtbo.o and %.dtbo.S files are used to build-in DT Overlay. They should should not be removed by Make or the kernel will be needlessly rebuilt.
These should be removed by "clean" and ignored by git like other intermediate files.
Reported-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Andrew Davis <afd@ti.com> Fixes: 941214a512d8 ("kbuild: Allow DTB overlays to built into .dtbo.S files") Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Masahiro Yamada <masahiroy@kernel.org> Link: https://lore.kernel.org/r/20221114205939.27994-1-afd@ti.com Signed-off-by: Rob Herring <robh@kernel.org>
show more ...
|
#
280981d6 |
| 14-Nov-2022 |
Sathvika Vasireddy <sv@linux.ibm.com> |
objtool: Add --mnop as an option to --mcount
Some architectures (powerpc) may not support ftrace locations being nop'ed out at build time. Introduce CONFIG_HAVE_OBJTOOL_NOP_MCOUNT for objtool, as a
objtool: Add --mnop as an option to --mcount
Some architectures (powerpc) may not support ftrace locations being nop'ed out at build time. Introduce CONFIG_HAVE_OBJTOOL_NOP_MCOUNT for objtool, as a means for architectures to enable nop'ing of ftrace locations. Add --mnop as an option to objtool --mcount, to indicate support for the same.
Also, make sure that --mnop can be passed as an option to objtool only when --mcount is passed.
Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Acked-by: Josh Poimboeuf <jpoimboe@kernel.org> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20221114175754.1131267-12-sv@linux.ibm.com
show more ...
|