diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-20 11:36:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-20 11:36:47 -0400 |
commit | d7b0827f28ab3a4fd65864451ffefa695e3255fd (patch) | |
tree | ed93beb88fa420cf276b2c3fc22c02c022dde693 /scripts/link-vmlinux.sh | |
parent | 574cc4539762561d96b456dbc0544d8898bd4c6e (diff) | |
parent | 77564a4829ef6d309331d443ea6ceb065f3dc371 (diff) |
Merge tag 'kbuild-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild updates from Masahiro Yamada:
- add modpost warn exported symbols marked as 'static' because 'static'
and EXPORT_SYMBOL is an odd combination
- break the build early if gold linker is used
- optimize the Bison rule to produce .c and .h files by a single
pattern rule
- handle PREEMPT_RT in the module vermagic and UTS_VERSION
- warn CONFIG options leaked to the user-space except existing ones
- make single targets work properly
- rebuild modules when module linker scripts are updated
- split the module final link stage into scripts/Makefile.modfinal
- fix the missed error code in merge_config.sh
- improve the error message displayed on the attempt of the O= build in
unclean source tree
- remove 'clean-dirs' syntax
- disable -Wimplicit-fallthrough warning for Clang
- add CONFIG_CC_OPTIMIZE_FOR_SIZE_O3 for ARC
- remove ARCH_{CPP,A,C}FLAGS variables
- add $(BASH) to run bash scripts
- change *CFLAGS_<basetarget>.o to take the relative path to $(obj)
instead of the basename
- stop suppressing Clang's -Wunused-function warnings when W=1
- fix linux/export.h to avoid genksyms calculating CRC of trimmed
exported symbols
- misc cleanups
* tag 'kbuild-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (63 commits)
genksyms: convert to SPDX License Identifier for lex.l and parse.y
modpost: use __section in the output to *.mod.c
modpost: use MODULE_INFO() for __module_depends
export.h, genksyms: do not make genksyms calculate CRC of trimmed symbols
export.h: remove defined(__KERNEL__), which is no longer needed
kbuild: allow Clang to find unused static inline functions for W=1 build
kbuild: rename KBUILD_ENABLE_EXTRA_GCC_CHECKS to KBUILD_EXTRA_WARN
kbuild: refactor scripts/Makefile.extrawarn
merge_config.sh: ignore unwanted grep errors
kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj)
modpost: add NOFAIL to strndup
modpost: add guid_t type definition
kbuild: add $(BASH) to run scripts with bash-extension
kbuild: remove ARCH_{CPP,A,C}FLAGS
kbuild,arc: add CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 for ARC
kbuild: Do not enable -Wimplicit-fallthrough for clang for now
kbuild: clean up subdir-ymn calculation in Makefile.clean
kbuild: remove unneeded '+' marker from cmd_clean
kbuild: remove clean-dirs syntax
kbuild: check clean srctree even earlier
...
Diffstat (limited to 'scripts/link-vmlinux.sh')
-rwxr-xr-x | scripts/link-vmlinux.sh | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 8c59970a09dc..06495379fcd8 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh | |||
@@ -64,6 +64,8 @@ vmlinux_link() | |||
64 | local output=${1} | 64 | local output=${1} |
65 | local objects | 65 | local objects |
66 | 66 | ||
67 | info LD ${output} | ||
68 | |||
67 | # skip output file argument | 69 | # skip output file argument |
68 | shift | 70 | shift |
69 | 71 | ||
@@ -157,6 +159,18 @@ kallsyms() | |||
157 | ${CC} ${aflags} -c -o ${2} ${afile} | 159 | ${CC} ${aflags} -c -o ${2} ${afile} |
158 | } | 160 | } |
159 | 161 | ||
162 | # Perform one step in kallsyms generation, including temporary linking of | ||
163 | # vmlinux. | ||
164 | kallsyms_step() | ||
165 | { | ||
166 | kallsymso_prev=${kallsymso} | ||
167 | kallsymso=.tmp_kallsyms${1}.o | ||
168 | kallsyms_vmlinux=.tmp_vmlinux${1} | ||
169 | |||
170 | vmlinux_link ${kallsyms_vmlinux} "${kallsymso_prev}" ${btf_vmlinux_bin_o} | ||
171 | kallsyms ${kallsyms_vmlinux} ${kallsymso} | ||
172 | } | ||
173 | |||
160 | # Create map file with all symbols from ${1} | 174 | # Create map file with all symbols from ${1} |
161 | # See mksymap for additional details | 175 | # See mksymap for additional details |
162 | mksysmap() | 176 | mksysmap() |
@@ -243,6 +257,7 @@ if [ -n "${CONFIG_DEBUG_INFO_BTF}" ]; then | |||
243 | fi | 257 | fi |
244 | 258 | ||
245 | kallsymso="" | 259 | kallsymso="" |
260 | kallsymso_prev="" | ||
246 | kallsyms_vmlinux="" | 261 | kallsyms_vmlinux="" |
247 | if [ -n "${CONFIG_KALLSYMS}" ]; then | 262 | if [ -n "${CONFIG_KALLSYMS}" ]; then |
248 | 263 | ||
@@ -269,32 +284,19 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then | |||
269 | # a) Verify that the System.map from vmlinux matches the map from | 284 | # a) Verify that the System.map from vmlinux matches the map from |
270 | # ${kallsymso}. | 285 | # ${kallsymso}. |
271 | 286 | ||
272 | kallsymso=.tmp_kallsyms2.o | 287 | kallsyms_step 1 |
273 | kallsyms_vmlinux=.tmp_vmlinux2 | 288 | kallsyms_step 2 |
274 | |||
275 | # step 1 | ||
276 | vmlinux_link .tmp_vmlinux1 ${btf_vmlinux_bin_o} | ||
277 | kallsyms .tmp_vmlinux1 .tmp_kallsyms1.o | ||
278 | |||
279 | # step 2 | ||
280 | vmlinux_link .tmp_vmlinux2 .tmp_kallsyms1.o ${btf_vmlinux_bin_o} | ||
281 | kallsyms .tmp_vmlinux2 .tmp_kallsyms2.o | ||
282 | 289 | ||
283 | # step 3 | 290 | # step 3 |
284 | size1=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" .tmp_kallsyms1.o) | 291 | size1=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" ${kallsymso_prev}) |
285 | size2=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" .tmp_kallsyms2.o) | 292 | size2=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" ${kallsymso}) |
286 | 293 | ||
287 | if [ $size1 -ne $size2 ] || [ -n "${KALLSYMS_EXTRA_PASS}" ]; then | 294 | if [ $size1 -ne $size2 ] || [ -n "${KALLSYMS_EXTRA_PASS}" ]; then |
288 | kallsymso=.tmp_kallsyms3.o | 295 | kallsyms_step 3 |
289 | kallsyms_vmlinux=.tmp_vmlinux3 | ||
290 | |||
291 | vmlinux_link .tmp_vmlinux3 .tmp_kallsyms2.o ${btf_vmlinux_bin_o} | ||
292 | kallsyms .tmp_vmlinux3 .tmp_kallsyms3.o | ||
293 | fi | 296 | fi |
294 | fi | 297 | fi |
295 | 298 | ||
296 | info LD vmlinux | 299 | vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o} |
297 | vmlinux_link vmlinux "${kallsymso}" "${btf_vmlinux_bin_o}" | ||
298 | 300 | ||
299 | if [ -n "${CONFIG_BUILDTIME_EXTABLE_SORT}" ]; then | 301 | if [ -n "${CONFIG_BUILDTIME_EXTABLE_SORT}" ]; then |
300 | info SORTEX vmlinux | 302 | info SORTEX vmlinux |