Compiling lua without a C standard library
This commit is contained in:
parent
8a7e8d6240
commit
0960df714d
2 changed files with 18 additions and 3 deletions
14
libc/include/string.h
Normal file
14
libc/include/string.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
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);
|
||||
|
|
@ -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=
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue