From patchwork Fri Mar 27 13:52:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 244431 List-Id: U-Boot discussion From: trini at konsulko.com (Tom Rini) Date: Fri, 27 Mar 2020 09:52:00 -0400 Subject: [PATCH 1/3] riscv: Start using ldflags-y for 32/64bit LDFLAGS Message-ID: <20200327135202.16788-1-trini@konsulko.com> 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 Signed-off-by: Tom Rini Reviewed-by: Rick Chen --- 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 # -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