summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-06-09 15:24:14 +1000
committerMasahiro Yamada <yamada.masahiro@socionext.com>2017-06-30 09:03:03 +0900
commit9a6cfca4f4130444cb02536a4fdf7b6e285c713e (patch)
tree608067816fdc4d7eee2ec0c1e5498ff26a03bcf0 /scripts
parent1328a1ae0e9048ff4b7f6b60c497db7a2799e1b1 (diff)
downloadlwn-9a6cfca4f4130444cb02536a4fdf7b6e285c713e.tar.gz
lwn-9a6cfca4f4130444cb02536a4fdf7b6e285c713e.zip
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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.build8
-rwxr-xr-xscripts/link-vmlinux.sh2
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) ;
ifdef builtin-target
ifdef CONFIG_THIN_ARCHIVES
- cmd_make_builtin = rm -f $@; $(AR) rcST$(KBUILD_ARFLAGS)
- cmd_make_empty_builtin = rm -f $@; $(AR) rcST$(KBUILD_ARFLAGS)
+ cmd_make_builtin = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS)
+ cmd_make_empty_builtin = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS)
quiet_cmd_link_o_target = AR $@
else
cmd_make_builtin = $(LD) $(ld_flags) -r -o
@@ -478,7 +478,7 @@ ifdef lib-target
quiet_cmd_link_l_target = AR $@
ifdef CONFIG_THIN_ARCHIVES
- cmd_link_l_target = rm -f $@; $(AR) rcsT$(KBUILD_ARFLAGS) $@ $(lib-y)
+ cmd_link_l_target = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(lib-y)
else
cmd_link_l_target = rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@ $(lib-y)
endif
@@ -531,7 +531,7 @@ cmd_link_multi-link = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secana
ifdef CONFIG_THIN_ARCHIVES
quiet_cmd_link_multi-y = AR $@
- cmd_link_multi-y = rm -f $@; $(AR) rcST$(KBUILD_ARFLAGS) $@ $(link_multi_deps)
+ cmd_link_multi-y = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS) $@ $(link_multi_deps)
else
quiet_cmd_link_multi-y = LD $@
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()
if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then
info AR built-in.o
rm -f built-in.o;
- ${AR} rcsT${KBUILD_ARFLAGS} built-in.o \
+ ${AR} rcsTP${KBUILD_ARFLAGS} built-in.o \
${KBUILD_VMLINUX_INIT} \
${KBUILD_VMLINUX_MAIN}
fi