- 29 1月, 2020 2 次提交
-
-
由 Masahiro Yamada 提交于
The temporary directory names, debian/hdrtmp (linux-headers package) vs debian/headertmp (linux-libc-dev package), are confusing. Matching the directory name to the package name is clearer, IMHO. Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org> -
由 Masahiro Yamada 提交于
- We do not need tools/objtool/fixdep or tools/objtool/sync-check.sh for building external modules. Including tools/objtool/objtool is enough. - gcc-common.h is a check-in file. I do not see any point to search for it in objtree. Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
- 22 1月, 2020 1 次提交
-
-
由 Masahiro Yamada 提交于
Currently, -E (stop after the preprocessing stage) is used to check whether the given compiler flag is supported. While it is faster than -S (or -c), it can be false-positive. You need to run the compilation proper to check the flag more precisely. For example, -E and -S disagree about the support of "--param asan-instrument-allocas=1". $ gcc -Werror --param asan-instrument-allocas=1 -E -x c /dev/null -o /dev/null $ echo $? 0 $ gcc -Werror --param asan-instrument-allocas=1 -S -x c /dev/null -o /dev/null cc1: error: invalid --param name ‘asan-instrument-allocas’; did you mean ‘asan-instrument-writes’? $ echo $? 1 Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
- 21 1月, 2020 1 次提交
-
-
由 Michał Mirosław 提交于
Select deb compression using KDEB_COMPRESS make variable. This allows to use gzip compression for local or test builds, and that's way faster than now-default xz compression. Signed-off-by: NMichał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
- 16 1月, 2020 1 次提交
-
-
由 Masahiro Yamada 提交于
This log is displayed every time modules are built, but it is not so important. Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
- 15 1月, 2020 2 次提交
-
-
由 Masahiro Yamada 提交于
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)); } > $@.tmp; ... 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 $@.tmp with $(dot-target).tmp to make it a hidden file. Reported-by: NBartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org> -
由 Masahiro Yamada 提交于
Commit 8d529014 ("[SPARC]: Deal with glibc changing macro names in modpost.c") was more than 14 years ago. STT_SPARC_REGISTER is hopefully defined in elf.h of recent C libraries. Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org> Acked-by: NDavid S. Miller <davem@davemloft.net>
-
- 14 1月, 2020 1 次提交
-
-
由 Michał Mirosław 提交于
Remove a bunch of files not used during external module builds: - foreign architecture headers - subtree Makefiles - Kconfig files - perl scripts On amd64 system this looses a third of the resulting .deb size. Signed-off-by: NMichał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
- 07 1月, 2020 5 次提交
-
-
由 Masahiro Yamada 提交于
Commit bc081dd6 ("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: NMasahiro Yamada <masahiroy@kernel.org>
-
由 Masahiro Yamada 提交于
When compiling, Kbuild passes KBUILD_BASENAME (basename of the object) and KBUILD_MODNAME (basename of the module). This commit adds another one, KBUILD_MODFILE, which is the path of the module. (or, the path of the module it would end up in if it were compiled as a module.) The next commit will use this to generate modules.builtin without tristate.conf. Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org> -
由 Masahiro Yamada 提交于
Make $(squote)$(quote)...$(quote)$(squote) a helper macro. I will reuse it in the next commit. Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org> -
由 Masahiro Yamada 提交于
The built-in.a in a sub-directory is created by descending into that directory. It does not depend on the other sub-directories. Loosen the dependency. Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org> -
由 Masahiro Yamada 提交于
Both 'obj-y += foo/' and 'obj-m += foo/' request Kbuild to visit the sub-directory foo/, but the difference is that only the former combines foo/built-in.a into the built-in.a of the current directory because everything in sub-directories visited by obj-m is supposed to be modular. So, it makes sense to create built-in.a only if that sub-directory is reachable by the chain of obj-y. Otherwise, built-in.a will not be linked into vmlinux anyway. For the same reason, it is pointless to compile obj-y objects in the directory visited by obj-m. Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
- 03 1月, 2020 2 次提交
-
-
由 Ard Biesheuvel 提交于
Cross compiling the x86 kernel on a non-x86 build machine produces the following error when CONFIG_UNWINDER_ORC is enabled, regardless of whether libelf-dev is installed or not. dpkg-checkbuilddeps: error: Unmet build dependencies: libelf-dev dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting dpkg-buildpackage: warning: (Use -d flag to override.) Since this is a build time dependency for a build tool, we need to depend on the native version of libelf-dev so add the appropriate annotation. Signed-off-by: NArd Biesheuvel <ardb@kernel.org> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
由 Arnd Bergmann 提交于
I noticed that randconfig builds with gcc no longer produce a lot of ccache hits, unlike with clang, and traced this back to plugins now being enabled unconditionally if they are supported. I am now working around this by adding export CCACHE_COMPILERCHECK=/usr/bin/size -A %compiler% to my top-level Makefile. This changes the heuristic that ccache uses to determine whether the plugins are the same after a 'make clean'. However, it also seems that being able to just turn off the plugins is generally useful, at least for build testing it adds noticeable overhead but does not find a lot of bugs additional bugs, and may be easier for ccache users than my workaround. Fixes: 9f671e58 ("security: Create "kernel hardening" config area") Signed-off-by: NArnd Bergmann <arnd@arndb.de> Acked-by: NArd Biesheuvel <ardb@kernel.org> Reviewed-by: NMasahiro Yamada <masahiroy@kernel.org> Link: https://lore.kernel.org/r/20191211133951.401933-1-arnd@arndb.de Cc: stable@vger.kernel.org Signed-off-by: NKees Cook <keescook@chromium.org>
-
- 17 12月, 2019 2 次提交
-
-
We've missed the dependency to rsync, so build fails on minimal containers. Fixes: 59b2bd05 ("kbuild: add 'headers' target to build up uapi headers in usr/include") Signed-off-by: NEnrico Weigelt, metux IT consult <info@metux.net> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
由 Thomas Hebb 提交于
NULL expressions are taken to always be true, as implemented by the expr_is_yes() macro and by several other functions in expr.c. As such, they ought to be valid inputs to expr_eq(), which compares two expressions. Signed-off-by: NThomas Hebb <tommyhebb@gmail.com> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
- 14 12月, 2019 3 次提交
-
-
由 Masahiro Yamada 提交于
Since commit 5e5c4fa7 ("scripts/kallsyms: shrink table before sorting it"), kallsyms_relative_base can be larger than _text, which causes overflow when building the 32-bit kernel. https://lkml.org/lkml/2019/12/7/156 This is because _text is, unless --all-symbols is specified, now trimmed from the symbol table before record_relative_base() is called. Handle the offset signedness also for kallsyms_relative_base. Introduce a new helper, output_address(), to reduce the code duplication. Fixes: 5e5c4fa7 ("scripts/kallsyms: shrink table before sorting it") Reported-by: NOlof Johansson <olof@lixom.net> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
由 Masahiro Yamada 提交于
Commit 858805b3 ("kbuild: add $(BASH) to run scripts with bash-extension") shed light on portability issues. Here is another one. Since commit f0772604 ("Fix handling of backlash character in LINUX_COMPILE_BY name"), we must escape a backslash contained in LINUX_COMPILE_BY. This is not working on such distros as Ubuntu. As the POSIX spec [1] says, if any of the operands contain a backslash ( '\' ) character, the results are implementation-defined. The actual shell of /bin/sh could be bash, dash, etc. depending on distros, and the behavior of builtin echo command is different among them. The bash builtin echo, unless -e is given, copies the arguments to stdout without expanding escape sequences (BSD-like behavior). The dash builtin echo, in contrast, adopts System V behavior, which does expand escape sequences without any option given. Even non-builtin /bin/echo behaves differently depending on the system. Due to these variations, echo is considered as a non-portable command. Using printf is the common solution to avoid the portability issue. [1] https://pubs.opengroup.org/onlinepubs/009695399/utilities/echo.html Fixes: 858805b3 ("kbuild: add $(BASH) to run scripts with bash-extension") Reported-by: NXXing Wei <xxing.wei@unisoc.com> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
由 Masahiro Yamada 提交于
UTS_VERSION is set to struct uts_namespace, hence a too long string should be truncated so it fits in 64 characters. On the other hand, LINUX_COMPILE_BY/HOST are not set to uts_namespace. They are just used in the banners, which do not have specific length limitation. I dug into the git history, but I could not find the reason why these two strings must fit in 64 characters. Remove them. Now that UTS_VERSION is the only user of UTS_TRUNCATE, I squashed it. Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
- 06 12月, 2019 1 次提交
-
-
由 Kefeng Wang 提交于
All pr_warning are removed from kernel, let's cleanup pr_warning check in checkpatch. Link: http://lkml.kernel.org/r/20191128004752.35268-5-wangkefeng.wang@huawei.com To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org Cc: tj@kernel.org Cc: arnd@arndb.de Cc: sergey.senozhatsky@gmail.com Cc: rostedt@goodmis.org Cc: Andy Whitcroft <apw@canonical.com> Signed-off-by: NKefeng Wang <wangkefeng.wang@huawei.com> Acked-by: NJoe Perches <joe@perches.com> Signed-off-by: NPetr Mladek <pmladek@suse.com>
-
- 05 12月, 2019 3 次提交
-
-
由 Joe Perches 提交于
The is_maintained_obsolete function can be called twice using the same filename. This function spawns a process using get_maintainer.pl. Store the status of each filename when spawned and use the stored result to eliminate the spawning of unnecessary duplicate child processes. Example: old: $ time ./scripts/checkpatch.pl hp100-Move-to-staging.patch > /dev/null real 0m1.767s user 0m1.634s sys 0m0.141s new: $ time ./scripts/checkpatch.pl hp100-Move-to-staging.patch > /dev/null real 0m1.184s user 0m1.085s sys 0m0.103s Link: http://lkml.kernel.org/r/b982566a2b9b4825badce36fdfc3032bd0005151.camel@perches.comSigned-off-by: NJoe Perches <joe@perches.com> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
由 Joe Perches 提交于
Ignore all upper-case variants before and after SI units like mA, mV and uV so uses like RANGE_mA do not emit a CAMELCASE message. Link: http://lkml.kernel.org/r/5ce6f9131327fd2e12d7a0e20a55f588448de090.camel@perches.comSigned-off-by: NJoe Perches <joe@perches.com> Cc: Jules Irenge <jbi.octave@gmail.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
由 Joe Perches 提交于
A Fixes: lines in a commit message generally indicate that a previous commit was inadequate for whatever reason. The signers of the previous inadequate commit should also be cc'd on this new commit so update get_maintainer to find the old commit and add the original signers. Link: http://lkml.kernel.org/r/33605b9fc0e0f711236951ae84185a6218acff4f.camel@perches.comSigned-off-by: NJoe Perches <joe@perches.com> Suggested-by: NDan Carpenter <dan.carpenter@oracle.com> Reviewed-by: NKees Cook <keescook@chromium.org> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 01 12月, 2019 1 次提交
-
-
由 Colin Ian King 提交于
Here are some of the more common spelling mistakes and typos that I've found while fixing up spelling mistakes in the kernel since July 2019. Link: http://lkml.kernel.org/r/20191112092142.97989-1-colin.king@canonical.comSigned-off-by: NColin Ian King <colin.king@canonical.com> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 29 11月, 2019 1 次提交
-
-
由 Stanislav Fomichev 提交于
While trying to figure out why fentry_fexit selftest doesn't pass for me (old pahole, broken BTF), I found out that my latest patch can break vmlinux .BTF generation. objcopy preserves section start when doing --only-section, so there is a chance (depending on where pahole inserts .BTF section) to have leading empty zeroes. Let's explicitly force section offset to zero. Before: $ objcopy --set-section-flags .BTF=alloc -O binary \ --only-section=.BTF vmlinux .btf.vmlinux.bin $ xxd .btf.vmlinux.bin | head -n1 00000000: 0000 0000 0000 0000 0000 0000 0000 0000 ................ After: $ objcopy --change-section-address .BTF=0 \ --set-section-flags .BTF=alloc -O binary \ --only-section=.BTF vmlinux .btf.vmlinux.bin $ xxd .btf.vmlinux.bin | head -n1 00000000: 9feb 0100 1800 0000 0000 0000 80e1 1c00 ................ ^BTF magic As part of this change, I'm also dropping '2>/dev/null' from objcopy invocation to be able to catch possible other issues (objcopy doesn't produce any warnings for me anymore, it did before with --dump-section). Fixes: da5fb182 ("bpf: Support pre-2.25-binutils objcopy for vmlinux BTF") Signed-off-by: NStanislav Fomichev <sdf@google.com> Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net> Acked-by: NJohn Fastabend <john.fastabend@gmail.com> Cc: Andrii Nakryiko <andriin@fb.com> Link: https://lore.kernel.org/bpf/20191127225759.39923-1-sdf@google.com
-
- 28 11月, 2019 1 次提交
-
-
由 Stanislav Fomichev 提交于
If vmlinux BTF generation fails, but CONFIG_DEBUG_INFO_BTF is set, .BTF section of vmlinux is empty and kernel will prohibit BPF loading and return "in-kernel BTF is malformed". --dump-section argument to binutils' objcopy was added in version 2.25. When using pre-2.25 binutils, BTF generation silently fails. Convert to --only-section which is present on pre-2.25 binutils. Documentation/process/changes.rst states that binutils 2.21+ is supported, not sure those standards apply to BPF subsystem. v2: * exit and print an error if gen_btf fails (John Fastabend) v3: * resend with Andrii's Acked-by/Tested-by tags Fixes: 341dfcf8 ("btf: expose BTF info through sysfs") Signed-off-by: NStanislav Fomichev <sdf@google.com> Signed-off-by: NAlexei Starovoitov <ast@kernel.org> Tested-by: NAndrii Nakryiko <andriin@fb.com> Acked-by: NAndrii Nakryiko <andriin@fb.com> Cc: John Fastabend <john.fastabend@gmail.com> Link: https://lore.kernel.org/bpf/20191127161410.57327-1-sdf@google.com
-
- 25 11月, 2019 13 次提交
-
-
由 Masahiro Yamada 提交于
These are set to zero without the explicit initializers. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> -
由 Masahiro Yamada 提交于
Put the relevant code close together. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> -
由 Masahiro Yamada 提交于
There is no more reason to check the return value of check_symbol_range(). Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> -
由 Masahiro Yamada 提交于
Collect the ignored patterns to is_ignored_symbol(). Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> -
由 Masahiro Yamada 提交于
Refactoring for shortening the code. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> -
由 Masahiro Yamada 提交于
Unless the address range matters, symbols can be ignored earlier, which avoids unneeded memory allocation. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> -
由 Masahiro Yamada 提交于
Add 'const' where a function does not write to the pointer dereferenes. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> -
由 Masahiro Yamada 提交于
The callers of this function expect (unsigned char *). I do not see a good reason to make this function return (void *). Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> -
由 Masahiro Yamada 提交于
You can do equivalent things with strspn(). I do not see noticeable performance difference. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> -
由 Masahiro Yamada 提交于
sym_entry::sym is (unsigned char *) instead of (char *) because kallsyms exploits the MSB for compression, and the characters are used as the index of token_profit array. However, it requires casting (unsigned char *) to (char *) in some places since standard library functions such as strcmp(), strlen() expect (char *). Introduce a new helper, sym_name(), which advances the given pointer by 1 and casts it to (char *). Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> -
由 Masahiro Yamada 提交于
l <= strlen(sym_name) is unnecessary for prefix matching. strncmp() will do. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> -
由 Masahiro Yamada 提交于
Since commit 6f00df24 ("[PATCH] Strip local symbols from kallsyms"), all symbols starting '$' are ignored. is_arm_mapping_symbol() particularly ignores $a, $t, etc. but it is redundant. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
-
由 Masahiro Yamada 提交于
Currently, record_relative_base() iterates over the entire table to find the minimum address, but it is not efficient because we sort the table anyway. After sort_symbol(), the table is sorted by address. (kallsyms parses the 'nm -n' output, so the data is already sorted by address, but this commit does not rely on it.) Move record_relative_base() after sort_symbols(), and take the first non-absolute symbol value. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
-