Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0+ |
Rick Chen | 64d4ead | 2017-12-26 13:55:52 +0800 | [diff] [blame] | 2 | # |
| 3 | # (C) Copyright 2000-2002 |
| 4 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 5 | # |
| 6 | # Copyright (c) 2017 Microsemi Corporation. |
| 7 | # Padmarao Begari, Microsemi Corporation <padmarao.begari@microsemi.com> |
| 8 | # |
| 9 | # Copyright (C) 2017 Andes Technology Corporation |
| 10 | # Rick Chen, Andes Technology Corporation <rick@andestech.com> |
| 11 | # |
Rick Chen | 64d4ead | 2017-12-26 13:55:52 +0800 | [diff] [blame] | 12 | |
| 13 | ifeq ($(CROSS_COMPILE),) |
| 14 | CROSS_COMPILE := riscv32-unknown-linux-gnu- |
| 15 | endif |
| 16 | |
| 17 | 32bit-emul := elf32lriscv |
| 18 | 64bit-emul := elf64lriscv |
| 19 | |
| 20 | ifdef CONFIG_32BIT |
| 21 | PLATFORM_LDFLAGS += -m $(32bit-emul) |
Alexander Graf | 31bdde9 | 2018-04-23 07:59:45 +0200 | [diff] [blame] | 22 | EFI_LDS := elf_riscv32_efi.lds |
Rick Chen | 64d4ead | 2017-12-26 13:55:52 +0800 | [diff] [blame] | 23 | endif |
| 24 | |
| 25 | ifdef CONFIG_64BIT |
| 26 | PLATFORM_LDFLAGS += -m $(64bit-emul) |
Alexander Graf | 31bdde9 | 2018-04-23 07:59:45 +0200 | [diff] [blame] | 27 | EFI_LDS := elf_riscv64_efi.lds |
Rick Chen | 64d4ead | 2017-12-26 13:55:52 +0800 | [diff] [blame] | 28 | endif |
| 29 | |
| 30 | CONFIG_STANDALONE_LOAD_ADDR = 0x00000000 \ |
| 31 | -T $(srctree)/examples/standalone/riscv.lds |
| 32 | |
| 33 | PLATFORM_CPPFLAGS += -ffixed-gp -fpic |
Alexander Graf | a5dc563 | 2018-04-23 07:59:44 +0200 | [diff] [blame] | 34 | PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -gdwarf-2 -ffunction-sections |
Rick Chen | 64d4ead | 2017-12-26 13:55:52 +0800 | [diff] [blame] | 35 | LDFLAGS_u-boot += --gc-sections -static -pie |
Alexander Graf | 31bdde9 | 2018-04-23 07:59:45 +0200 | [diff] [blame] | 36 | |
| 37 | EFI_CRT0 := crt0_riscv_efi.o |
| 38 | EFI_RELOC := reloc_riscv_efi.o |