shithub: scc

Download patch

ref: 0d4f55130681433da88fd5334149c6a60619cec1
parent: d000fb37494007384c0cbe081ebd5bc488787bf1
author: Quentin Rameau <[email protected]>
date: Mon Mar 20 13:54:05 EDT 2017

[libc] Fix sys assembly generating awk script

We forgot to export symbols

--- 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)}
--- 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)}