-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.mk
71 lines (51 loc) · 1.67 KB
/
config.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
### Build config
# Output directory
outdir = build
### Target information
# Platform?
PLATFORM = linux
# App script to run at startup
APP = shell
# 64-bit or 32-bit system?
XLEN = 64
# Processor supports compressed instructions?
RVC = y
# Build flat binary?
FLAT_BINARY = n
# Generate position-independent executable?
PIE = n
# Note: Indirect threaded code has a *lot* of relocations. If PIE=y, consider
# using LLD and turning on either -z pack-relative-relocs (LLD >= 15) or
# --pack-dyn-relocs=relr to save on space.
# Start Address of flat binary
START_ADDR =
# (Depends on FLAT_BINARY=y)
### Build details
# Platform-specific initialization code
INIT_OBJ = init_$(PLATFORM).o
# Scripts to run at boot
SCRIPTS = bootstrap.five drivers_$(PLATFORM).five utils.five $(APP).five
### Toolchain
# Tools to use when building
# - The "assembler" needs to be a C compiler, as we do use the C preprocessor.
# - The linker needs to support creating RISC-V binaries.
# - If FLAT_BINARY=y, objcopy to convert ELF to flat binary
AS = clang --target=riscv$(XLEN)-unknown-linux-gnu
LD = ld.lld
OBJCOPY = llvm-objcopy
# Note: LLD < 15 does not support object files created -mrelax. If using an old
# LLD, add -mno-relax to ASFLAGS below.
# GNU toolchain from Nixpkgs
# AS = riscv$(XLEN)-unknown-linux-gnu-gcc
# LD = riscv$(XLEN)-unknown-linux-gnu-ld
# OBJCOPY = riscv$(XLEN)-unknown-linux-gnu-objcopy
# GNU toolchain from Ubuntu
# AS = riscv$(XLEN)-linux-gnu-gcc
# LD = riscv$(XLEN)-linux-gnu-ld
# OBJCOPY = riscv$(XLEN)-linux-gnu-objcopy
### Options
# Flags to pass to "assembler"
# ASFLAGS += -mno-relax
# Flags to pass to linker
# LDFLAGS += --pack-dyn-relocs=relr
# LDFLAGS += -z pack-relative-relocs