diff mbox series

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

Message ID 20200327135202.16788-1-trini@konsulko.com
State New
Headers show
Series [1/3] riscv: Start using ldflags-y for 32/64bit LDFLAGS | expand

Commit Message

Tom Rini March 27, 2020, 1:52 p.m. UTC
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(-)

Comments

Rick Chen March 30, 2020, 3:01 a.m. UTC | #1
> From: Tom Rini [mailto:trini at konsulko.com]
> Sent: Friday, March 27, 2020 9:52 PM
> To: u-boot at lists.denx.de
> Cc: Rick Jian-Zhi Chen(???)
> Subject: [PATCH 1/3] riscv: Start using ldflags-y for 32/64bit LDFLAGS
>
> 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(-)

Reviewed-by: Rick Chen <rick at andestech.com>
.
diff mbox series

Patch

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