shithub: scc

Download patch

ref: b4cc34ebf056ddefd94a30f954950439463e67a9
parent: 5dbde374a62f0923bc720ca3f42884cd7340ef96
parent: a033c20344b9ee8a761e3da0320f931c05bf88d1
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Jun 1 03:05:48 EDT 2020

Merge remote-tracking branch 'origin/master'

diff: cannot open b/src/libc/arch/linux//null: file does not exist: 'b/src/libc/arch/linux//null' diff: cannot open b/src/libc/arch/netbsd//null: file does not exist: 'b/src/libc/arch/netbsd//null' diff: cannot open b/src/libc/arch/openbsd//null: file does not exist: 'b/src/libc/arch/openbsd//null'
--- a/src/libc/arch/amd64/deps.mk
+++ b/src/libc/arch/amd64/deps.mk
@@ -10,7 +10,7 @@
 ./dragonfly/raise.o: ./dragonfly/../../posix/raise.c
 ./dragonfly/signal.o: ./dragonfly/../../posix/signal.c
 ./dragonfly/time.o: ./dragonfly/../../posix/time.c
-./linux/_getheap.o: ./linux/../../posix/_getheap.c
+./linux/_getheap.o: ./linux/../../linux/_getheap.c
 ./linux/_tzone.o: ./linux/../../posix/_tzone.c
 ./linux/getenv.o: ./linux/../../posix/getenv.c
 ./linux/raise.o: ./linux/../../posix/raise.c
--- a/src/libc/arch/amd64/linux/_getheap.c
+++ b/src/libc/arch/amd64/linux/_getheap.c
@@ -1,1 +1,1 @@
-#include "../../posix/_getheap.c"
+#include "../../linux/_getheap.c"
--- a/src/libc/arch/amd64/linux/deps.mk
+++ b/src/libc/arch/amd64/linux/deps.mk
@@ -1,5 +1,5 @@
 #deps
-./_getheap.o: ./../../posix/_getheap.c
+./_getheap.o: ./../../linux/_getheap.c
 ./_tzone.o: ./../../posix/_tzone.c
 ./getenv.o: ./../../posix/getenv.c
 ./raise.o: ./../../posix/raise.c
--- a/src/libc/arch/amd64/netbsd/Makefile
+++ b/src/libc/arch/amd64/netbsd/Makefile
@@ -34,7 +34,7 @@
 $(LIBC): $(OBJS)
 	$(MKLST)
 
-crt.$O: ../crt-posix.s ../../crt-netbsd.s
+crt.$O: ../crt-posix.s ../netbsd/crt.s
 
 $(GENSRC): syscall.lst
 	gensys.sh $(@:.s=)
--- a/src/libc/arch/amd64/netbsd/crt.s
+++ b/src/libc/arch/amd64/netbsd/crt.s
@@ -1,2 +1,2 @@
-	.include	"../../crt-netbsd.s"
+	.include	"../../netbsd/crt.s"
 	.include	"../crt-posix.s"
--- a/src/libc/arch/amd64/openbsd/Makefile
+++ b/src/libc/arch/amd64/openbsd/Makefile
@@ -32,7 +32,7 @@
 $(LIBC): $(OBJS)
 	$(MKLST)
 
-crt.$O: ../crt-posix.s ../../crt-openbsd.s
+crt.$O: ../crt-posix.s ../openbsd/crt.s
 
 $(GENSRC): syscall.lst
 	gensys.sh $(@:.s=)
--- a/src/libc/arch/amd64/openbsd/crt.s
+++ b/src/libc/arch/amd64/openbsd/crt.s
@@ -1,2 +1,2 @@
-	.include	"../../crt-openbsd.s"
+	.include	"../../openbsd/crt.s"
 	.include	"../crt-posix.s"
--- a/src/libc/arch/arm32/deps.mk
+++ b/src/libc/arch/arm32/deps.mk
@@ -1,5 +1,5 @@
 #deps
-./linux/_getheap.o: ./linux/../../posix/_getheap.c
+./linux/_getheap.o: ./linux/../../linux/_getheap.c
 ./linux/_open.o: ./linux/../../../syscall.h
 ./linux/_tzone.o: ./linux/../../posix/_tzone.c
 ./linux/getenv.o: ./linux/../../posix/getenv.c
--- a/src/libc/arch/arm32/linux/_getheap.c
+++ b/src/libc/arch/arm32/linux/_getheap.c
@@ -1,1 +1,1 @@
-#include "../../posix/_getheap.c"
+#include "../../linux/_getheap.c"
--- a/src/libc/arch/arm32/linux/deps.mk
+++ b/src/libc/arch/arm32/linux/deps.mk
@@ -1,5 +1,5 @@
 #deps
