aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-05-12 00:36:18 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2023-05-12 00:36:18 +0300
commit4cde8bceb1ff14896884c224850f6c7611551175 (patch)
tree50242259fb7b66179e461b8ede554fdc5b99ef70 /arch
parente52d9de585ed7cb1482ab142911d1c6d3e486955 (diff)
downloadkmi-4cde8bceb1ff14896884c224850f6c7611551175.tar.gz
kmi-4cde8bceb1ff14896884c224850f6c7611551175.zip
fix LLVM compilation
+ RELEASE=1 doesn't work for some reason, though
Diffstat (limited to 'arch')
-rw-r--r--arch/riscv64/conf/init-link.S7
-rw-r--r--arch/riscv64/init/start.S7
-rw-r--r--arch/riscv64/kernel/entry.S1
-rw-r--r--arch/riscv64/source.mk10
4 files changed, 3 insertions, 22 deletions
diff --git a/arch/riscv64/conf/init-link.S b/arch/riscv64/conf/init-link.S
index 0933fbb..2f48814 100644
--- a/arch/riscv64/conf/init-link.S
+++ b/arch/riscv64/conf/init-link.S
@@ -15,7 +15,7 @@ SECTIONS {
final binary
*/
.text ALIGN(4K) : AT(0) {
- *(.init.start)
+ *(.init*)
*(.text*);
}
@@ -31,10 +31,7 @@ SECTIONS {
*(.sbss*) *(.bss*) *(COMMON)
}
- .top : {
- *(.top*)
- }
-
+ __kernel = .;
__kernel_size = <KERNEL_SIZE>;
.garbage : {
diff --git a/arch/riscv64/init/start.S b/arch/riscv64/init/start.S
index 759c409..7439d93 100644
--- a/arch/riscv64/init/start.S
+++ b/arch/riscv64/init/start.S
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: copyleft-next-0.3.1 */
/* Copyright 2021 - 2022, Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
-.section .init.start
+.section .init
.global _start
/* Entry point to the kernel loader. */
_start:
@@ -20,8 +20,3 @@ li sp, VM_STACK_TOP // load virtual stack address
li fp, 0
li gp, 0
jr a2 // jump to kernel
-
-/* there should be a kernel payload after this address */
-.section .top
-.global __kernel
-__kernel:
diff --git a/arch/riscv64/kernel/entry.S b/arch/riscv64/kernel/entry.S
index fe25854..5331385 100644
--- a/arch/riscv64/kernel/entry.S
+++ b/arch/riscv64/kernel/entry.S
@@ -14,7 +14,6 @@
/* very much based on linux, but why change it if works, eh? */
.section .text
-.align 4
.global handle_irq
handle_irq:
csrrw tp, CSR_SSCRATCH, tp
diff --git a/arch/riscv64/source.mk b/arch/riscv64/source.mk
index 5de5309..321ba7c 100644
--- a/arch/riscv64/source.mk
+++ b/arch/riscv64/source.mk
@@ -4,16 +4,6 @@ INIT_SOURCES += $(ARCH_SOURCE)/init/*.[cS]
# this doesn't work for rv32, but fine for now */
ARCH_CFLAGS := -mcmodel=medany
-ARCH_LDFLAGS := -fuse-ld=bfd
-
-# slightly hacky but bfd is currently the only compiler that correctly handles
-# riscv relocations, but it doesn't recognise LLVM lto files, so if we're
-# doing an LLVM compilation, remove lto support
-DEBUGFLAGS != [ $(LLVM) ] && echo $(DEBUGFLAGS:-flto=) || echo $(DEBUGFLAGS)
-
-# llvm-objcopy is buggy, use gnu tools instead
-# christ, not much LLVM tooling available for RISCV :D
-OBJCOPY := $(CROSS_COMPILE)objcopy
run:
$(ARCH_SOURCE)/conf/mkimage.sh $(ARCH)