Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0+ |
Rick Chen | f94c44e | 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 | f94c44e | 2017-12-26 13:55:52 +0800 | [diff] [blame] | 12 | |
Rick Chen | f94c44e | 2017-12-26 13:55:52 +0800 | [diff] [blame] | 13 | 32bit-emul := elf32lriscv |
| 14 | 64bit-emul := elf64lriscv |
| 15 | |
| 16 | ifdef CONFIG_32BIT |
Tom Rini | 587e4a4 | 2020-03-27 11:46:27 -0400 | [diff] [blame] | 17 | KBUILD_LDFLAGS += -m $(32bit-emul) |
Alexander Graf | 493d1e8 | 2018-04-23 07:59:45 +0200 | [diff] [blame] | 18 | EFI_LDS := elf_riscv32_efi.lds |
Samuel Holland | 04d16be | 2023-02-20 00:02:39 -0600 | [diff] [blame] | 19 | PLATFORM_ELFFLAGS += -B riscv -O elf32-littleriscv |
Rick Chen | f94c44e | 2017-12-26 13:55:52 +0800 | [diff] [blame] | 20 | endif |
| 21 | |
| 22 | ifdef CONFIG_64BIT |
Tom Rini | 587e4a4 | 2020-03-27 11:46:27 -0400 | [diff] [blame] | 23 | KBUILD_LDFLAGS += -m $(64bit-emul) |
Alexander Graf | 493d1e8 | 2018-04-23 07:59:45 +0200 | [diff] [blame] | 24 | EFI_LDS := elf_riscv64_efi.lds |
Samuel Holland | 04d16be | 2023-02-20 00:02:39 -0600 | [diff] [blame] | 25 | PLATFORM_ELFFLAGS += -B riscv -O elf64-littleriscv |
Rick Chen | f94c44e | 2017-12-26 13:55:52 +0800 | [diff] [blame] | 26 | endif |
| 27 | |
kleines Filmröllchen | ee9f9d6 | 2024-01-25 15:06:59 +0100 | [diff] [blame] | 28 | PLATFORM_CPPFLAGS += -ffixed-x3 -fpic |
Bin Meng | db9a7e5 | 2023-04-07 13:44:59 +0800 | [diff] [blame] | 29 | PLATFORM_RELFLAGS += -fno-common -ffunction-sections -fdata-sections |
Bin Meng | ce7a8e0 | 2018-09-26 06:55:13 -0700 | [diff] [blame] | 30 | LDFLAGS_u-boot += --gc-sections -static -pie |
Alexander Graf | 493d1e8 | 2018-04-23 07:59:45 +0200 | [diff] [blame] | 31 | |
| 32 | EFI_CRT0 := crt0_riscv_efi.o |
| 33 | EFI_RELOC := reloc_riscv_efi.o |