-./_getheap.o: ./../../posix/_getheap.c
+./_getheap.o: ./../../linux/_getheap.c
 ./_open.o: ./../../../syscall.h
 ./_tzone.o: ./../../posix/_tzone.c
 ./getenv.o: ./../../posix/getenv.c
--- a/src/libc/arch/arm64/deps.mk
+++ b/src/libc/arch/arm64/deps.mk
@@ -1,5 +1,5 @@
 #deps
-./linux/_getheap.o: ./linux/../../posix/_getheap.c
+./linux/_getheap.o: ./linux/../../linux/_getheap.c
 ./linux/_open.o: ./linux/../../../syscall.h
 ./linux/_tzone.o: ./linux/../../posix/_tzone.c
 ./linux/getenv.o: ./linux/../../posix/getenv.c
--- a/src/libc/arch/arm64/linux/_getheap.c
+++ b/src/libc/arch/arm64/linux/_getheap.c
@@ -1,1 +1,1 @@
-#include "../../posix/_getheap.c"
+#include "../../linux/_getheap.c"
--- a/src/libc/arch/crt-netbsd.s
+++ /dev/null
@@ -1,9 +1,0 @@
-	.file	"crt-netbsd.s"
-	.section	".note.netbsd.ident", "a"
-	.p2align	2
-
-	.long	7
-	.long	4
-	.long	1
-	.ascii	"NetBSD\0\0"
-	.long	800000000
--- a/src/libc/arch/crt-openbsd.s
+++ /dev/null
@@ -1,9 +1,0 @@
-	.file	"crt-openbsd.s"
-	.section	".note.openbsd.ident", "a"
-	.p2align	2
-	.long	8
-	.long	4
-	.long	1
-	.ascii	"OpenBSD\0"
-	.long	0
-	.p2align	2
--- a/src/libc/arch/i386/deps.mk
+++ b/src/libc/arch/i386/deps.mk
@@ -1,5 +1,5 @@
 #deps
-./linux/_getheap.o: ./linux/../../posix/_getheap.c
+./linux/_getheap.o: ./linux/../../linux/_getheap.c
 ./linux/raise.o: ./linux/../../posix/raise.c
 ./linux/signal.o: ./linux/../../posix/signal.c
 ./memchr.o: ./../../string/memchr.c
--- a/src/libc/arch/i386/linux/_getheap.c
+++ b/src/libc/arch/i386/linux/_getheap.c
@@ -1,1 +1,1 @@
-#include "../../posix/_getheap.c"
+#include "../../linux/_getheap.c"
--- a/src/libc/arch/i386/linux/deps.mk
+++ b/src/libc/arch/i386/linux/deps.mk
@@ -1,4 +1,4 @@
 #deps
-./_getheap.o: ./../../posix/_getheap.c
+./_getheap.o: ./../../linux/_getheap.c
 ./raise.o: ./../../posix/raise.c
 ./signal.o: ./../../posix/signal.c
--- /dev/null
+++ b/src/libc/arch/linux/_getheap.c
@@ -1,0 +1,10 @@
+#include <stddef.h>
+
+#include "../../libc.h"
+#include "../../syscall.h"
+
+void *
+_getheap(void)
+{
+	return _brk(0);
+}
--- /dev/null
+++ b/src/libc/arch/netbsd/crt.s
@@ -1,0 +1,9 @@
+	.file	"crt-netbsd.s"
+	.section	".note.netbsd.ident", "a"
+	.p2align	2
+
+	.long	7
+	.long	4
+	.long	1
+	.ascii	"NetBSD\0\0"
+	.long	800000000
--- /dev/null
+++ b/src/libc/arch/openbsd/crt.s
@@ -1,0 +1,9 @@
+	.file	"crt-openbsd.s"
+	.section	".note.openbsd.ident", "a"
+	.p2align	2
+	.long	8
+	.long	4
+	.long	1
+	.ascii	"OpenBSD\0"
+	.long	0
+	.p2align	2
--- a/src/libc/arch/ppc32/deps.mk
+++ b/src/libc/arch/ppc32/deps.mk
@@ -1,1 +1,7 @@
 #deps
+./linux/_getheap.o: ./linux/../../linux/_getheap.c
+./memchr.o: ./../../string/memchr.c
+./memcmp.o: ./../../string/memcmp.c
+./memcpy.o: ./../../string/memcpy.c
+./memmove.o: ./../../string/memmove.c
+./memset.o: ./../../string/memset.c
--- a/src/libc/arch/ppc32/linux/_getheap.c
+++ b/src/libc/arch/ppc32/linux/_getheap.c
@@ -1,1 +1,1 @@
-#include "../../posix/_getheap.c"
+#include "../../linux/_getheap.c"
--- a/src/libc/arch/ppc32/linux/deps.mk
+++ b/src/libc/arch/ppc32/linux/deps.mk
@@ -1,1 +1,2 @@
 #deps
+./_getheap.o: ./../../linux/_getheap.c