diff --git a/libc/include/string.h b/libc/include/string.h new file mode 100644 index 0000000..a39ab0e --- /dev/null +++ b/libc/include/string.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +char *strchr(const char *s, int c); +int strcmp(const char *s1, const char *s2); +char *strcpy(char *restrict d, const char *restrict s); +size_t strlen(const char *s); +size_t strspn(const char *s, const char *a); +char *strpbrk(const char *s, const char *a); +int strcoll(const char *s1, const char *s2); + +void *memcpy(void *restrict dest, const void *restrict src, size_t n); +int memcmp(const void *s1, const void *s2, size_t n); diff --git a/lua/src/Makefile b/lua/src/Makefile index 7a09f27..43dfdc1 100644 --- a/lua/src/Makefile +++ b/lua/src/Makefile @@ -6,8 +6,9 @@ # Your platform. See PLATS for possible values. PLAT= generic -CC= gcc -std=gnu99 -CFLAGS= -O2 -Wall -Wextra $(SYSCFLAGS) $(MYCFLAGS) +CROSS_PATH = /home/thomas/karlos/gcc-14.2.0-nolibc/x86_64-linux/bin +CC = $(CROSS_PATH)/x86_64-linux-gcc +CFLAGS= -std=gnu99 -O2 -Wall -Wextra $(SYSCFLAGS) $(MYCFLAGS) LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS) LIBS= -lm $(SYSLIBS) $(MYLIBS) @@ -16,7 +17,7 @@ RANLIB= ranlib RM= rm -f UNAME= uname -SYSCFLAGS= +SYSCFLAGS=-nostdlib -ffreestanding -fpic -fno-stack-protector -fno-stack-check -fshort-wchar -mno-red-zone -maccumulate-outgoing-args -I ../../libc/include SYSLDFLAGS= SYSLIBS=