- Mar 04, 2019
-
-
Masahiro Yamada authored
Now that the Kconfig is the only user of this script, we can drop unneeded code. Remove the -p option, and stop prepending the output with zero, so that Kconfig can directly use the output from this script. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
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 <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Commit 469cb737 ("kconfig: add CC_IS_CLANG and CLANG_VERSION") changed the code, but missed to update the comment block. The -p option was gone, and the output is 5-digit (or 6-digit when Clang 10 is released). Update the comment now. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Feb 28, 2019
-
-
Kacper Kołodziej authored
DPKG_FLAGS variable lets user to add more flags to dpkg-buildpackage command in deb-pkg and bindeb-pkg. Signed-off-by:
Kacper Kołodziej <kacper@kolodziej.it> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Feb 27, 2019
-
-
Masahiro Yamada authored
If you run "make" in a pristine source tree, currently Kbuild will start to build Kconfig to let it show the error message. It would be more straightforward to check it in Makefile and let it fail immediately. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
- $(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 <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
The genksyms source was integrated into the kernel tree in 2003. I do not expect anybody still using the external /sbin/genksyms. Kbuild does not need to provide the ability to override GENKSYMS. Let's remove the GENKSYMS variable, and use the hardcoded path. Since it occurred in the pre-git era, I attached the commit message in case somebody is interested in the historical background. | Author: Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de> | Date: Wed Feb 19 04:17:28 2003 -0600 | | kbuild: [PATCH] put genksyms in scripts dir | | This puts genksyms into scripts/genksyms/. | | genksyms used to be maintained externally, though the only possible user | was the kernel build. Moving it into the kernel sources makes it easier to | keep it uptodate, like for example updating it to generate linker scripts | directly instead of postprocessing the generated header file fragments | with sed, as we do currently. | | Also, genksyms does not handle __typeof__, which needs to be fixed since | some of the exported symbol in the kernel are defined using __typeof__. | | (Rusty Russell/me) Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
gdb-scripts is not a real object, but (ab)used like a phony target. Rewrite the code in a more Kbuild-ish way. Add symlinks to extra-y and use if_changed. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by:
Kieran Bingham <kieran.bingham@ideasonboard.com>
-
Masahiro Yamada authored
Currently, Kbuild descends from scripts/Makefile to scripts/gdb/Makefile just for creating symbolic links, but it does not need to do it so early. Merge the two descending paths to simplify the code. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by:
Kieran Bingham <kieran.bingham@ideasonboard.com>
-
- Feb 20, 2019
-
-
Masahiro Yamada authored
Do not generate pointless modules.order when the module support is disabled. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
'$(MAKE) KBUILD_SRC=' changes the working directory back and forth between objtree and srctree. It is better to recurse to the top-level Makefile directly. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Modern gcc adds view assignments, reset assertion checking in .loc directives and a couple more additional debug markers, which clutters the asm output unnecessarily: For example: bsp_resume: .LFB3466: .loc 1 1868 1 is_stmt 1 view -0 .cfi_startproc .loc 1 1869 2 view .LVU73 # arch/x86/kernel/cpu/common.c:1869: if (this_cpu->c_bsp_resume) .loc 1 1869 14 is_stmt 0 view .LVU74 movq this_cpu(%rip), %rax # this_cpu, this_cpu movq 64(%rax), %rax # this_cpu.94_1->c_bsp_resume, _2 # arch/x86/kernel/cpu/common.c:1869: if (this_cpu->c_bsp_resume) .loc 1 1869 5 view .LVU75 testq %rax, %rax # _2 je .L8 #, .loc 1 1870 3 is_stmt 1 view .LVU76 movq $boot_cpu_data, %rdi #, jmp __x86_indirect_thunk_rax or .loc 2 57 9 view .LVU478 .loc 2 57 9 view .LVU479 .loc 2 57 9 view .LVU480 .loc 2 57 9 view .LVU481 .LBB1385: .LBB1383: .LBB1379: .LBB1377: .LBB1375: .loc 2 57 9 view .LVU482 .loc 2 57 9 view .LVU483 movl %edi, %edx # cpu, cpu .LVL87: .loc 2 57 9 is_stmt 0 view .LVU484 That MOV in there is drowned in debugging information and latter makes it hard to follow the asm. And that DWARF info is not really needed for asm output staring. Disable the debug information generation which clutters the asm output unnecessarily: bsp_resume: # arch/x86/kernel/cpu/common.c:1869: if (this_cpu->c_bsp_resume) movq this_cpu(%rip), %rax # this_cpu, this_cpu movq 64(%rax), %rax # this_cpu.94_1->c_bsp_resume, _2 # arch/x86/kernel/cpu/common.c:1869: if (this_cpu->c_bsp_resume) testq %rax, %rax # _2 je .L8 #, # arch/x86/kernel/cpu/common.c:1870: this_cpu->c_bsp_resume(&boot_cpu_data); movq $boot_cpu_data, %rdi #, jmp __x86_indirect_thunk_rax .L8: # arch/x86/kernel/cpu/common.c:1871: } rep ret .size bsp_resume, .-bsp_resume [ bp: write commit message. ] Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by:
Borislav Petkov <bp@suse.de>
-
- Feb 19, 2019
-
-
Masahiro Yamada authored
<asm/bitsperlong.h> is enough to include the definition of BITS_PER_LONG. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Global variables in the .bss section are zeroed out before the program starts to run. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Fix the following sparse warnings: scripts/kallsyms.c:65:5: warning: symbol 'token_profit' was not declared. Should it be static? scripts/kallsyms.c:68:15: warning: symbol 'best_table' was not declared. Should it be static? scripts/kallsyms.c:69:15: warning: symbol 'best_table_len' was not declared. Should it be static? Also, remove 'inline' from is_arm_mapping_symbol(). The compiler will inline it anyway when it is appropriate to do so. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Jan 28, 2019
-
-
Masahiro Yamada authored
The commands surrounded by ( ) are executed in a subshell, but in most cases, we do not need to spawn an extra subshell. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
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 69ea912f ("kbuild: remove unneeded link_multi_deps"). I added some comment to avoid accidental breakage. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by:
Rob Herring <robh@kernel.org>
-
Masahiro Yamada authored
All the callers of size_append pass $(filter-out FORCE,$^). Move $(filter-out FORCE,$^) to the definition of size_append. This makes the callers cleaner because $(call ...) is unneeded for a macro with no argument. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
The top Makefile does not need to export KBUILD_VMLINUX_INIT and KBUILD_VMLINUX_MAIN separately. Put every built-in.a into KBUILD_VMLINUX_OBJS. The order of $(head-y), $(init-y), $(core-y), ... is still retained. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
The symbol table in the final archive is unneeded; the linker does not require the symbol table after the --whole-archive option. Every object file in the archive is included in the link anyway. Pass thin archives from subdirectories directly to the linker, and remove the final archiving step. Fix up the document and comments as well. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by:
Nicholas Piggin <npiggin@gmail.com>
-
Masahiro Yamada authored
When building an external module, $(obj) is the absolute path to it. The header search paths from ccflags-y etc. should not be tweaked. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Jan 20, 2019
-
-
Ard Biesheuvel authored
GCC 9 reworks the way the references to the stack canary are emitted, to prevent the value from being spilled to the stack before the final comparison in the epilogue, defeating the purpose, given that the spill slot is under control of the attacker that we are protecting ourselves from. Since our canary value address is obtained without accessing memory (as opposed to pre-v7 code that will obtain it from a literal pool), it is unlikely (although not guaranteed) that the compiler will spill the canary value in the same way, so let's just disable this improvement when building with GCC9+. Signed-off-by:
Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by:
Kees Cook <keescook@chromium.org>
-
Ard Biesheuvel authored
The ARM per-task stack protector GCC plugin hits an assert in the compiler in some case, due to the fact the the SP mask expression is not sign-extended as it should be. So fix that. Suggested-by:
Kugan Vivekanandarajah <kugan.vivekanandarajah@linaro.org> Signed-off-by:
Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by:
Kees Cook <keescook@chromium.org>
-
- Jan 14, 2019
-
-
Masahiro Yamada authored
Commit eea199b4 ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX") removed the last users of this macro. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
I accidentally dropped '*' in the previous renaming patch. Revive it so that 'make mrproper' can clean the generated files. Fixes: d86271af ("kconfig: rename generated .*conf-cfg to *conf-cfg") Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Jan 09, 2019
-
-
WANG Chao authored
Commit 4cd24de3 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") replaced the RETPOLINE define with CONFIG_RETPOLINE checks. Remove the remaining pieces. [ bp: Massage commit message. ] Fixes: 4cd24de3 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") Signed-off-by:
WANG Chao <chao.wang@ucloud.cn> Signed-off-by:
Borislav Petkov <bp@suse.de> Reviewed-by:
Zhenzhong Duan <zhenzhong.duan@oracle.com> Reviewed-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Lutomirski <luto@kernel.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: David Woodhouse <dwmw@amazon.co.uk> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Jessica Yu <jeyu@kernel.org> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Kees Cook <keescook@chromium.org> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> Cc: Michal Marek <michal.lkml@markovi.net> Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tim Chen <tim.c.chen@linux.intel.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: linux-kbuild@vger.kernel.org Cc: srinivas.eeda@oracle.com Cc: stable <stable@vger.kernel.org> Cc: x86-ml <x86@kernel.org> Link: https://lkml.kernel.org/r/20181210163725.95977-1-chao.wang@ucloud.cn
-
- Jan 08, 2019
-
-
Luis Chamberlain authored
dma_zalloc_coherent() is no longer needed as it has no users because dma_alloc_coherent() already zeroes out memory for us. The Coccinelle grammar rule that used to check for dma_alloc_coherent() + memset() is modified so that it just tells the user that the memset is not needed anymore. Suggested-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Luis Chamberlain <mcgrof@kernel.org> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
- Jan 06, 2019
-
-
Masahiro Yamada authored
Remove the dot-prefixing since it is just a matter of the .gitignore file. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
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 <yamada.masahiro@socionext.com> Acked-by:
Heiko Carstens <heiko.carstens@de.ibm.com>
-
Masahiro Yamada authored
Some time ago, Sam pointed out a certain degree of overwrap between generic-y and mandatory-y. (https://lkml.org/lkml/2017/7/10/121 ) I tweaked the meaning of mandatory-y a little bit; now it defines the minimum set of ASM headers that all architectures must have. If arch does not have specific implementation of a mandatory header, Kbuild will let it fallback to the asm-generic one by automatically generating a wrapper. This will allow to drop lots of redundant generic-y defines. Previously, "mandatory" was used in the context of UAPI, but I guess this can be extended to kernel space ASM headers. Suggested-by:
Sam Ravnborg <sam@ravnborg.org> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by:
Sam Ravnborg <sam@ravnborg.org>
-
Masahiro Yamada authored
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 <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Since commit 9c2af1c7 ("kbuild: add .DELETE_ON_ERROR special target"), the target file is automatically deleted on failure. The boilerplate code ... || { rm -f $@; false; } is unneeded. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Commit 3a2429e1 ("kbuild: change if_changed_rule for multi-line recipe") and commit 4f0e3a57 ("kbuild: Add support for DT binding schema checks") came in via different sub-systems. This is a follow-up cleanup. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
The only/last user of UIMAGE_IN/OUT was removed by commit 4722a3e6 ("microblaze: fix multiple bugs in arch/microblaze/boot/Makefile"). The input and output should always be $< and $@. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Currently, CONFIG_JUMP_LABEL just means "I _want_ to use jump label". The jump label is controlled by HAVE_JUMP_LABEL, which is defined like this: #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) # define HAVE_JUMP_LABEL #endif We can improve this by testing 'asm goto' support in Kconfig, then make JUMP_LABEL depend on CC_HAS_ASM_GOTO. Ugly #ifdef HAVE_JUMP_LABEL will go away, and CONFIG_JUMP_LABEL will match to the real kernel capability. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Tested-by:
Sedat Dilek <sedat.dilek@gmail.com>
-
Mathias Krause authored
As mentioned in the info pages of gas, the '.align' pseudo op's interpretation of the alignment value is architecture specific. It might either be a byte value or taken to the power of two. On ARM it's actually the latter which leads to unnecessary large alignments of 16 bytes for 32 bit builds or 256 bytes for 64 bit builds. Fix this by switching to '.balign' instead which is consistent across all architectures. Signed-off-by:
Mathias Krause <minipli@googlemail.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Julia Lawall authored
Coccinelle doesn't always have access to the values of named (#define) constants, and they may likely often be bound to true and false values anyway, resulting in false positives. So stop warning about them. Signed-off-by:
Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Julia Lawall authored
Avoid reporting on the use of an iterator index variable when the variable is redeclared. Signed-off-by:
Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
This has never been used. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Jan 04, 2019
-
-
Jorge Ramirez-Ortiz authored
As per Documentation/process/submitting-patches, Co-developed-by is a valid signature. This commit removes the warning. Link: http://lkml.kernel.org/r/1544808928-20002-3-git-send-email-jorge.ramirez-ortiz@linaro.org Signed-off-by:
Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Himanshu Jha <himanshujha199640@gmail.com> Cc: Joe Perches <joe@perches.com> Cc: Jonathan Cameron <jic23@kernel.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Niklas Cassel <niklas.cassel@linaro.org> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-