2021 pre-release
This commit is contained in:
parent
11059d5b6f
commit
a94708b3b5
42 changed files with 278 additions and 227 deletions
|
@ -1,3 +1,4 @@
|
|||
export CROSS_COMPILE := x86_64-linux-gnu-
|
||||
CFLAGS += -m32 -fno-pic -fno-omit-frame-pointer -march=i386
|
||||
CFLAGS += -fcf-protection=none # remove endbr32 in Ubuntu 20.04 with a CPU newer than Comet Lake
|
||||
ASFLAGS += -m32 -fno-pic
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
export CROSS_COMPILE := x86_64-linux-gnu-
|
||||
CFLAGS += -m64 -fPIC -mno-sse
|
||||
ASFLAGS += -m64 -fPIC
|
||||
LDFLAGS += -melf_x86_64
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
include $(AM_HOME)/scripts/isa/mips32.mk
|
||||
include $(AM_HOME)/scripts/platform/nemu.mk
|
||||
LDFLAGS += --defsym=_pmem_start=0x80000000
|
||||
|
|
|
@ -5,20 +5,20 @@ AM_SRCS := native/trm.c \
|
|||
native/vme.c \
|
||||
native/mpe.c \
|
||||
native/platform.c \
|
||||
native/native-input.c \
|
||||
native/native-timer.c \
|
||||
native/native-gpu.c \
|
||||
native/native-audio.c \
|
||||
native/ioe/input.c \
|
||||
native/ioe/timer.c \
|
||||
native/ioe/gpu.c \
|
||||
native/ioe/audio.c \
|
||||
|
||||
CFLAGS += -fpie
|
||||
ASFLAGS += -fpie -pie
|
||||
|
||||
image:
|
||||
@echo + LD "->" $(IMAGE_REL)
|
||||
@g++ -pie -o $(IMAGE) -Wl,--whole-archive $(LINKAGE) -Wl,-no-whole-archive -lSDL2
|
||||
@g++ -pie -o $(IMAGE) -Wl,--whole-archive $(LINKAGE) -Wl,-no-whole-archive -lSDL2 -ldl
|
||||
|
||||
run: image
|
||||
$(IMAGE)
|
||||
|
||||
gdb: image
|
||||
gdb -ex "handle SIGUSR1 SIGSEGV noprint nostop" $(IMAGE)
|
||||
gdb -ex "handle SIGUSR1 SIGUSR2 SIGSEGV noprint nostop" $(IMAGE)
|
||||
|
|
32
scripts/platform/nemu.ld
Normal file
32
scripts/platform/nemu.ld
Normal file
|
@ -0,0 +1,32 @@
|
|||
ENTRY(_start)
|
||||
|
||||
SECTIONS {
|
||||
/* _pmem_start and _entry_offset are defined in LDFLAGS */
|
||||
. = _pmem_start + _entry_offset;
|
||||
.text : {
|
||||
*(entry)
|
||||
*(.text*)
|
||||
}
|
||||
etext = .;
|
||||
_etext = .;
|
||||
.rodata : {
|
||||
*(.rodata*)
|
||||
}
|
||||
.data : {
|
||||
*(.data)
|
||||
}
|
||||
edata = .;
|
||||
_data = .;
|
||||
.bss : {
|
||||
_bss_start = .;
|
||||
*(.bss*)
|
||||
*(.sbss*)
|
||||
*(.scommon)
|
||||
}
|
||||
_stack_top = ALIGN(0x1000);
|
||||
. = _stack_top + 0x8000;
|
||||
_stack_pointer = .;
|
||||
end = .;
|
||||
_end = .;
|
||||
_heap_start = ALIGN(0x1000);
|
||||
}
|
|
@ -8,11 +8,10 @@ AM_SRCS := nemu/trm.c \
|
|||
nemu/isa/$(ISA)/trap.S \
|
||||
nemu/isa/$(ISA)/vme.c \
|
||||
nemu/mpe.c \
|
||||
nemu/isa/$(ISA)/boot/start.S
|
||||
nemu/isa/$(ISA)/start.S
|
||||
|
||||
CFLAGS += -fdata-sections -ffunction-sections
|
||||
LDFLAGS += -L $(AM_HOME)/am/src/nemu/scripts
|
||||
LDFLAGS += -T $(AM_HOME)/am/src/nemu/isa/$(ISA)/boot/loader.ld
|
||||
LDFLAGS += -T $(AM_HOME)/scripts/platform/nemu.ld --defsym=_entry_offset=0x100000
|
||||
LDFLAGS += --gc-sections -e _start
|
||||
NEMUFLAGS += -b -l $(shell dirname $(IMAGE).elf)/nemu-log.txt $(IMAGE).bin
|
||||
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
include $(AM_HOME)/scripts/isa/riscv32.mk
|
||||
include $(AM_HOME)/scripts/platform/nemu.mk
|
||||
LDFLAGS += --defsym=_pmem_start=0x80000000
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
include $(AM_HOME)/scripts/isa/riscv64.mk
|
||||
include $(AM_HOME)/scripts/platform/nemu.mk
|
||||
LDFLAGS += --defsym=_pmem_start=0x80000000
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
include $(AM_HOME)/scripts/isa/x86.mk
|
||||
CFLAGS += -mstringop-strategy=loop
|
||||
include $(AM_HOME)/scripts/platform/nemu.mk
|
||||
CFLAGS += -mstringop-strategy=loop
|
||||
LDFLAGS += --defsym=_pmem_start=0x0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue