Rick Chen | f94c44e | 2017-12-26 13:55:52 +0800 | [diff] [blame] | 1 | # |
| 2 | # (C) Copyright 2000-2002 |
| 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | # |
| 5 | # Copyright (c) 2017 Microsemi Corporation. |
| 6 | # Padmarao Begari, Microsemi Corporation <padmarao.begari@microsemi.com> |
| 7 | # |
| 8 | # Copyright (C) 2017 Andes Technology Corporation |
| 9 | # Rick Chen, Andes Technology Corporation <rick@andestech.com> |
| 10 | # |
| 11 | # SPDX-License-Identifier: GPL-2.0+ |
| 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) |
| 22 | endif |
| 23 | |
| 24 | ifdef CONFIG_64BIT |
| 25 | PLATFORM_LDFLAGS += -m $(64bit-emul) |
| 26 | endif |
| 27 | |
| 28 | CONFIG_STANDALONE_LOAD_ADDR = 0x00000000 \ |
| 29 | -T $(srctree)/examples/standalone/riscv.lds |
| 30 | |
| 31 | PLATFORM_CPPFLAGS += -ffixed-gp -fpic |
| 32 | PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -gdwarf-2 |
| 33 | LDFLAGS_u-boot += --gc-sections -static -pie |