kbuild: switch over to thin archive
Starting v4.13, Linux always uses thin archive instead of relocatable
ELF to combine builtin objects.

The thin archive is basically a text file that only contains paths to
object files.

As Linux commit 98ced886dd79 mentioned, this has a lot of benefits:

 - save disk space for builds

 - speed-up building a little

 - fix some issues when liking a giant executable (for example,
   allyesconfig on ARM Linux)

 - work better with dead code elimination

The last one is important for barebox because pbl highly relies on the
dead code elimination (-f{function,data}-sections and --gc-sections)
dropping symbols that are unreachable from the linker's entry point.
The dead code elimination does not work if the same symbol names are
used in the pevious incremental link mechanism because the same name
symbols all go into the same section.

Commit a83c97f2a406 ("ARM: socfpga: generate smaller images when
multiple boards are selected") worked around it by giving a dedicate
section to each of the same name symbols. This workaround can go away.

built-in.o was renamed to built-in.a since it is now an archive.
built-in-pbl.o was renamed to built-in.pbl.a for consistency.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent dc4cff0 commit 0a78b33954a911cf59fa8b6eaa2e987405875569
@Masahiro Yamada Masahiro Yamada authored on 19 May 2020
Sascha Hauer committed on 25 May 2020
Showing 9 changed files
View
Makefile
View
arch/kvx/Makefile
View
arch/mips/Makefile
View
arch/mips/pbl/Makefile
View
arch/sandbox/Makefile
View
arch/x86/Makefile
View
images/Makefile
View
scripts/Makefile.build
View
scripts/Makefile.lib