commit fccfbb69f099c1ca19fae1f62519e9be81e36da4
parent ced81155d46b83c9cc32008113bfc6bd47103ce2
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Wed, 6 Nov 2024 11:43:51 +0100
libc/arm: Fix build
There were several missed files, and the name of the configuration was
wrong.
Diffstat:
7 files changed, 207 insertions(+), 13 deletions(-)
diff --git a/include/bits/linux/arm/arch/inttypes.h b/include/bits/linux/arm/arch/inttypes.h
@@ -0,0 +1,181 @@
+#define PRId8 "hhd"
+#define PRIi8 "hhi"
+#define PRIo8 "hho"
+#define PRIu8 "hhu"
+#define PRIx8 "hhx"
+#define PRIX8 "hhX"
+
+#define PRId16 "hd"
+#define PRIi16 "hi"
+#define PRIo16 "ho"
+#define PRIu16 "hu"
+#define PRIx16 "hx"
+#define PRIX16 "hX"
+
+#define PRId32 "d"
+#define PRIi32 "i"
+#define PRIo32 "o"
+#define PRIu32 "u"
+#define PRIx32 "x"
+#define PRIX32 "X"
+
+#define PRId64 "lld"
+#define PRIi64 "lli"
+#define PRIo64 "llo"
+#define PRIu64 "llu"
+#define PRIx64 "llx"
+#define PRIX64 "llX"
+
+#define PRIdLEAST8 "hhd"
+#define PRIiLEAST8 "hhi"
+#define PRIoLEAST8 "hho"
+#define PRIuLEAST8 "hhu"
+#define PRIxLEAST8 "hhx"
+#define PRIXLEAST8 "hhX"
+
+#define PRIdLEAST16 "hd"
+#define PRIiLEAST16 "hi"
+#define PRIoLEAST16 "ho"
+#define PRIuLEAST16 "hu"
+#define PRIxLEAST16 "hx"
+#define PRIXLEAST16 "hX"
+
+#define PRIdLEAST32 "d"
+#define PRIiLEAST32 "i"
+#define PRIoLEAST32 "o"
+#define PRIuLEAST32 "u"
+#define PRIxLEAST32 "x"
+#define PRIXLEAST32 "X"
+
+#define PRIdLEAST64 "lld"
+#define PRIiLEAST64 "lli"
+#define PRIoLEAST64 "llo"
+#define PRIuLEAST64 "llu"
+#define PRIxLEAST64 "llx"
+#define PRIXLEAST64 "llX"
+
+#define PRIdFAST8 "hhd"
+#define PRIiFAST8 "hhi"
+#define PRIoFAST8 "hho"
+#define PRIuFAST8 "hhu"
+#define PRIxFAST8 "hhx"
+#define PRIXFAST8 "hhX"
+
+#define PRIdFAST16 "d"
+#define PRIiFAST16 "i"
+#define PRIoFAST16 "o"
+#define PRIuFAST16 "u"
+#define PRIxFAST16 "x"
+#define PRIXFAST16 "X"
+
+#define PRIdFAST32 "d"
+#define PRIiFAST32 "i"
+#define PRIoFAST32 "o"
+#define PRIuFAST32 "u"
+#define PRIxFAST32 "x"
+#define PRIXFAST32 "X"
+
+#define PRIdFAST64 "lld"
+#define PRIiFAST64 "lli"
+#define PRIoFAST64 "llo"
+#define PRIuFAST64 "llu"
+#define PRIxFAST64 "llx"
+#define PRIXFAST64 "llX"
+
+#define PRIdPTR "ld"
+#define PRIiPTR "li"
+#define PRIoPTR "lo"
+#define PRIuPTR "lu"
+#define PRIxPTR "lx"
+#define PRIXPTR "lX"
+
+#define PRIdMAX "lld"
+#define PRIiMAX "lli"
+#define PRIoMAX "llo"
+#define PRIuMAX "llu"
+#define PRIxMAX "llx"
+#define PRIXMAX "llX"
+
+#define SCNd8 "hhd"
+#define SCNi8 "hhi"
+#define SCNo8 "hho"
+#define SCNu8 "hhu"
+#define SCNx8 "hhx"
+
+#define SCNd16 "hd"
+#define SCNi16 "hi"
+#define SCNo16 "ho"
+#define SCNu16 "hu"
+#define SCNx16 "hx"
+
+#define SCNd32 "d"
+#define SCNi32 "i"
+#define SCNo32 "o"
+#define SCNu32 "u"
+#define SCNx32 "x"
+
+#define SCNd64 "lld"
+#define SCNi64 "lli"
+#define SCNo64 "llo"
+#define SCNu64 "llu"
+#define SCNx64 "llx"
+
+#define SCNdLEAST8 "hhd"
+#define SCNiLEAST8 "hhi"
+#define SCNoLEAST8 "hho"
+#define SCNuLEAST8 "hhu"
+#define SCNxLEAST8 "hhx"
+
+#define SCNdLEAST16 "hd"
+#define SCNiLEAST16 "hi"
+#define SCNoLEAST16 "ho"
+#define SCNuLEAST16 "hu"
+#define SCNxLEAST16 "hx"
+
+#define SCNdLEAST32 "d"
+#define SCNiLEAST32 "i"
+#define SCNoLEAST32 "o"
+#define SCNuLEAST32 "u"
+#define SCNxLEAST32 "x"
+
+#define SCNdLEAST64 "lld"
+#define SCNiLEAST64 "lli"
+#define SCNoLEAST64 "llo"
+#define SCNuLEAST64 "llu"
+#define SCNxLEAST64 "llx"
+
+#define SCNdFAST8 "hhd"
+#define SCNiFAST8 "hhi"
+#define SCNoFAST8 "hho"
+#define SCNuFAST8 "hhu"
+#define SCNxFAST8 "hhx"
+
+#define SCNdFAST16 "d"
+#define SCNiFAST16 "i"
+#define SCNoFAST16 "o"
+#define SCNuFAST16 "u"
+#define SCNxFAST16 "x"
+
+#define SCNdFAST32 "d"
+#define SCNiFAST32 "i"
+#define SCNoFAST32 "o"
+#define SCNuFAST32 "u"
+#define SCNxFAST32 "x"
+
+#define SCNdFAST64 "lld"
+#define SCNiFAST64 "lli"
+#define SCNoFAST64 "llo"
+#define SCNuFAST64 "llu"
+#define SCNxFAST64 "llx"
+
+#define SCNdPTR "ld"
+#define SCNiPTR "li"
+#define SCNoPTR "lo"
+#define SCNuPTR "lu"
+#define SCNxPTR "lx"
+
+#define SCNdMAX "lld"
+#define SCNiMAX "lli"
+#define SCNoMAX "llo"
+#define SCNuMAX "llu"
+#define SCNxMAX "llx"
diff --git a/include/bits/linux/arm/arch/sigaction.h b/include/bits/linux/arm/arch/sigaction.h
@@ -0,0 +1,10 @@
+#define SA_RESTORER 0x04000000
+
+struct sigaction {
+ void (*sa_handler)(int);
+ unsigned long sa_flags;
+ void (*sa_restorer)(void);
+ unsigned sa_mask[2];
+};
+
+extern int __sigaction(int, struct sigaction *, struct sigaction *, size_t);
diff --git a/scripts/build/conf/arm-linux.mk b/scripts/build/conf/arm-linux.mk
@@ -0,0 +1,5 @@
+ABI = sysv
+ARCH = arm
+SYS = linux
+FORMAT = elf
+O = 5l
diff --git a/scripts/build/conf/arm32-linux.mk b/scripts/build/conf/arm32-linux.mk
@@ -1,5 +0,0 @@
-ABI = sysv
-ARCH = arm32
-SYS = linux
-FORMAT = elf
-O = 5l
diff --git a/scripts/libc-dirs b/scripts/libc-dirs
@@ -5,7 +5,7 @@ lib
lib/scc
lib/scc/ppc32-linux
lib/scc/i386-linux
-lib/scc/arm32-linux
+lib/scc/arm-linux
lib/scc/arm64-linux
lib/scc/amd64-freebsd
lib/scc/amd64-netbsd
diff --git a/src/libc/arch/arm/linux/.gitignore b/src/libc/arch/arm/linux/.gitignore
@@ -1,13 +1,16 @@
+__sigaction.s
_access.s
-_exit.s
_brk.s
_close.s
+_execve.s
+_exit.s
_fork.s
_getpid.s
_kill.s
_lseek.s
_openat.s
_read.s
+_sys_brk.s
_sys_errlist.c
_wait4.s
_write.s
diff --git a/src/libc/arch/arm/linux/Makefile b/src/libc/arch/arm/linux/Makefile
@@ -15,7 +15,7 @@ GENOBJS =\
_lseek.$O\
_openat.$O\
_read.$O\
- _sigaction.$O\
+ __sigaction.$O\
_sys_brk.$O\
_write.$O\
_wait4.$O\
@@ -29,11 +29,11 @@ OBJS =\
all: $(OBJS) $(CRT)
-crt.o: ../crt-posix.s
+$(CRT): ../crt-posix.s
-$(GENSRC): syscall.lst
- ./gensys.sh $(@:.s=)
+$(GENOBJS): syscall.lst
+ ./gensys.sh $(@:.$O=)
+ $(AS) $(PROJ_ASFLAGS) -o $@ $(@:.$O=.s)
clean:
- rm -f $(GENSRC)
- rm -f syscall _sys_errlist.c
+ rm -f $(GENOBJS:.$O=.s) _sys_errlist.c