summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2021-11-17 12:49:15 +0900
committerSascha Hauer <s.hauer@pengutronix.de>2021-11-17 08:42:37 +0100
commita5c549e29a07f34a3f85f265b6ab56ae3de8eb20 (patch)
tree6dfe27f7d39c03d2f01fe7bd3c745f832f095526
parente25230e2439f5a8f973a66fce5ee2d2bddf20883 (diff)
downloadbarebox-a5c549e29a07f34a3f85f265b6ab56ae3de8eb20.tar.gz
barebox-a5c549e29a07f34a3f85f265b6ab56ae3de8eb20.tar.xz
x86: remove x86-specific cmd_barebox__
The difference from cmd_barebox__ in the top Makefile is: -shared -Bsymbolic -znocombreloc Put the flags to LDFLAGS_barebox, and remove the x86-specific cmd_barebox__. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Link: https://lore.barebox.org/20211117034918.1226358-3-masahiroy@kernel.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/x86/Makefile11
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 9fc64cc047..c73842cf86 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -28,7 +28,9 @@ endif
ifndef CONFIG_MODULES
# Add cleanup flags
-ifneq ($(CONFIG_X86_EFI),y)
+ifeq ($(CONFIG_X86_EFI),y)
+LDFLAGS_barebox += -shared -Bsymbolic -znocombreloc
+else
KBUILD_CPPFLAGS += -fdata-sections -ffunction-sections
LDFLAGS_barebox += -static --gc-sections
endif
@@ -52,13 +54,6 @@ common-y += arch/x86/lib/
lds-$(CONFIG_X86_32) := arch/x86/mach-efi/elf_ia32_efi.lds
lds-$(CONFIG_X86_64) := arch/x86/mach-efi/elf_x86_64_efi.lds
-cmd_barebox__ ?= $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_barebox) -o $@ \
- -T $(lds-y) \
- -shared -Bsymbolic -znocombreloc \
- --whole-archive $(BAREBOX_OBJS) \
- --no-whole-archive \
- $(filter-out $(BAREBOX_LDS) $(BAREBOX_OBJS) FORCE ,$^)
-
quiet_cmd_efi_image = EFI-IMG $@
cmd_efi_image = $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
-j .dynsym -j .rel -j .rela -j .reloc -j __barebox_initcalls \