OSDN Git Service

kbuild: handle libs-y archives separately from built-in.o archives
authorNicholas Piggin <npiggin@gmail.com>
Mon, 19 Jun 2017 15:52:05 +0000 (01:52 +1000)
committer0ranko0P <ranko0p@outlook.com>
Sat, 7 Dec 2019 08:31:59 +0000 (16:31 +0800)
commit4408a8c60102b4026b84461c1e3e0aea5891ce2f
tree14600a2b1948ad564ce3b1c2d1a6431efb9cd568
parenteb6678c364513198fdf41f40b34f991b5b6eee3f
kbuild: handle libs-y archives separately from built-in.o archives

The thin archives build currently puts all lib.a and built-in.o
files together and links them with --whole-archive.

This works because thin archives can recursively refer to thin
archives. However some architectures include libgcc.a, which may
not be a thin archive, or it may not be constructed with the "P"
option, in which case its contents do not get linked correctly.

So don't pull .a libs into the root built-in.o archive. These
libs should already have symbol tables and indexes built, so they
can be direct linker inputs. Move them out of the --whole-archive
option, which restore the conditional linking behaviour of lib.a
to thin archives builds.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Documentation/kbuild/kbuild.txt
Makefile
scripts/link-vmlinux.sh