shithub: scc

Download patch

ref: adf887a13b0155f3dae1a7fd2191d6f021b91709
parent: 1024de144473fe71b7b8bf85954e112a612c42b1
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Jun 19 12:57:19 EDT 2020

libc: Rename arm32 to arm

This name is more extended and it creates less problems when
interacting with other toolchains.

--- /dev/null
+++ b/include/bits/arm/arch/cdefs.h
@@ -1,0 +1,30 @@
+#ifdef _NEED_SIZET
+#ifndef _SIZET
+typedef unsigned long size_t;
+#define _SIZET
+#endif
+#undef _NEED_SIZET
+#endif
+
+#ifdef _NEED_PTRDIFFT
+#ifndef _PTRDIFFT
+typedef long ptrdiff_t;
+#define _PTRDIFFT
+#endif
+#undef _NEED_PTRDIFFT
+#endif
+
+#ifdef _NEED_NULL
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif
+#undef _NEED_NULL
+#endif
+
+#ifdef _NEED_WCHART
+#ifndef _WCHART
+typedef int wchar_t;
+#define _WCHART
+#endif
+#undef _NEED_WCHART
+#endif
--- /dev/null
+++ b/include/bits/arm/arch/limits.h
@@ -1,0 +1,18 @@
+#define CHAR_BIT   8
+#define SCHAR_MAX  0x7F
+#define SCHAR_MIN  (-SCHAR_MAX - 1)
+#define CHAR_MAX   0x7F
+#define CHAR_MIN   (-CHAR_MAX - 1)
+#define UCHAR_MAX  0xFF
+#define SHRT_MAX   0x7FFF
+#define SHRT_MIN   (-SHRT_MAX - 1)
+#define USHRT_MAX  0xFFFF
+#define INT_MAX    0x7FFFFFFF
+#define INT_MIN    (-INT_MAX - 1)
+#define UINT_MAX   0xFFFFFFFF
+#define LONG_MAX   0x7FFFFFFF
+#define LONG_MIN   (-LONG_MAX - 1)
+#define ULONG_MAX  0xFFFFFFFF
+#define LLONG_MAX  0x7FFFFFFFFFFFFFFF
+#define LLONG_MIN  (-LLONG_MAX - 1)
+#define ULLONG_MAX 0xFFFFFFFFFFFFFFFF
--- /dev/null
+++ b/include/bits/arm/arch/setjmp.h
@@ -1,0 +1,1 @@
+typedef unsigned long jmp_buf[10];
--- /dev/null
+++ b/include/bits/arm/arch/stdint.h
@@ -1,0 +1,96 @@
+#define INT8_MAX  0x7F
+#define INT8_MIN  (-INT8_MAX - 1)
+#define UINT8_MAX 0xFF
+
+#define INT16_MAX  0x7FFF
+#define INT16_MIN  (-INT16_MAX - 1)
+#define UINT16_MAX 0xFFFF
+
+#define INT32_MAX  0x7FFFFFFF
+#define INT32_MIN  (-INT32_MAX - 1)
+#define UINT32_MAX 0xFFFFFFFF
+
+#define INT64_MAX  0x7FFFFFFFFFFFFFFF
+#define INT64_MIN  (-INT64_MAX - 1)
+#define UINT64_MAX 0xFFFFFFFFFFFFFFFF
+
+#define INT_LEAST8_MIN  INT8_MIN
+#define INT_LEAST8_MAX  INT8_MAX
+#define UINT_LEAST8_MAX UINT8_MAX
+
+#define INT_LEAST16_MIN  INT16_MIN
+#define INT_LEAST16_MAX  INT16_MAX
+#define UINT_LEAST16_MAX UINT16_MAX
+
+#define INT_LEAST32_MIN  INT32_MIN
+#define INT_LEAST32_MAX  INT32_MAX
+#define UINT_LEAST32_MAX UINT32_MAX
+
+#define INT_LEAST64_MIN  INT64_MIN
+#define INT_LEAST64_MAX  INT64_MAX
+#define UINT_LEAST64_MAX UINT64_MAX
+
+#define INT_FAST8_MIN  INT32_MIN
+#define INT_FAST8_MAX  INT32_MAX
+#define UINT_FAST8_MAX UINT32_MAX
+
+#define INT_FAST16_MIN  INT32_MIN
+#define INT_FAST16_MAX  INT32_MAX
+#define UINT_FAST16_MAX UINT32_MAX
+
+#define INT_FAST32_MIN  INT32_MIN
+#define INT_FAST32_MAX  INT32_MAX
+#define UINT_FAST32_MAX UINT32_MAX
+
+#define INT_FAST64_MIN  INT64_MIN
+#define INT_FAST64_MAX  INT64_MAX
+#define UINT_FAST64_MAX UINT64_MAX
+
+#define INTPTR_MIN  INT32_MIN
+#define INTPTR_MAX  INT32_MAX
+#define UINTPTR_MAX UINT32_MAX
+
+#define INTMAX_MIN  INT64_MIN
+#define INTMAX_MAX  INT64_MAX
+#define UINTMAX_MAX UINT64_MAX
+
+#define PTRDIFF_MIN INT32_MIN
+#define PTRDIFF_MAX INT32_MAX
+
+#define SIZE_MAX UINT32_MAX
+
+typedef signed char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+typedef long long int64_t;
+
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+typedef unsigned long long uint64_t;
+
+typedef signed char int8_least_t;
+typedef short int16_least_t;
+typedef int int32_least_t;
+typedef long long int64_least_t;
+
+typedef unsigned char uint8_least_t;
+typedef unsigned short uint16_least_t;
+typedef unsigned int uint32_least_t;
+typedef unsigned long long uint64_least_t;
+
+typedef int int8_fast_t;
+typedef int int16_fast_t;
+typedef int int32_fast_t;
+typedef long long int64_fast_t;
+
+typedef unsigned int uint8_fast_t;
+typedef unsigned int uint16_fast_t;
+typedef unsigned int uint32_fast_t;
+typedef unsigned long long uint64_fast_t;
+
+typedef long intptr_t;
+typedef unsigned long uintptr_t;
+
+typedef long long intmax_t;
+typedef unsigned long long uintmax_t;
--- /dev/null
+++ b/include/bits/arm/arch/stdio.h
@@ -1,0 +1,10 @@
+#define BUFSIZ        512
+#define FILENAME_MAX  256
+#define FOPEN_MAX      16
+
+#define TMP_MAX        25
+#define L_tmpnam      256
+
+#define _TMPNAME      "/tmp/tmp.0000000"
+
+typedef int fpos_t;
--- /dev/null
+++ b/include/bits/arm/arch/stdlib.h
@@ -1,0 +1,4 @@
+#define EXIT_FAILURE 1
+#define EXIT_SUCCESS 0
+
+#define _ALIGNTYPE long double
--- /dev/null
+++ b/include/bits/arm/arch/string.h
@@ -1,0 +1,1 @@
+#define __NUMCHARS 128
--- /dev/null
+++ b/include/bits/arm/arch/time.h
@@ -1,0 +1,3 @@
+#define _MAXYEAR 9999
+
+typedef long int time_t;
--- a/include/bits/arm32/arch/cdefs.h
+++ /dev/null
@@ -1,30 +1,0 @@
-#ifdef _NEED_SIZET
-#ifndef _SIZET
-typedef unsigned long size_t;
-#define _SIZET
-#endif
-#undef _NEED_SIZET
-#endif
-
-#ifdef _NEED_PTRDIFFT
-#ifndef _PTRDIFFT
-typedef long ptrdiff_t;
-#define _PTRDIFFT
-#endif
-#undef _NEED_PTRDIFFT
-#endif
-
-#ifdef _NEED_NULL
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-#undef _NEED_NULL
-#endif
-
-#ifdef _NEED_WCHART
-#ifndef _WCHART
-typedef int wchar_t;
-#define _WCHART
-#endif
-#undef _NEED_WCHART
-#endif
--- a/include/bits/arm32/arch/limits.h
+++ /dev/null
@@ -1,18 +1,0 @@
-#define CHAR_BIT   8
-#define SCHAR_MAX  0x7F
-#define SCHAR_MIN  (-SCHAR_MAX - 1)
-#define CHAR_MAX   0x7F
-#define CHAR_MIN   (-CHAR_MAX - 1)
-#define UCHAR_MAX  0xFF
-#define SHRT_MAX   0x7FFF
-#define SHRT_MIN   (-SHRT_MAX - 1)
-#define USHRT_MAX  0xFFFF
-#define INT_MAX    0x7FFFFFFF
-#define INT_MIN    (-INT_MAX - 1)
-#define UINT_MAX   0xFFFFFFFF
-#define LONG_MAX   0x7FFFFFFF
-#define LONG_MIN   (-LONG_MAX - 1)
-#define ULONG_MAX  0xFFFFFFFF
-#define LLONG_MAX  0x7FFFFFFFFFFFFFFF
-#define LLONG_MIN  (-LLONG_MAX - 1)
-#define ULLONG_MAX 0xFFFFFFFFFFFFFFFF
--- a/include/bits/arm32/arch/setjmp.h
+++ /dev/null
@@ -1,1 +1,0 @@
-typedef unsigned long jmp_buf[10];
--- a/include/bits/arm32/arch/stdint.h
+++ /dev/null
@@ -1,96 +1,0 @@
-#define INT8_MAX  0x7F
-#define INT8_MIN  (-INT8_MAX - 1)
-#define UINT8_MAX 0xFF
-
-#define INT16_MAX  0x7FFF
-#define INT16_MIN  (-INT16_MAX - 1)
-#define UINT16_MAX 0xFFFF
-
-#define INT32_MAX  0x7FFFFFFF
-#define INT32_MIN  (-INT32_MAX - 1)
-#define UINT32_MAX 0xFFFFFFFF
-
-#define INT64_MAX  0x7FFFFFFFFFFFFFFF
-#define INT64_MIN  (-INT64_MAX - 1)
-#define UINT64_MAX 0xFFFFFFFFFFFFFFFF
-
-#define INT_LEAST8_MIN  INT8_MIN
-#define INT_LEAST8_MAX  INT8_MAX
-#define UINT_LEAST8_MAX UINT8_MAX
-
-#define INT_LEAST16_MIN  INT16_MIN
-#define INT_LEAST16_MAX  INT16_MAX
-#define UINT_LEAST16_MAX UINT16_MAX
-
-#define INT_LEAST32_MIN  INT32_MIN
-#define INT_LEAST32_MAX  INT32_MAX
-#define UINT_LEAST32_MAX UINT32_MAX
-
-#define INT_LEAST64_MIN  INT64_MIN
-#define INT_LEAST64_MAX  INT64_MAX
-#define UINT_LEAST64_MAX UINT64_MAX
-
-#define INT_FAST8_MIN  INT32_MIN
-#define INT_FAST8_MAX  INT32_MAX
-#define UINT_FAST8_MAX UINT32_MAX
-
-#define INT_FAST16_MIN  INT32_MIN
-#define INT_FAST16_MAX  INT32_MAX
-#define UINT_FAST16_MAX UINT32_MAX
-
-#define INT_FAST32_MIN  INT32_MIN
-#define INT_FAST32_MAX  INT32_MAX
-#define UINT_FAST32_MAX UINT32_MAX
-
-#define INT_FAST64_MIN  INT64_MIN
-#define INT_FAST64_MAX  INT64_MAX
-#define UINT_FAST64_MAX UINT64_MAX
-
-#define INTPTR_MIN  INT32_MIN
-#define INTPTR_MAX  INT32_MAX
-#define UINTPTR_MAX UINT32_MAX
-
-#define INTMAX_MIN  INT64_MIN
-#define INTMAX_MAX  INT64_MAX
-#define UINTMAX_MAX UINT64_MAX
-
-#define PTRDIFF_MIN INT32_MIN
-#define PTRDIFF_MAX INT32_MAX
-
-#define SIZE_MAX UINT32_MAX
-
-typedef signed char int8_t;
-typedef short int16_t;
-typedef int int32_t;
-typedef long long int64_t;
-
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned int uint32_t;
-typedef unsigned long long uint64_t;
-
-typedef signed char int8_least_t;
-typedef short int16_least_t;
-typedef int int32_least_t;
-typedef long long int64_least_t;
-
-typedef unsigned char uint8_least_t;
-typedef unsigned short uint16_least_t;
-typedef unsigned int uint32_least_t;
-typedef unsigned long long uint64_least_t;
-
-typedef int int8_fast_t;
-typedef int int16_fast_t;
-typedef int int32_fast_t;
-typedef long long int64_fast_t;
-
-typedef unsigned int uint8_fast_t;
-typedef unsigned int uint16_fast_t;
-typedef unsigned int uint32_fast_t;
-typedef unsigned long long uint64_fast_t;
-
-typedef long intptr_t;
-typedef unsigned long uintptr_t;
-
-typedef long long intmax_t;
-typedef unsigned long long uintmax_t;
--- a/include/bits/arm32/arch/stdio.h
+++ /dev/null
@@ -1,10 +1,0 @@
-#define BUFSIZ        512
-#define FILENAME_MAX  256
-#define FOPEN_MAX      16
-
-#define TMP_MAX        25
-#define L_tmpnam      256
-
-#define _TMPNAME      "/tmp/tmp.0000000"
-
-typedef int fpos_t;
--- a/include/bits/arm32/arch/stdlib.h
+++ /dev/null
@@ -1,4 +1,0 @@
-#define EXIT_FAILURE 1
-#define EXIT_SUCCESS 0
-
-#define _ALIGNTYPE long double
--- a/include/bits/arm32/arch/string.h
+++ /dev/null
@@ -1,1 +1,0 @@
-#define __NUMCHARS 128
--- a/include/bits/arm32/arch/time.h
+++ /dev/null
@@ -1,3 +1,0 @@
-#define _MAXYEAR 9999
-
-typedef long int time_t;
--- a/src/libc/arch/Makefile
+++ b/src/libc/arch/Makefile
@@ -5,8 +5,8 @@
 
 DIRS =\
 	amd64\
