blob: a7448e2095aa5f531f720c602019472aae46942b [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001# SPDX-License-Identifier: GPL-2.0+
Rick Chen64d4ead2017-12-26 13:55:52 +08002#
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 Chen64d4ead2017-12-26 13:55:52 +080012
13ifeq ($(CROSS_COMPILE),)
14CROSS_COMPILE := riscv32-unknown-linux-gnu-
15endif
16
1732bit-emul := elf32lriscv
1864bit-emul := elf64lriscv
19
20ifdef CONFIG_32BIT
21PLATFORM_LDFLAGS += -m $(32bit-emul)
22endif
23
24ifdef CONFIG_64BIT
25PLATFORM_LDFLAGS += -m $(64bit-emul)
26endif
27
28CONFIG_STANDALONE_LOAD_ADDR = 0x00000000 \
29 -T $(srctree)/examples/standalone/riscv.lds
30
31PLATFORM_CPPFLAGS += -ffixed-gp -fpic
32PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -gdwarf-2
33LDFLAGS_u-boot += --gc-sections -static -pie