diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2017-06-09 01:24:14 -0400 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-06-29 20:03:03 -0400 |
commit | 9a6cfca4f4130444cb02536a4fdf7b6e285c713e (patch) | |
tree | 608067816fdc4d7eee2ec0c1e5498ff26a03bcf0 | |
parent | 1328a1ae0e9048ff4b7f6b60c497db7a2799e1b1 (diff) |
kbuild: thin archives use P option to ar
The P option makes ar do full path name matching and can prevent ar
from discarding files with duplicate names in some cases of creating
thin archives from thin archives. The sh architecture in particular
loses some object files from its kernel/cpu/sh*/ directories without
this option.
This could be a bug in binutils ar, but the P option should not cause
any negative effects so it is safe to use to work around this with.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r-- | scripts/Makefile.build | 8 | ||||
-rwxr-xr-x | scripts/link-vmlinux.sh | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 733e044fff8b..4a9a2cec0a1b 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -437,8 +437,8 @@ $(sort $(subdir-obj-y)): $(subdir-ym) ; | |||
437 | ifdef builtin-target | 437 | ifdef builtin-target |
438 | 438 | ||
439 | ifdef CONFIG_THIN_ARCHIVES | 439 | ifdef CONFIG_THIN_ARCHIVES |
440 | cmd_make_builtin = rm -f $@; $(AR) rcST$(KBUILD_ARFLAGS) | 440 | cmd_make_builtin = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS) |
441 | cmd_make_empty_builtin = rm -f $@; $(AR) rcST$(KBUILD_ARFLAGS) | 441 | cmd_make_empty_builtin = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS) |
442 | quiet_cmd_link_o_target = AR $@ | 442 | quiet_cmd_link_o_target = AR $@ |
443 | else | 443 | else |
444 | cmd_make_builtin = $(LD) $(ld_flags) -r -o | 444 | cmd_make_builtin = $(LD) $(ld_flags) -r -o |
@@ -478,7 +478,7 @@ ifdef lib-target | |||
478 | quiet_cmd_link_l_target = AR $@ | 478 | quiet_cmd_link_l_target = AR $@ |
479 | 479 | ||
480 | ifdef CONFIG_THIN_ARCHIVES | 480 | ifdef CONFIG_THIN_ARCHIVES |
481 | cmd_link_l_target = rm -f $@; $(AR) rcsT$(KBUILD_ARFLAGS) $@ $(lib-y) | 481 | cmd_link_l_target = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(lib-y) |
482 | else | 482 | else |
483 | cmd_link_l_target = rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@ $(lib-y) | 483 | cmd_link_l_target = rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@ $(lib-y) |
484 | endif | 484 | endif |
@@ -531,7 +531,7 @@ cmd_link_multi-link = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secana | |||
531 | 531 | ||
532 | ifdef CONFIG_THIN_ARCHIVES | 532 | ifdef CONFIG_THIN_ARCHIVES |
533 | quiet_cmd_link_multi-y = AR $@ | 533 | quiet_cmd_link_multi-y = AR $@ |
534 | cmd_link_multi-y = rm -f $@; $(AR) rcST$(KBUILD_ARFLAGS) $@ $(link_multi_deps) | 534 | cmd_link_multi-y = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS) $@ $(link_multi_deps) |
535 | else | 535 | else |
536 | quiet_cmd_link_multi-y = LD $@ | 536 | quiet_cmd_link_multi-y = LD $@ |
537 | cmd_link_multi-y = $(cmd_link_multi-link) | 537 | cmd_link_multi-y = $(cmd_link_multi-link) |
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 2a062ea130b5..72a0aa627c56 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh | |||
@@ -50,7 +50,7 @@ archive_builtin() | |||
50 | if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then | 50 | if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then |
51 | info AR built-in.o | 51 | info AR built-in.o |
52 | rm -f built-in.o; | 52 | rm -f built-in.o; |
53 | ${AR} rcsT${KBUILD_ARFLAGS} built-in.o \ | 53 | ${AR} rcsTP${KBUILD_ARFLAGS} built-in.o \ |
54 | ${KBUILD_VMLINUX_INIT} \ | 54 | ${KBUILD_VMLINUX_INIT} \ |
55 | ${KBUILD_VMLINUX_MAIN} | 55 | ${KBUILD_VMLINUX_MAIN} |
56 | fi | 56 | fi |