Implement arithmetic negation

This commit is contained in:
2025-09-02 18:52:08 +02:00
parent 44fa140769
commit bea73ceb78
3 changed files with 404 additions and 101 deletions

View File

@@ -6,7 +6,6 @@
require 'open3'
require 'rake/clean'
CROSS_GCC = '../eugenios/build/rootfs/bin/riscv32-unknown-linux-gnu-gcc'
SYSROOT = '../eugenios/build/sysroot'
QEMU = 'qemu-riscv32'
STAGES = Dir.glob('boot/stage*.elna').collect { |stage| File.basename stage, '.elna' }.sort
@@ -16,6 +15,10 @@ CLEAN.include 'build/boot', 'build/valid'
directory 'build/boot'
directory 'build/valid'
def compile(input, output)
sh ENV.fetch('CC', 'gcc'), '-nostdlib', '-o', output, input
end
task default: :boot
desc 'Final stage'
@@ -47,7 +50,7 @@ end
rule /^build\/[[:alpha:]]+\/stage[[:digit:]]+$/ => ->(match) {
"#{match}.s"
} do |t|
sh CROSS_GCC, '-nostdlib', '-o', t.name, *t.prerequisites
compile(*t.prerequisites, t.name)
end
STAGES.each do |stage|
@@ -91,5 +94,5 @@ end
file 'build/boot/stage1' => ['build/boot', 'boot/stage1.s'] do |t|
source = t.prerequisites.select { |prerequisite| prerequisite.end_with? '.s' }
sh CROSS_GCC, '-nostdlib', '-o', t.name, *source
compile(*source, t.name)
end