blob: 717aedaadea818edbdf883639fde818005d0199f (
plain)
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
|
# -*- makefile -*-
#
# arch/riscv64/MCONFIG
#
# Special rules for this architecture. Note that this is actually
# included from the main Makefile, and that pathnames should be
# accordingly.
#
KLIBCOPTFLAGS += -Os -fomit-frame-pointer
ifeq ($(DEBUG),y)
KLIBCOPTFLAGS += -g
endif
KLIBCBITSIZE = 64
# Normal binaries start at 64 kiB. Jumps can use either a single
# instruction with offset of ±1 MiB, or two instructions with offset
# of ±2 GiB. Putting klibc.so close above the executable can cause
# breakage, so instead swap them around: klibc.so at 64 kiB and
# executable at 576 kiB.
KLIBCLDFLAGS = $(LD_IMAGE_BASE_OPT) 0x90000
KLIBCSHAREDFLAGS = $(LD_IMAGE_BASE_OPT) 0x10000
KLIBCSHAREDFLAGS += --defsym '__global_pointer$$=0'
# Kernel has never used stack trampolines
KLIBCEXECSTACK := n
KLIBCEMAIN := -e _main
KLIBCCRTSHARED += $(KLIBCOBJ)/arch/riscv64/_main.o
|