shithub: scc

Download patch

ref: bbe0d56677276a42a3061a3580b8b2b325b8f109
parent: 2a24067b42a1f7673dab2bb6ed476a728e69af13
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sun Sep 2 15:31:48 EDT 2018

[lib/c] Apply changes for OpenBSD

Again, more changes are expected.

--- a/lib/c/target/amd64-sysv-linux/Makefile
+++ b/lib/c/target/amd64-sysv-linux/Makefile
@@ -8,7 +8,7 @@
 ABI        = sysv
 SYSOBJ     = raise.o signal.o
 SYSERRTBL  = ../posix/linux.e
-MORECFLAGS = -g -static -nostdinc
+MORECFLAGS = -std=c99 -g -static -nostdinc
 
 include syscall.mk
 include ../script/objlst.mk
--- a/lib/c/target/amd64-sysv-netbsd/Makefile
+++ b/lib/c/target/amd64-sysv-netbsd/Makefile
@@ -8,7 +8,7 @@
 ABI        = sysv
 SYSOBJ     = raise.o signal.o _sigaction.o _sigaction2.o _setcontext.o
 SYSERRTBL  = ../posix/netbsd.e
-MORECFLAGS = -g -static -nostdinc
+MORECFLAGS = -std=c99 -g -static -nostdinc
 
 include syscall.mk
 include ../script/objlst.mk
--- a/lib/c/target/amd64-sysv-openbsd/Makefile
+++ b/lib/c/target/amd64-sysv-openbsd/Makefile
@@ -8,7 +8,7 @@
 ABI        = sysv
 SYSOBJ     = raise.o signal.o _sigaction.o
 SYSERRTBL  = ../posix/netbsd.e
-MORECFLAGS = -g -static -nostdinc
+MORECFLAGS = -std=c99 -g -static -nostdinc -fno-stack-protector --freestanding
 
 include syscall.mk
 include ../script/objlst.mk
--- a/tests/libc/execute/cc.sh
+++ b/tests/libc/execute/cc.sh
@@ -42,5 +42,5 @@
 	pie=-nopie
 fi
 
-gcc -g -w $pie -fno-stack-protector --freestanding -std=c99 -static -nostdinc -I$inc -I$arch_inc -c $1
+gcc -std=c99 -g -w $pie -fno-stack-protector --freestanding -std=c99 -static -nostdinc -I$inc -I$arch_inc -c $1
 ld -g $pie -z nodefaultlib -static -L$lib $lib/crt.o $obj -lc -o $out