blob: 9cf2aef0a41589eef4980fd01165126a246918cd [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
Rick Chen64d4ead2017-12-26 13:55:52 +08001332bit-emul := elf32lriscv
1464bit-emul := elf64lriscv
15
16ifdef CONFIG_32BIT
Tom Rini5d4ecf22020-03-27 11:46:27 -040017KBUILD_LDFLAGS += -m $(32bit-emul)
Alexander Graf31bdde92018-04-23 07:59:45 +020018EFI_LDS := elf_riscv32_efi.lds
Samuel Hollandb1d24362023-02-20 00:02:39 -060019PLATFORM_ELFFLAGS += -B riscv -O elf32-littleriscv
Rick Chen64d4ead2017-12-26 13:55:52 +080020endif
21
22ifdef CONFIG_64BIT
Tom Rini5d4ecf22020-03-27 11:46:27 -040023KBUILD_LDFLAGS += -m $(64bit-emul)
Alexander Graf31bdde92018-04-23 07:59:45 +020024EFI_LDS := elf_riscv64_efi.lds
Samuel Hollandb1d24362023-02-20 00:02:39 -060025PLATFORM_ELFFLAGS += -B riscv -O elf64-littleriscv
Rick Chen64d4ead2017-12-26 13:55:52 +080026endif
27
Rick Chen64d4ead2017-12-26 13:55:52 +080028PLATFORM_CPPFLAGS += -ffixed-gp -fpic
Bin Meng722618e2023-04-07 13:44:59 +080029PLATFORM_RELFLAGS += -fno-common -ffunction-sections -fdata-sections
Bin Menge2ff9182018-09-26 06:55:13 -070030LDFLAGS_u-boot += --gc-sections -static -pie
Alexander Graf31bdde92018-04-23 07:59:45 +020031
32EFI_CRT0 := crt0_riscv_efi.o
33EFI_RELOC := reloc_riscv_efi.o