scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 5b0a7f2d9d0a0a08a898e3937c780c25be43c032
parent 56fa97c0542ea683fdc3c88549e6e1690bfe0878
Author: Quentin Rameau <quinq@fifth.space>
Date:   Mon, 20 Mar 2017 17:54:05 +0100

[libc] Fix sys assembly generating awk script

We forgot to export symbols

Diffstat:
Mlibc/src/sys/amd64-sysv-linux/syscall.awk | 10+++++++++-
Mlibc/src/sys/qbe-linux/syscall.awk | 5+++--
2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/libc/src/sys/amd64-sysv-linux/syscall.awk b/libc/src/sys/amd64-sysv-linux/syscall.awk @@ -1,4 +1,12 @@ +# This job is very easy because app and kernel ABI are identical +# until the 4th parameter, so we only have to set the syscall +# number in rax + /^#/ {next} {name=$2 ".s" - printf "%s:\n\tmov\t%d,%%rax\n\tsyscall\n\tret\n",$2, $1 > name + printf ".global %s\n" \ + "%s:\n" \ + "\tmovq\t$%d,%%rax\n" \ + "\tsyscall\n" \ + "\tret\n", $2, $2, $1 > name close(name)} diff --git a/libc/src/sys/qbe-linux/syscall.awk b/libc/src/sys/qbe-linux/syscall.awk @@ -4,8 +4,9 @@ /^#/ {next} {name=$2 ".s" - printf "%s:\n" \ + printf ".global %s\n" \ + "%s:\n" \ "\tmovq\t$%d,%%rax\n" \ "\tsyscall\n" \ - "\tret\n",$2, $1 > name + "\tret\n", $2, $2, $1 > name close(name)}