|
Revision tags: v5.7, v5.7-rc7, v5.7-rc6, v5.7-rc5, v5.7-rc4, v5.7-rc3 |
|
| #
30a77297 |
| 23-Apr-2020 |
Masahiro Yamada <[email protected]> |
kbuild: use -MMD instead of -MD to exclude system headers from dependency
This omits system headers from the generated header dependency.
System headers are not updated unless you upgrade the compi
kbuild: use -MMD instead of -MD to exclude system headers from dependency
This omits system headers from the generated header dependency.
System headers are not updated unless you upgrade the compiler. Nor do they contain CONFIG options, so fixdep does not need to parse them.
Having said that, the effect of this optimization will be quite small because the kernel code generally does not include system headers except <stdarg.h>. Host programs include a lot of system headers, but there are not so many in the kernel tree.
At first, keeping system headers in .*.cmd files might be useful to detect the compiler update, but there is no guarantee that <stdarg.h> is included from every file. So, I implemented a more reliable way in the previous commit.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v5.7-rc2, v5.7-rc1, v5.6, v5.6-rc7, v5.6-rc6, v5.6-rc5, v5.6-rc4, v5.6-rc3, v5.6-rc2, v5.6-rc1, v5.5, v5.5-rc7, v5.5-rc6 |
|
| #
88fe89a4 |
| 10-Jan-2020 |
Masahiro Yamada <[email protected]> |
kbuild: remove *.tmp file when filechk fails
Bartosz Golaszewski reports that when "make {menu,n,g,x}config" fails due to missing packages, a temporary file is left over, which is not ignored by git
kbuild: remove *.tmp file when filechk fails
Bartosz Golaszewski reports that when "make {menu,n,g,x}config" fails due to missing packages, a temporary file is left over, which is not ignored by git.
For example, if GTK+ is not installed:
$ make gconfig * * Unable to find the GTK+ installation. Please make sure that * the GTK+ 2.0 development package is correctly installed. * You need gtk+-2.0 gmodule-2.0 libglade-2.0 * scripts/kconfig/Makefile:208: recipe for target 'scripts/kconfig/gconf-cfg' failed make[1]: *** [scripts/kconfig/gconf-cfg] Error 1 Makefile:567: recipe for target 'gconfig' failed make: *** [gconfig] Error 2 $ git status HEAD detached at v5.4 Untracked files: (use "git add <file>..." to include in what will be committed)
scripts/kconfig/gconf-cfg.tmp
nothing added to commit but untracked files present (use "git add" to track)
This is because the check scripts are run with filechk, which misses to clean up the temporary file on failure.
When the line
{ $(filechk_$(1)); } > [email protected];
... fails, it exits immediately due to the 'set -e'. Use trap to make sure to delete the temporary file on exit.
For extra safety, I replaced [email protected] with $(dot-target).tmp to make it a hidden file.
Reported-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v5.5-rc5, v5.5-rc4, v5.5-rc3 |
|
| #
8b41fc44 |
| 19-Dec-2019 |
Masahiro Yamada <[email protected]> |
kbuild: create modules.builtin without Makefile.modbuiltin or tristate.conf
Commit bc081dd6e9f6 ("kbuild: generate modules.builtin") added infrastructure to generate modules.builtin, the list of all
kbuild: create modules.builtin without Makefile.modbuiltin or tristate.conf
Commit bc081dd6e9f6 ("kbuild: generate modules.builtin") added infrastructure to generate modules.builtin, the list of all builtin modules.
Basically, it works like this:
- Kconfig generates include/config/tristate.conf, the list of tristate CONFIG options with a value in a capital letter.
- scripts/Makefile.modbuiltin makes Kbuild descend into directories to collect the information of builtin modules.
I am not a big fan of it because Kbuild ends up with traversing the source tree twice.
I am not sure how perfectly it should work, but this approach cannot avoid false positives; even if the relevant CONFIG option is tristate, some Makefiles forces obj-m to obj-y.
Some examples are:
arch/powerpc/platforms/powermac/Makefile: obj-$(CONFIG_NVRAM:m=y) += nvram.o
net/ipv6/Makefile: obj-$(subst m,y,$(CONFIG_IPV6)) += inet6_hashtables.o
net/netlabel/Makefile: obj-$(subst m,y,$(CONFIG_IPV6)) += netlabel_calipso.o
Nobody has complained about (or noticed) it, so it is probably fine to have false positives in modules.builtin.
This commit simplifies the implementation. Let's exploit the fact that every module has MODULE_LICENSE(). (modpost shows a warning if MODULE_LICENSE is missing. If so, 0-day bot would already have blocked such a module.)
I added MODULE_FILE to <linux/module.h>. When the code is being compiled as builtin, it will be filled with the file path of the module, and collected into modules.builtin.info. Then, scripts/link-vmlinux.sh extracts the list of builtin modules out of it.
This new approach fixes the false-positives above, but adds another type of false-positives; non-modular code may have MODULE_LICENSE() by mistake. This is not a big deal, it is just the code is always orphan. We can clean it up if we like. You can see cleanup examples by:
$ git log --grep='make.* explicitly non-modular'
To sum up, this commits deletes lots of code, but still produces almost equivalent results. Please note it does not increase the vmlinux size at all. As you can see in include/asm-generic/vmlinux.lds.h, the .modinfo section is discarded in the link stage.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
7e826c44 |
| 19-Dec-2019 |
Masahiro Yamada <[email protected]> |
kbuild: add stringify helper to quote a string passed to C files
Make $(squote)$(quote)...$(quote)$(squote) a helper macro. I will reuse it in the next commit.
Signed-off-by: Masahiro Yamada <masah
kbuild: add stringify helper to quote a string passed to C files
Make $(squote)$(quote)...$(quote)$(squote) a helper macro. I will reuse it in the next commit.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v5.5-rc2, v5.5-rc1, v5.4, v5.4-rc8, v5.4-rc7 |
|
| #
eba19032 |
| 07-Nov-2019 |
Masahiro Yamada <[email protected]> |
kbuild: rename any-prereq to newer-prereqs
GNU Make manual says:
$? The names of all the prerequisites that are newer than the target, with spaces between them.
To reflect this, rena
kbuild: rename any-prereq to newer-prereqs
GNU Make manual says:
$? The names of all the prerequisites that are newer than the target, with spaces between them.
To reflect this, rename any-prereq to newer-prereqs, which is clearer and more intuitive.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
2d3b1b8f |
| 07-Nov-2019 |
Masahiro Yamada <[email protected]> |
kbuild: drop $(wildcard $^) check in if_changed* for faster rebuild
The incremental build of Linux kernel is pretty slow when lots of objects are compiled. The rebuild of allmodconfig may take a few
kbuild: drop $(wildcard $^) check in if_changed* for faster rebuild
The incremental build of Linux kernel is pretty slow when lots of objects are compiled. The rebuild of allmodconfig may take a few minutes even when none of the objects needs to be rebuilt.
The time-consuming part in the incremental build is the evaluation of if_changed* macros since they are used in the recipes to compile C and assembly source files into objects.
I notice the following code in if_changed* is expensive:
$(filter-out $(PHONY) $(wildcard $^),$^)
In the incremental build, every object has its .*.cmd file, which contains the auto-generated list of included headers. So, $^ are expanded into the long list of the source file + included headers, and $(wildcard $^) checks whether they exist.
It may not be clear why this check exists there.
Here is the record of my research.
[1] The first code addition into Kbuild
This code dates back to 2002. It is the pre-git era. So, I copy-pasted it from the historical git tree.
| commit 4a6db0791528c220655b063cf13fefc8470dbfee (HEAD) | Author: Kai Germaschewski <[email protected]> | Date: Mon Jun 17 00:22:37 2002 -0500 | | kbuild: Handle removed headers | | New and old way to handle dependencies would choke when a file | #include'd by other files was removed, since the dependency on it was | still recorded, but since it was gone, make has no idea what to do about | it (and would complain with "No rule to make <file> ...") | | We now add targets for all the previously included files, so make will | just ignore them if they disappear. | | diff --git a/Rules.make b/Rules.make | index 6ef827d3df39..7db5301ea7db 100644 | --- a/Rules.make | +++ b/Rules.make | @@ -446,7 +446,7 @@ if_changed = $(if $(strip $? \ | # execute the command and also postprocess generated .d dependencies | # file | | -if_changed_dep = $(if $(strip $? \ | +if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ | $(filter-out $(cmd_$(1)),$(cmd_$@))\ | $(filter-out $(cmd_$@),$(cmd_$(1)))),\ | @set -e; \ | diff --git a/scripts/fixdep.c b/scripts/fixdep.c | index b5d7bee8efc7..db45bd1888c0 100644 | --- a/scripts/fixdep.c | +++ b/scripts/fixdep.c | @@ -292,7 +292,7 @@ void parse_dep_file(void *map, size_t len) | exit(1); | } | memcpy(s, m, p-m); s[p-m] = 0; | - printf("%s: \\\n", target); | + printf("deps_%s := \\\n", target); | m = p+1; | | clear_config(); | @@ -314,7 +314,8 @@ void parse_dep_file(void *map, size_t len) | } | m = p + 1; | } | - printf("\n"); | + printf("\n%s: $(deps_%s)\n\n", target, target); | + printf("$(deps_%s):\n", target); | } | | void print_deps(void)
The "No rule to make <file> ..." error can be solved by passing -MP to the compiler, but I think the detection of header removal is a good feature. When a header is removed, all source files that previously included it should be re-compiled. This makes sure we has correctly got rid of #include directives of it.
This is also related with the behavior of $?. The GNU Make manual says:
$? The names of all the prerequisites that are newer than the target, with spaces between them.
This does not explain whether a non-existent prerequisite is considered to be newer than the target.
At this point of time, GNU Make 3.7x was used, where the $? did not include non-existent prerequisites. Therefore,
$(filter-out FORCE $(wildcard $^),$^)
was useful to detect the header removal, and to rebuild the related objects if it is the case.
[2] Change of $? behavior
Later, the behavior of $? was changed (fixed) to include prerequisites that did not exist.
First, GNU Make commit 64e16d6c00a5 ("Various changes getting ready for the release of 3.81.") changed it, but in the release test of 3.81, it turned out to break the kernel build.
See these:
- http://lists.gnu.org/archive/html/bug-make/2006-03/msg00003.html - https://savannah.gnu.org/bugs/?16002 - https://savannah.gnu.org/bugs/?16051
Then, GNU Make commit 6d8d9b74d9c5 ("Numerous updates to tests for issues found on Cygwin and Windows.") reverted it for the 3.81 release to give Linux kernel time to adjust to the new behavior.
After the 3.81 release, GNU Make commit 7595f38f62af ("Fixed a number of documentation bugs, plus some build/install issues:") re-added it.
[3] Adjustment to the new $? behavior on Kbuild side
Meanwhile, the kernel build was changed by commit 4f1933620f57 ("kbuild: change kbuild to not rely on incorrect GNU make behavior") to adjust to the new $? behavior.
[4] GNU Make 3.82 released in 2010
GNU Make 3.82 was the first release that integrated the correct $? behavior. At this point, Kbuild dealt with GNU Make versions with different $? behaviors.
3.81 or older: $? does not contain any non-existent prerequisite. $(filter-out $(PHONY) $(wildcard $^),$^) was useful to detect removed include headers.
3.82 or newer: $? contains non-existent prerequisites. When a header is removed, it appears in $?. $(filter-out $(PHONY) $(wildcard $^),$^) became a redundant check.
With the correct $? behavior, we could have dropped the expensive check for 3.82 or later, but we did not. (Maybe nobody noticed this optimization.)
[5] The .SECONDARY special target trips up $?
Some time later, I noticed $? did not work as expected under some circumstances. As above, $? should contain non-existent prerequisites, but the ones specified as SECONDARY do not appear in $?.
I asked this in GNU Make ML, and it seems a bug:
https://lists.gnu.org/archive/html/bug-make/2019-01/msg00001.html
Since commit 8e9b61b293d9 ("kbuild: move .SECONDARY special target to Kbuild.include"), all files, including headers listed in .*.cmd files, are treated as secondary.
So, we are back into the incorrect $? behavior.
If we Kbuild want to react to the header removal, we need to keep $(filter-out $(PHONY) $(wildcard $^),$^) but this makes the rebuild so slow.
[Summary]
- I believe noticing the header removal and recompiling related objects is a nice feature for the build system.
- If $? worked correctly, $(filter-out $(PHONY),$?) would be enough to detect the header removal.
- Currently, $? does not work correctly when used with .SECONDARY, and Kbuild is hit by this bug.
- I filed a bug report for this, but not fixed yet as of writing.
- Currently, the header removal is detected by the following expensive code:
$(filter-out $(PHONY) $(wildcard $^),$^)
- I do not want to revert commit 8e9b61b293d9 ("kbuild: move .SECONDARY special target to Kbuild.include"). Specifying .SECONDARY globally is clean, and it matches to the Kbuild policy.
This commit proactively removes the expensive check since it makes the incremental build faster. A downside is Kbuild will no longer be able to notice the header removal.
You can confirm it by the full-build followed by a header removal, and then re-build.
$ make defconfig all [ full build ] $ rm include/linux/device.h $ make CALL scripts/checksyscalls.sh CALL scripts/atomic/check-atomics.sh DESCEND objtool CHK include/generated/compile.h Kernel: arch/x86/boot/bzImage is ready (#11) Building modules, stage 2. MODPOST 12 modules
Previously, Kbuild noticed a missing header and emits a build error. Now, Kbuild is fine with it. This is an unusual corner-case, not a big deal. Once the $? bug is fixed in GNU Make, everything will work fine.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v5.4-rc6, v5.4-rc5, v5.4-rc4, v5.4-rc3, v5.4-rc2, v5.4-rc1 |
|
| #
13dc8c02 |
| 21-Sep-2019 |
Masahiro Yamada <[email protected]> |
kbuild: remove ar-option and KBUILD_ARFLAGS
Commit 40df759e2b9e ("kbuild: Fix build with binutils <= 2.19") introduced ar-option and KBUILD_ARFLAGS to deal with old binutils.
According to Documenta
kbuild: remove ar-option and KBUILD_ARFLAGS
Commit 40df759e2b9e ("kbuild: Fix build with binutils <= 2.19") introduced ar-option and KBUILD_ARFLAGS to deal with old binutils.
According to Documentation/process/changes.rst, the current minimal supported version of binutils is 2.21 so you can assume the 'D' option is always supported. Not only GNU ar but also llvm-ar supports it.
With the 'D' option hard-coded, there is no more user of ar-option or KBUILD_ARFLAGS.
Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Tested-by: Nick Desaulniers <[email protected]>
show more ...
|
|
Revision tags: v5.3, v5.3-rc8, v5.3-rc7, v5.3-rc6, v5.3-rc5, v5.3-rc4, v5.3-rc3, v5.3-rc2 |
|
| #
b2eff092 |
| 23-Jul-2019 |
Masahiro Yamada <[email protected]> |
kbuild: remove unused objectify macro
Commit 415008af3219 ("docs-rst: convert lsm from DocBook to ReST") removed the last users of this macro.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socion
kbuild: remove unused objectify macro
Commit 415008af3219 ("docs-rst: convert lsm from DocBook to ReST") removed the last users of this macro.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v5.3-rc1 |
|
| #
c04d1e46 |
| 15-Jul-2019 |
Masahiro Yamada <[email protected]> |
kbuild: remove unused hostcc-option
We can re-add this whenever it is needed. At this moment, it is unused.
Signed-off-by: Masahiro Yamada <[email protected]>
|
| #
d4a74bbf |
| 09-Jul-2019 |
Masahiro Yamada <[email protected]> |
kbuild: use -- separater intead of $(filter-out ...) for cc-cross-prefix
arch/mips/Makefile passes prefixes that start with '-' to cc-cross-prefix when $(tool-archpref) evaluates to the empty string
kbuild: use -- separater intead of $(filter-out ...) for cc-cross-prefix
arch/mips/Makefile passes prefixes that start with '-' to cc-cross-prefix when $(tool-archpref) evaluates to the empty string.
They are filtered-out before the $(shell ...) invocation. Otherwise, 'command -v' would be confused.
$ command -v -linux-gcc bash: command: -l: invalid option command: usage: command [-pVv] command [arg ...]
Since commit 913ab9780fc0 ("kbuild: use more portable 'command -v' for cc-cross-prefix"), cc-cross-prefix throws away the stderr output, so the console is not polluted in any way.
This is not a big deal in practice, but I see a slightly better taste in adding '--' to teach it that '-linux-gcc' is an argument instead of a command option.
This will cause extra forking of subshell, but it will not be noticeable performance regression.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v5.2, v5.2-rc7, v5.2-rc6 |
|
| #
c2341e2a |
| 22-Jun-2019 |
Masahiro Yamada <[email protected]> |
kbuild: save $(strip ...) for calling if_changed and friends
The string returned by $(filter-out ...) does not contain any leading or trailing spaces.
With the previous commit, 'any-prereq' no long
kbuild: save $(strip ...) for calling if_changed and friends
The string returned by $(filter-out ...) does not contain any leading or trailing spaces.
With the previous commit, 'any-prereq' no longer contains any excessive spaces.
Nor does 'cmd-check' since it expands to a $(filter-out ...) call.
So, only the space that matters is the one between 'any-prereq' and 'cmd-check'.
By removing it from the code, we can save $(strip ...) evaluation. This refactoring is possible because $(any-prereq)$(cmd-check) is only passed to the first argument of $(if ...), so we are only interested in whether or not it is empty.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
93f31bbd |
| 22-Jun-2019 |
Masahiro Yamada <[email protected]> |
kbuild: save $(strip ...) for calling any-prepreq
The string returned by $(filter-out ...) does not contain any leading or trailing spaces.
So, only the space that matters is the one between
$(f
kbuild: save $(strip ...) for calling any-prepreq
The string returned by $(filter-out ...) does not contain any leading or trailing spaces.
So, only the space that matters is the one between
$(filter-out $(PHONY),$?)
and
$(filter-out $(PHONY) $(wildcard $^),$^)
By removing it from the code, we can save $(strip ...) evaluation. This refactoring is possible because $(any-prereq) is only passed to the first argument of $(if ...), so we are only interested in whether or not it is empty.
This is also the prerequisite for the next commit.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
50bcca6a |
| 22-Jun-2019 |
Masahiro Yamada <[email protected]> |
kbuild: rename arg-check to cmd-check
I prefer 'cmd-check' for consistency.
We have 'echo-cmd', 'cmd', 'cmd_and_fixdep', etc. in this file.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionex
kbuild: rename arg-check to cmd-check
I prefer 'cmd-check' for consistency.
We have 'echo-cmd', 'cmd', 'cmd_and_fixdep', etc. in this file.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v5.2-rc5, v5.2-rc4 |
|
| #
a5bae54c |
| 04-Jun-2019 |
Masahiro Yamada <[email protected]> |
kbuild: move hdr-inst shorthand to top Makefile
Now that hdr-inst is used only in the top Makefile, move it there from scripts/Kbuild.include.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socion
kbuild: move hdr-inst shorthand to top Makefile
Now that hdr-inst is used only in the top Makefile, move it there from scripts/Kbuild.include.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
cd238eff |
| 12-Jun-2019 |
Mauro Carvalho Chehab <[email protected]> |
docs: kbuild: convert docs to ReST and rename to *.rst
The kbuild documentation clearly shows that the documents there are written at different times: some use markdown, some use their own peculiar
docs: kbuild: convert docs to ReST and rename to *.rst
The kbuild documentation clearly shows that the documents there are written at different times: some use markdown, some use their own peculiar logic to split sections.
Convert everything to ReST without affecting too much the author's style and avoiding adding uneeded markups.
The conversion is actually: - add blank lines and identation in order to identify paragraphs; - fix tables markups; - add some lists markups; - mark literal blocks; - adjust title markups.
At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings.
Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]>
show more ...
|
| #
913ab978 |
| 06-Jun-2019 |
Masahiro Yamada <[email protected]> |
kbuild: use more portable 'command -v' for cc-cross-prefix
To print the pathname that will be used by shell in the current environment, 'command -v' is a standardized way. [1]
'which' is also often
kbuild: use more portable 'command -v' for cc-cross-prefix
To print the pathname that will be used by shell in the current environment, 'command -v' is a standardized way. [1]
'which' is also often used in scripts, but it is less portable.
When I worked on commit bd55f96fa9fc ("kbuild: refactor cc-cross-prefix implementation"), I was eager to use 'command -v' but it did not work. (The reason is explained below.)
I kept 'which' as before but got rid of '> /dev/null 2>&1' as I thought it was no longer needed. Sorry, I was wrong.
It works well on my Ubuntu machine, but Alexey Brodkin reports noisy warnings on CentOS7 when 'which' fails to find the given command in the PATH environment.
$ which foo which: no foo in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
Given that behavior of 'which' depends on system (and it may not be installed by default), I want to try 'command -v' once again.
The specification [1] clearly describes the behavior of 'command -v' when the given command is not found:
Otherwise, no output shall be written and the exit status shall reflect that the name was not found.
However, we need a little magic to use 'command -v' from Make.
$(shell ...) passes the argument to a subshell for execution, and returns the standard output of the command.
Here is a trick. GNU Make may optimize this by executing the command directly instead of forking a subshell, if no shell special characters are found in the command and omitting the subshell will not change the behavior.
In this case, no shell special character is used. So, Make will try to run it directly. However, 'command' is a shell-builtin command, then Make would fail to find it in the PATH environment:
$ make ARCH=m68k defconfig make: command: Command not found make: command: Command not found make: command: Command not found
In fact, Make has a table of shell-builtin commands because it must ask the shell to execute them.
Until recently, 'command' was missing in the table.
This issue was fixed by the following commit:
| commit 1af314465e5dfe3e8baa839a32a72e83c04f26ef | Author: Paul Smith <[email protected]> | Date: Sun Nov 12 18:10:28 2017 -0500 | | * job.c: Add "command" as a known shell built-in. | | This is not a POSIX shell built-in but it's common in UNIX shells. | Reported by Nick Bowler <[email protected]>.
Because the latest release is GNU Make 4.2.1 in 2016, this commit is not included in any released versions. (But some distributions may have back-ported it.)
We need to trick Make to spawn a subshell. There are various ways to do so:
1) Use a shell special character '~' as dummy
$(shell : ~; command -v $(c)gcc)
2) Use a variable reference that always expands to the empty string (suggested by David Laight)
$(shell command$${x:+} -v $(c)gcc)
3) Use redirect
$(shell command -v $(c)gcc 2>/dev/null)
I chose 3) to not confuse people. The stderr would not be polluted anyway, but it will provide extra safety, and is easy to understand.
Tested on Make 3.81, 3.82, 4.0, 4.1, 4.2, 4.2.1
[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html
Fixes: bd55f96fa9fc ("kbuild: refactor cc-cross-prefix implementation") Cc: linux-stable <[email protected]> # 5.1 Reported-by: Alexey Brodkin <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Tested-by: Alexey Brodkin <[email protected]>
show more ...
|
|
Revision tags: v5.2-rc3 |
|
| #
96ac6d43 |
| 30-May-2019 |
Greg Kroah-Hartman <[email protected]> |
treewide: Add SPDX license identifier - Kbuild
Add SPDX license identifiers to all Make/Kconfig files which:
- Have no license information of any form
These files fall under the project license,
treewide: Add SPDX license identifier - Kbuild
Add SPDX license identifiers to all Make/Kconfig files which:
- Have no license information of any form
These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is:
GPL-2.0
Reported-by: Masahiro Yamada <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v5.2-rc2, v5.2-rc1, v5.1, v5.1-rc7 |
|
| #
055efab3 |
| 23-Apr-2019 |
Nick Desaulniers <[email protected]> |
kbuild: drop support for cc-ldoption
If you want to see if your linker supports a certain flag, then ask the linker directly with ld-option (not the compiler with cc-ldoption). Checking for linker f
kbuild: drop support for cc-ldoption
If you want to see if your linker supports a certain flag, then ask the linker directly with ld-option (not the compiler with cc-ldoption). Checking for linker flag support is an antipattern that complicates the usage of various linkers other than bfd via -fuse-ld={bfd|gold|lld}.
Cc: [email protected] Suggested-by: Masahiro Yamada <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
cdd750bf |
| 13-May-2019 |
Masahiro Yamada <[email protected]> |
kbuild: remove 'addtree' and 'flags' magic for header search paths
The 'addtree' and 'flags' in scripts/Kbuild.include are so compilecated and ugly.
As I mentioned in [1], Kbuild should stop automa
kbuild: remove 'addtree' and 'flags' magic for header search paths
The 'addtree' and 'flags' in scripts/Kbuild.include are so compilecated and ugly.
As I mentioned in [1], Kbuild should stop automatic prefixing of header search path options.
I fixed up (almost) all Makefiles in the kernel. Now 'addtree' and 'flags' have been removed.
Kbuild still caters to add $(srctree)/$(src) and $(objtree)/$(obj) to the header search path for O= building, but never touches extra compiler options from ccflags-y etc.
[1]: https://patchwork.kernel.org/patch/9632347/
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v5.1-rc6, v5.1-rc5, v5.1-rc4, v5.1-rc3, v5.1-rc2, v5.1-rc1, v5.0 |
|
| #
d3a918c6 |
| 01-Mar-2019 |
Masahiro Yamada <[email protected]> |
kbuild: remove cc-version macro
There is no more direct user of this macro; it is only used by cc-ifversion.
Calling this macro is not efficient since it invokes the compiler to get the compiler ve
kbuild: remove cc-version macro
There is no more direct user of this macro; it is only used by cc-ifversion.
Calling this macro is not efficient since it invokes the compiler to get the compiler version. CONFIG_GCC_VERSION is already calculated in the Kconfig stage, so Makefile can reuse it.
Here is a note about the slight difference between cc-version and CONFIG_GCC_VERSION:
When using Clang, cc-version is evaluated to '0402' because Clang defines __GNUC__ and __GNUC__MINOR__, and looks like GCC 4.2 in the version point of view. On the other hand, CONFIG_GCC_VERSION=0 when $(CC) is clang.
There are currently two users of cc-ifversion: arch/mips/loongson64/Platform arch/powerpc/Makefile
They are not affected by this change.
The format of cc-version is <major><minor>, while CONFIG_GCC_VERSION <major><minor><patch>. I adjusted cc-ifversion for the difference of the number of digits.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v5.0-rc8 |
|
| #
bd55f96f |
| 20-Feb-2019 |
Masahiro Yamada <[email protected]> |
kbuild: refactor cc-cross-prefix implementation
- $(word 1, <text>) is equivalent to $(firstword <text>)
- hardcode "gcc" instead of $(CC)
- minimize the shell script part
A little more notes i
kbuild: refactor cc-cross-prefix implementation
- $(word 1, <text>) is equivalent to $(firstword <text>)
- hardcode "gcc" instead of $(CC)
- minimize the shell script part
A little more notes in case $(filter-out -%, ...) is not clear.
arch/mips/Makefile passes prefixes depending on the configuration.
CROSS_COMPILE := $(call cc-cross-prefix, $(tool-archpref)-linux- \ $(tool-archpref)-linux-gnu- $(tool-archpref)-unknown-linux-gnu-)
In the Kconfig stage (e.g. when you run 'make defconfig'), neither CONFIG_32BIT nor CONFIG_64BIT is defined. So, $(tool-archpref) is empty. As a result, "-linux -linux-gnu- -unknown-linux-gnu" is passed into cc-cross-prefix. The command 'which' assumes arguments starting with a hyphen as command options, then emits the following messages:
Illegal option -l Illegal option -l Illegal option -u
I think it is strange to define CROSS_COMPILE depending on the CONFIG options since you need to feed $(CC) to Kconfig, but it is how MIPS Makefile currently works. Anyway, it would not hurt to filter-out invalid strings beforehand.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v5.0-rc7, v5.0-rc6, v5.0-rc5, v5.0-rc4, v5.0-rc3 |
|
| #
afa974b7 |
| 17-Jan-2019 |
Masahiro Yamada <[email protected]> |
kbuild: add real-prereqs shorthand for $(filter-out FORCE,$^)
In Kbuild, if_changed and friends must have FORCE as a prerequisite.
Hence, $(filter-out FORCE,$^) or $(filter-out $(PHONY),$^) is a co
kbuild: add real-prereqs shorthand for $(filter-out FORCE,$^)
In Kbuild, if_changed and friends must have FORCE as a prerequisite.
Hence, $(filter-out FORCE,$^) or $(filter-out $(PHONY),$^) is a common idiom to get the names of all the prerequisites except phony targets.
Add real-prereqs as a shorthand.
Note: We cannot replace $(filter %.o,$^) in cmd_link_multi-m because $^ may include auto-generated dependencies from the .*.cmd file when a single object module is changed into a multi object module. Refer to commit 69ea912fda74 ("kbuild: remove unneeded link_multi_deps"). I added some comment to avoid accidental breakage.
Signed-off-by: Masahiro Yamada <[email protected]> Acked-by: Rob Herring <[email protected]>
show more ...
|
| #
bd352a73 |
| 14-Jan-2019 |
Masahiro Yamada <[email protected]> |
kbuild: remove unused baseprereq
Commit eea199b445f6 ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX") removed the last users of this macro.
Signed-off-by: Masahiro Yamada <yamada.masahiro@
kbuild: remove unused baseprereq
Commit eea199b445f6 ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX") removed the last users of this macro.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v5.0-rc2, v5.0-rc1 |
|
| #
ba97df45 |
| 03-Jan-2019 |
Masahiro Yamada <[email protected]> |
kbuild: use assignment instead of define ... endef for filechk_* rules
You do not have to use define ... endef for filechk_* rules.
For simple cases, the use of assignment looks cleaner, IMHO.
I u
kbuild: use assignment instead of define ... endef for filechk_* rules
You do not have to use define ... endef for filechk_* rules.
For simple cases, the use of assignment looks cleaner, IMHO.
I updated the usage for scripts/Kbuild.include in case somebody misunderstands the 'define ... endif' is the requirement.
Signed-off-by: Masahiro Yamada <[email protected]> Acked-by: Heiko Carstens <[email protected]>
show more ...
|
| #
ad774086 |
| 31-Dec-2018 |
Masahiro Yamada <[email protected]> |
kbuild: change filechk to surround the given command with { }
filechk_* rules often consist of multiple 'echo' lines. They must be surrounded with { } or ( ) to work correctly. Otherwise, only the s
kbuild: change filechk to surround the given command with { }
filechk_* rules often consist of multiple 'echo' lines. They must be surrounded with { } or ( ) to work correctly. Otherwise, only the string from the last 'echo' would be written into the target.
Let's take care of that in the 'filechk' in scripts/Kbuild.include to clean up filechk_* rules.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|