-	arm32\
 	arm64\
+	arm\
 	i386\
 	ppc\
 
--- /dev/null
+++ b/src/libc/arch/arm/Makefile
@@ -1,0 +1,30 @@
+.POSIX:
+PROJECTDIR =../../../..
+include $(PROJECTDIR)/scripts/rules.mk
+include ../../rules.mk
+
+OBJS =\
+	longjmp.$O\
+	setjmp.$O\
+	memchr.$O\
+	memcmp.$O\
+	memcpy.$O\
+	memmove.$O\
+	memset.$O\
+
+DIRS = linux
+
+all: $(LIBC) $(SYS)
+
+$(LIBC): $(OBJS)
+	$(MKLST)
+
+$(SYS): FORCE
+	+@cd $@ && $(MAKE)
+
+dep: inc-dep
+
+dep clean:
+	$(FORALL)
+
+include deps.mk
--- /dev/null
+++ b/src/libc/arch/arm/crt-posix.s
@@ -1,0 +1,14 @@
+	.globl	_environ
+	.comm	_environ,4,4
+
+	.text
+	.globl	_start
+_start:
+	ldr	r0,[sp]		/* argc */
+	add	r1,sp,#4	/* argv */
+	add	r2,r1,r0,lsl #2	/* argv = argc + 4*argc + 4 */
+	add	r2,r2,#4
+	ldr	r3,=_environ
+	str	r2,[r3]
+	bl	main
+	b	exit
--- /dev/null
+++ b/src/libc/arch/arm/deps.mk
@@ -1,0 +1,13 @@
+#deps
+./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
+./linux/raise.o: ./linux/../../posix/raise.c
+./linux/signal.o: ./linux/../../posix/signal.c
+./linux/time.o: ./linux/../../posix/time.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
--- /dev/null
+++ b/src/libc/arch/arm/linux/.gitignore
@@ -1,0 +1,10 @@
+_Exit.s
+_brk.s
+_close.s
+_getpid.s
+_kill.s
+_lseek.s
+_openat.s
+_read.s
+_sys_errlist.c
+_write.s
--- /dev/null
+++ b/src/libc/arch/arm/linux/Makefile
@@ -1,0 +1,48 @@
+.POSIX:
+PROJECTDIR =../../../../..
+include $(PROJECTDIR)/scripts/rules.mk
+include ../../../rules.mk
+
+GENOBJS =\
+	_Exit.$O\
+	_close.$O\
+	_brk.$O\
+	_getpid.$O\
+	_kill.$O\
+	_lseek.$O\
+	_openat.$O\
+	_read.$O\
+	_write.$O\
+	_sigaction.$O\
+
+GENSRC = $(GENOBJS:.$O=.s)
+
+OBJS =\
+	$(GENOBJS)\
+	_cerrno.$O\
+	_getheap.$O\
+	_open.$O\
+	_tzone.$O\
+	getenv.$O\
+	raise.$O\
+	signal.$O\
+	time.$O\
+	_sys_errlist.$O\
+
+all: $(LIBC) $(CRT)
+
+$(LIBC): $(OBJS)
+	$(MKLST)
+
+crt.o: ../crt-posix.s
+
+$(GENSRC): syscall.lst
+	gensys.sh $(@:.s=)
+
+dep: inc-dep
+
+clean:
+	rm -f $(GENSRC)
+	rm -f syscall _sys_errlist.c
+
+include deps.mk
--- /dev/null
+++ b/src/libc/arch/arm/linux/_cerrno.s
@@ -1,0 +1,14 @@
+	.file	"_cerrno.s"
+	.globl	_cerrno
+
+_cerrno:
+	cmp	r0,#0
+	blt	1f
+	bx	lr
+
+1:
+	neg	r0,r0
+	ldr	r1,=errno
+	str	r0,[r1]
+	mov	r0,#-1
+	bx	lr
--- /dev/null
+++ b/src/libc/arch/arm/linux/_getheap.c
@@ -1,0 +1,1 @@
+#include "../../linux/_getheap.c"
--- /dev/null
+++ b/src/libc/arch/arm/linux/_open.c
@@ -1,0 +1,13 @@
+#include <stddef.h>
+
+#include "../../../syscall.h"
+
+#define AT_FDCWD  -100
+
+extern int _openat(int fd, const char *fname, int flags, int mode);
+
+int
+_open(const char *fname, int flags)
+{
+	return _openat(AT_FDCWD, fname, flags, mode);
+}
--- /dev/null
+++ b/src/libc/arch/arm/linux/_tzone.c
@@ -1,0 +1,1 @@
+#include "../../posix/_tzone.c"
--- /dev/null
+++ b/src/libc/arch/arm/linux/crt.s
@@ -1,0 +1,1 @@
+	.include	"../crt-posix.s"
--- /dev/null
+++ b/src/libc/arch/arm/linux/deps.mk
@@ -1,0 +1,8 @@
+#deps
+./_getheap.o: ./../../linux/_getheap.c
+./_open.o: ./../../../syscall.h
+./_tzone.o: ./../../posix/_tzone.c
+./getenv.o: ./../../posix/getenv.c
+./raise.o: ./../../posix/raise.c
+./signal.o: ./../../posix/signal.c
+./time.o: ./../../posix/time.c
--- /dev/null
+++ b/src/libc/arch/arm/linux/gensys.sh
@@ -1,0 +1,20 @@
+#!/bin/sh
+
+sed -n "
+     s/[ 	]*#.*//
+     /$1/p" syscall.lst |
+while read num name
+do
+cat <<EOF > $name.s
+	.file	"$name.s"
+
+	.globl	$name
+	.arm
+$name:
+	push	{r7,lr}
+	ldr	r7,=$num
+	swi	0
+	pop	{r7,lr}
+	b	_cerrno
+EOF
+done
--- /dev/null
+++ b/src/libc/arch/arm/linux/getenv.c
@@ -1,0 +1,1 @@
+#include "../../posix/getenv.c"
--- /dev/null
+++ b/src/libc/arch/arm/linux/raise.c
@@ -1,0 +1,1 @@
+#include "../../posix/raise.c"
--- /dev/null
+++ b/src/libc/arch/arm/linux/signal.c
@@ -1,0 +1,1 @@
+#include "../../posix/signal.c"
--- /dev/null
+++ b/src/libc/arch/arm/linux/syscall.lst
@@ -1,0 +1,11 @@
+#number name
+322	_openat
+6	_close
+3	_read
+4	_write
+1	_Exit
+20	_getpid
+37	_kill
+19	_lseek
+45	_brk
+134	_sigaction
--- /dev/null
+++ b/src/libc/arch/arm/linux/time.c
@@ -1,0 +1,1 @@
+#include "../../posix/time.c"
--- /dev/null
+++ b/src/libc/arch/arm/longjmp.s
@@ -1,0 +1,11 @@
+	.file   "longjmp.s"
+
+	.text
+	.globl	longjmp
+longjmp:
+	ldmia	r0, {r4-r11, sp, lr}
+
+	// If r1 is 0 return 1 instead
+	movs	r0, r1
+	moveq	r0, #1
+	bx	lr
--- /dev/null
+++ b/src/libc/arch/arm/memchr.c
@@ -1,0 +1,1 @@
+#include "../../string/memchr.c"
--- /dev/null
+++ b/src/libc/arch/arm/memcmp.c
@@ -1,0 +1,1 @@
+#include "../../string/memcmp.c"
--- /dev/null
+++ b/src/libc/arch/arm/memcpy.c
@@ -1,0 +1,1 @@
+#include "../../string/memcpy.c"
--- /dev/null
+++ b/src/libc/arch/arm/memmove.c
@@ -1,0 +1,1 @@
+#include "../../string/memmove.c"
--- /dev/null
+++ b/src/libc/arch/arm/memset.c
@@ -1,0 +1,1 @@
+#include "../../string/memset.c"
--- /dev/null
+++ b/src/libc/arch/arm/setjmp.s
@@ -1,0 +1,9 @@
+	.file   "setjmp.s"
+
+	.text
+	.globl	setjmp
+setjmp:
+	// IHI0042F_aapcs.pdf 5.1.1 callee saved registers
+	stmia	r0, {r4-r11, sp, lr}
+	mov	r0, #0
+	bx	lr
--- a/src/libc/arch/arm32/Makefile
+++ /dev/null
@@ -1,30 +1,0 @@
-.POSIX:
-PROJECTDIR =../../../..
-include $(PROJECTDIR)/scripts/rules.mk
-include ../../rules.mk
-
-OBJS =\
-	longjmp.$O\
-	setjmp.$O\
-	memchr.$O\
-	memcmp.$O\
-	memcpy.$O\
-	memmove.$O\
-	memset.$O\
-
-DIRS = linux
-
-all: $(LIBC) $(SYS)
-
-$(LIBC): $(OBJS)
-	$(MKLST)
-
-$(SYS): FORCE
-	+@cd $@ && $(MAKE)
-
-dep: inc-dep
-
-dep clean:
-	$(FORALL)
-
-include deps.mk
--- a/src/libc/arch/arm32/crt-posix.s
+++ /dev/null
@@ -1,14 +1,0 @@
-	.globl	_environ
-	.comm	_environ,4,4
-
-	.text
-	.globl	_start
-_start:
-	ldr	r0,[sp]		/* argc */
-	add	r1,sp,#4	/* argv */
-	add	r2,r1,r0,lsl #2	/* argv = argc + 4*argc + 4 */
-	add	r2,r2,#4
-	ldr	r3,=_environ
-	str	r2,[r3]
-	bl	main
-	b	exit
--- a/src/libc/arch/arm32/deps.mk
+++ /dev/null
@@ -1,13 +1,0 @@
-#deps
-./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
-./linux/raise.o: ./linux/../../posix/raise.c
-./linux/signal.o: ./linux/../../posix/signal.c
-./linux/time.o: ./linux/../../posix/time.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/arm32/linux/.gitignore
+++ /dev/null
@@ -1,10 +1,0 @@
-_Exit.s
-_brk.s
-_close.s
-_getpid.s
-_kill.s
-_lseek.s
-_openat.s
-_read.s
-_sys_errlist.c
-_write.s
--- a/src/libc/arch/arm32/linux/Makefile
+++ /dev/null
@@ -1,48 +1,0 @@
-.POSIX:
-PROJECTDIR =../../../../..
-include $(PROJECTDIR)/scripts/rules.mk
-include ../../../rules.mk
-
-GENOBJS =\
-	_Exit.$O\
-	_close.$O\
-	_brk.$O\
-	_getpid.$O\
-	_kill.$O\
-	_lseek.$O\
-	_openat.$O\
-	_read.$O\
-	_write.$O\
-	_sigaction.$O\
-
-GENSRC = $(GENOBJS:.$O=.s)
-
-OBJS =\
-	$(GENOBJS)\
-	_cerrno.$O\
-	_getheap.$O\
-	_open.$O\
-	_tzone.$O\
-	getenv.$O\
-	raise.$O\
-	signal.$O\
-	time.$O\
-	_sys_errlist.$O\
-
-all: $(LIBC) $(CRT)
-
-$(LIBC): $(OBJS)
-	$(MKLST)
-
-crt.o: ../crt-posix.s
-
-$(GENSRC): syscall.lst
-	gensys.sh $(@:.s=)
-
-dep: inc-dep
-
-clean:
-	rm -f $(GENSRC)
-	rm -f syscall _sys_errlist.c
-
-include deps.mk
--- a/src/libc/arch/arm32/linux/_cerrno.s
+++ /dev/null
@@ -1,14 +1,0 @@
-	.file	"_cerrno.s"
-	.globl	_cerrno
-
-_cerrno:
-	cmp	r0,#0
-	blt	1f
-	bx	lr
-
-1:
-	neg	r0,r0
-	ldr	r1,=errno
-	str	r0,[r1]
-	mov	r0,#-1
-	bx	lr
--- a/src/libc/arch/arm32/linux/_getheap.c
+++ /dev/null
@@ -1,1 +1,0 @@
-#include "../../linux/_getheap.c"
--- a/src/libc/arch/arm32/linux/_open.c
+++ /dev/null
@@ -1,13 +1,0 @@
-#include <stddef.h>
-
-#include "../../../syscall.h"
-
-#define AT_FDCWD  -100
-
-extern int _openat(int fd, const char *fname, int flags, int mode);
-
-int
-_open(const char *fname, int flags)
-{
-	return _openat(AT_FDCWD, fname, flags, mode);
-}
--- a/src/libc/arch/arm32/linux/_tzone.c
+++ /dev/null
@@ -1,1 +1,0 @@
-#include "../../posix/_tzone.c"
--- a/src/libc/arch/arm32/linux/crt.s
+++ /dev/null
@@ -1,1 +1,0 @@
-	.include	"../crt-posix.s"
--- a/src/libc/arch/arm32/linux/deps.mk
+++ /dev/null
@@ -1,8 +1,0 @@
-#deps
-./_getheap.o: ./../../linux/_getheap.c
-./_open.o: ./../../../syscall.h
-./_tzone.o: ./../../posix/_tzone.c
-./getenv.o: ./../../posix/getenv.c
-./raise.o: ./../../posix/raise.c
-./signal.o: ./../../posix/signal.c
-./time.o: ./../../posix/time.c
--- a/src/libc/arch/arm32/linux/gensys.sh
+++ /dev/null
@@ -1,20 +1,0 @@
-#!/bin/sh
-
-sed -n "
-     s/[ 	]*#.*//
-     /$1/p" syscall.lst |
-while read num name
-do
-cat <<EOF > $name.s
-	.file	"$name.s"
-
-	.globl	$name
-	.arm
-$name:
-	push	{r7,lr}
-	ldr	r7,=$num
-	swi	0
-	pop	{r7,lr}
-	b	_cerrno
-EOF
-done
--- a/src/libc/arch/arm32/linux/getenv.c
+++ /dev/null
@@ -1,1 +1,0 @@
-#include "../../posix/getenv.c"
--- a/src/libc/arch/arm32/linux/raise.c
+++ /dev/null
@@ -1,1 +1,0 @@
-#include "../../posix/raise.c"
--- a/src/libc/arch/arm32/linux/signal.c
+++ /dev/null
@@ -1,1 +1,0 @@
-#include "../../posix/signal.c"
--- a/src/libc/arch/arm32/linux/syscall.lst
+++ /dev/null
@@ -1,11 +1,0 @@
-#number name
-322	_openat
-6	_close
-3	_read
-4	_write
-1	_Exit
-20	_getpid
-37	_kill
-19	_lseek
-45	_brk
-134	_sigaction
--- a/src/libc/arch/arm32/linux/time.c
+++ /dev/null
@@ -1,1 +1,0 @@
-#include "../../posix/time.c"
--- a/src/libc/arch/arm32/longjmp.s
+++ /dev/null
@@ -1,11 +1,0 @@
-	.file   "longjmp.s"
-
-	.text
-	.globl	longjmp
-longjmp:
-	ldmia	r0, {r4-r11, sp, lr}
-
-	// If r1 is 0 return 1 instead
-	movs	r0, r1
-	moveq	r0, #1
-	bx	lr
--- a/src/libc/arch/arm32/memchr.c
+++ /dev/null
@@ -1,1 +1,0 @@
-#include "../../string/memchr.c"
--- a/src/libc/arch/arm32/memcmp.c
+++ /dev/null
@@ -1,1 +1,0 @@
-#include "../../string/memcmp.c"
--- a/src/libc/arch/arm32/memcpy.c
+++ /dev/null
@@ -1,1 +1,0 @@
-#include "../../string/memcpy.c"
--- a/src/libc/arch/arm32/memmove.c
+++ /dev/null
@@ -1,1 +1,0 @@
-#include "../../string/memmove.c"
--- a/src/libc/arch/arm32/memset.c
+++ /dev/null
@@ -1,1 +1,0 @@
-#include "../../string/memset.c"
--- a/src/libc/arch/arm32/setjmp.s
+++ /dev/null
@@ -1,9 +1,0 @@
-	.file   "setjmp.s"
-
-	.text
-	.globl	setjmp
-setjmp:
-	// IHI0042F_aapcs.pdf 5.1.1 callee saved registers
-	stmia	r0, {r4-r11, sp, lr}
-	mov	r0, #0
-	bx	lr
--- /dev/null
+++ b/src/libcrt/arm/Makefile
@@ -1,0 +1,11 @@
+.POSIX:
+PROJECTDIR=../../..
+include $(PROJECTDIR)/scripts/rules.mk
+
+OBJS = dummy.o
+TARGET = $(LIBCDIR)/libcrt.a
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS)
+	mklib -o $@ $?
--- a/src/libcrt/arm32/Makefile
+++ /dev/null
@@ -1,11 +1,0 @@
-.POSIX:
-PROJECTDIR=../../..
-include $(PROJECTDIR)/scripts/rules.mk
-
-OBJS = dummy.o
-TARGET = $(LIBCDIR)/libcrt.a
-
-all: $(TARGET)
-
-$(TARGET): $(OBJS)
-	mklib -o $@ $?