5ce2176b | 13-May-2022 |
Masahiro Yamada <masahiroy@kernel.org> |
genksyms: adjust the output format to modpost
Make genksyms output symbol versions in the format modpost expects, so the 'sed' is unneeded.
This commit makes *.symversions completely unneeded.
I w
genksyms: adjust the output format to modpost
Make genksyms output symbol versions in the format modpost expects, so the 'sed' is unneeded.
This commit makes *.symversions completely unneeded.
I will keep *.symversions in .gitignore and 'make clean' for a while. Otherwise, 'git status' might be surprising.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu> Tested-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # LLVM-14 (x86-64)
show more ...
|
13940738 | 15-Jan-2021 |
Masahiro Yamada <masahiroy@kernel.org> |
genksyms: remove useless case DOTS
This switch statement does not list out all the cases. Since the 'default' covers all the rest, the 'DOTS' case is unneeded.
Signed-off-by: Masahiro Yamada <masah
genksyms: remove useless case DOTS
This switch statement does not list out all the cases. Since the 'default' covers all the rest, the 'DOTS' case is unneeded.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
e66e13a3 | 15-Jan-2021 |
Masahiro Yamada <masahiroy@kernel.org> |
genksyms: remove dead code for ST_TABLE_*
No one sets lexstate to ST_TABLE_*. It is is very old code, and I do not know what was the plan at that time. Let's remove the dead code.
Signed-off-by: Ma
genksyms: remove dead code for ST_TABLE_*
No one sets lexstate to ST_TABLE_*. It is is very old code, and I do not know what was the plan at that time. Let's remove the dead code.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
|
77564a48 | 12-Sep-2019 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
genksyms: convert to SPDX License Identifier for lex.l and parse.y
I used the C comment style (/* ... */) for the flex and bison files as in Kconfig (scripts/kconfig/{lexer.l,parser.y})
Signed-off-
genksyms: convert to SPDX License Identifier for lex.l and parse.y
I used the C comment style (/* ... */) for the flex and bison files as in Kconfig (scripts/kconfig/{lexer.l,parser.y})
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
show more ...
|
69a94abb | 09-Sep-2019 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
export.h, genksyms: do not make genksyms calculate CRC of trimmed symbols
Arnd Bergmann reported false-positive modpost warnings detected by his randconfig testing of linux-next.
Actually, this hap
export.h, genksyms: do not make genksyms calculate CRC of trimmed symbols
Arnd Bergmann reported false-positive modpost warnings detected by his randconfig testing of linux-next.
Actually, this happens under the combination of CONFIG_MODVERSIONS and CONFIG_TRIM_UNUSED_KSYMS since commit 15bfc2348d54 ("modpost: check for static EXPORT_SYMBOL* functions").
For example, arch/arm/config/multi_v7_defconfig + CONFIG_MODVERSIONS + CONFIG_TRIM_UNUSED_KSYMS produces the following false-positives:
WARNING: "__lshrdi3" [vmlinux] is a static (unknown) WARNING: "__ashrdi3" [vmlinux] is a static (unknown) WARNING: "__aeabi_lasr" [vmlinux] is a static (unknown) WARNING: "__aeabi_llsr" [vmlinux] is a static (unknown) WARNING: "ftrace_set_clr_event" [vmlinux] is a static (unknown) WARNING: "__muldi3" [vmlinux] is a static (unknown) WARNING: "__aeabi_ulcmp" [vmlinux] is a static (unknown) WARNING: "__ucmpdi2" [vmlinux] is a static (unknown) WARNING: "__aeabi_lmul" [vmlinux] is a static (unknown) WARNING: "__bswapsi2" [vmlinux] is a static (unknown) WARNING: "__bswapdi2" [vmlinux] is a static (unknown) WARNING: "__ashldi3" [vmlinux] is a static (unknown) WARNING: "__aeabi_llsl" [vmlinux] is a static (unknown)
The root cause of the problem is not in the modpost, but in the implementation of CONFIG_TRIM_UNUSED_KSYMS.
If there is at least one untrimmed symbol in the file, genksyms is invoked to calculate CRC of *all* the exported symbols in that file even if some of them have been trimmed due to no caller existing.
As a result, .tmp_*.ver files contain CRC of trimmed symbols, thus unneeded, orphan __crc* symbols are added to objects. It had been harmless until recently.
With commit 15bfc2348d54 ("modpost: check for static EXPORT_SYMBOL* functions"), it is now harmful because the bogus __crc* symbols make modpost call sym_update_crc() to add the symbols to the hash table, but there is no one that clears the ->is_static member.
I gave Fixes to the first commit that uncovered the issue, but the potential problem has long existed since commit f235541699bc ("export.h: allow for per-symbol configurable EXPORT_SYMBOL()").
Fixes: 15bfc2348d54 ("modpost: check for static EXPORT_SYMBOL* functions") Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Tested-by: Arnd Bergmann <arnd@arndb.de>
show more ...
|
b23d1a24 | 23-Mar-2018 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically
Files generated by if_changed* must be added to 'targets' to include *.cmd files. Otherwise, they would be regenerated every time.
The
kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically
Files generated by if_changed* must be added to 'targets' to include *.cmd files. Otherwise, they would be regenerated every time.
The build system automatically adds objects to 'targets' where appropriate, such as obj-y, extra-y, etc. but does nothing for intermediate files. So, each Makefile needs to add them by itself.
There are some common cases where objects are generated by chained rules. Lexers and parsers are compiled like follows:
%.lex.o <- %.lex.c <- %.l %.tab.o <- %.tab.c <- %.y
They are common patterns, so it is reasonable to take care of them in the core Makefile instead of requiring each Makefile to do so.
At this moment, you cannot delete 'target += zconf.lex.c' in the Kconfig Makefile because zconf.lex.c is included from zconf.tab.c instead of being compiled separately. It should be deleted after Kconfig is more refactored.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Frank Rowand <frowand.list@gmail.com>
show more ...
|
833e6224 | 23-Mar-2018 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
genksyms: generate lexer and parser during build instead of shipping
Now that the kernel build supports flex and bison, remove the _shipped files and generate them during the build instead.
There a
genksyms: generate lexer and parser during build instead of shipping
Now that the kernel build supports flex and bison, remove the _shipped files and generate them during the build instead.
There are no more shipped lexer and parser, so I ripped off the rules in scripts/Malefile.lib that were used for REGENERATE_PARSERS.
The genksyms parser has ambiguous grammar, which would emit warnings:
scripts/genksyms/parse.y: warning: 9 shift/reduce conflicts [-Wconflicts-sr] scripts/genksyms/parse.y: warning: 5 reduce/reduce conflicts [-Wconflicts-rr]
They are normally suppressed, but displayed when W=1 is given.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
show more ...
|
9a8dfb39 | 23-Mar-2018 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile
Files suffixed by .lex.c, .tab.[ch] are generated lexers, parsers, respectively. Clean them up globally from the top Makefil
kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile
Files suffixed by .lex.c, .tab.[ch] are generated lexers, parsers, respectively. Clean them up globally from the top Makefile.
Some of the final host programs those lexer/parser are linked into are necessary for building external modules, but the intermediates are unneeded. They can be cleaned away by 'make clean' instead of 'make mrproper'.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Frank Rowand <frowand.list@gmail.com>
show more ...
|