[PATCH 1/3] riscv: Start using ldflags-y for 32/64bit LDFLAGS

Tom Rini trini at konsulko.com
Fri Mar 27 14:52:00 CET 2020


To prepare to update our Kbuild logic, start switching some of our cases
of adding different bit/endian linker flags via ldflags-y

Cc: Rick Chen <rick at andestech.com>
Signed-off-by: Tom Rini <trini at konsulko.com>
---
 arch/riscv/config.mk | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/riscv/config.mk b/arch/riscv/config.mk
index 84654eb3ed87..df91a85f677f 100644
--- a/arch/riscv/config.mk
+++ b/arch/riscv/config.mk
@@ -10,16 +10,14 @@
 # Rick Chen, Andes Technology Corporation <rick at andestech.com>
 #
 
-32bit-emul		:= elf32lriscv
-64bit-emul		:= elf64lriscv
+ldflags-$(CONFIG_32BIT) := -m elf32lriscv
+ldflags-$(CONFIG_64BIT) := -m elf64lriscv
 
 ifdef CONFIG_32BIT
-PLATFORM_LDFLAGS	+= -m $(32bit-emul)
 EFI_LDS			:= elf_riscv32_efi.lds
 endif
 
 ifdef CONFIG_64BIT
-PLATFORM_LDFLAGS	+= -m $(64bit-emul)
 EFI_LDS			:= elf_riscv64_efi.lds
 endif
 
@@ -29,6 +27,7 @@ PLATFORM_CPPFLAGS	+= -ffixed-gp -fpic
 PLATFORM_RELFLAGS	+= -fno-common -gdwarf-2 -ffunction-sections \
 			   -fdata-sections
 LDFLAGS_u-boot		+= --gc-sections -static -pie
+PLATFORM_LDFLAGS	+= $(ldflags-y)
 
 EFI_CRT0		:= crt0_riscv_efi.o
 EFI_RELOC		:= reloc_riscv_efi.o
-- 
2.17.1



More information about the U-Boot mailing list