summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-05-19 16:13:51 +0900
committerSascha Hauer <s.hauer@pengutronix.de>2020-05-25 08:51:37 +0200
commit0a78b33954a911cf59fa8b6eaa2e987405875569 (patch)
treed8c224d8bdd59bef9bf41a8de99403d6a07e9f72 /Makefile
parentdc4cff0209ba243c5438fb278c46cbdb7889f44c (diff)
downloadbarebox-0a78b33954a911cf59fa8b6eaa2e987405875569.tar.gz
barebox-0a78b33954a911cf59fa8b6eaa2e987405875569.tar.xz
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>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 5 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 9f30fafdd6..c4a2519a13 100644
--- a/Makefile
+++ b/Makefile
@@ -664,8 +664,8 @@ barebox-alldirs := $(sort $(barebox-dirs) $(patsubst %/,%,$(filter %/, \
$(core-n) $(core-) $(drivers-n) $(drivers-) \
$(net-n) $(net-) $(libs-n) $(libs-))))
-pbl-common-y := $(patsubst %/, %/built-in-pbl.o, $(common-y))
-common-y := $(patsubst %/, %/built-in.o, $(common-y))
+pbl-common-y := $(patsubst %/, %/built-in.pbl.a, $(common-y))
+common-y := $(patsubst %/, %/built-in.a, $(common-y))
ifeq ($(CONFIG_DEFAULT_COMPRESSION_GZIP),y)
DEFAULT_COMPRESSION_SUFFIX := .gz
@@ -687,7 +687,7 @@ export DEFAULT_COMPRESSION_SUFFIX
# Build barebox
# ---------------------------------------------------------------------------
# barebox is built from the objects selected by $(barebox-init) and
-# $(barebox-main). Most are built-in.o files from top-level directories
+# $(barebox-main). Most are built-in.a files from top-level directories
# in the kernel tree, others are specified in arch/$(SRCARCH)/Makefile.
# Ordering when linking is important, and $(barebox-init) must be first.
#
@@ -700,7 +700,7 @@ export DEFAULT_COMPRESSION_SUFFIX
# | +--< init/version.o + more
# |
# +--< $(barebox-main)
-# | +--< driver/built-in.o mm/built-in.o + more
+# | +--< driver/built-in.a mm/built-in.a + more
# |
# +-< kallsyms.o (see description in CONFIG_KALLSYMS section)
#
@@ -719,7 +719,7 @@ BAREBOX_LDS := $(lds-y)
quiet_cmd_barebox__ ?= LD $@
cmd_barebox__ ?= $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_barebox) -o $@ \
-T $(BAREBOX_LDS) \
- --start-group $(BAREBOX_OBJS) --end-group \
+ --whole-archive $(BAREBOX_OBJS) --no-whole-archive \
$(filter-out $(BAREBOX_LDS) $(BAREBOX_OBJS) FORCE ,$^)
# Generate new barebox version