Compare commits

...

3 Commits

Author SHA1 Message Date
Bananymous cbe835a2c8 DynamicLoader: Add missing strlen definition 2026-03-23 18:23:31 +02:00
Bananymous 6a77754adf LibC: Don't link against libstdc++
This prevented building the toolchain
2026-03-23 18:22:42 +02:00
Bananymous 7d7d5ba734 LibC: Compile eventfd file 2026-03-23 18:22:04 +02:00
3 changed files with 13 additions and 2 deletions

View File

@ -43,6 +43,7 @@ set(LIBC_SOURCES
strings.cpp
sys/banan-os.cpp
sys/epoll.cpp
sys/eventfd.cpp
sys/file.cpp
sys/futex.cpp
sys/ioctl.cpp
@ -99,8 +100,8 @@ banan_install_headers(objlibc)
add_library(libc-static STATIC $<TARGET_OBJECTS:objlibc>)
add_library(libc-shared SHARED $<TARGET_OBJECTS:objlibc>)
target_link_options(libc-static PRIVATE -nolibc)
target_link_options(libc-shared PRIVATE -nolibc)
target_link_options(libc-static PRIVATE -nolibc -nostdlib++)
target_link_options(libc-shared PRIVATE -nolibc -nostdlib++)
install(TARGETS libc-static OPTIONAL)
install(TARGETS libc-shared OPTIONAL)

View File

@ -28,6 +28,14 @@ static const char* errno_to_string(int error);
__builtin_unreachable();
}
size_t strlen(const char* s)
{
size_t len = 0;
while (*s++)
len++;
return len;
}
int strcmp(const char* s1, const char* s2)
{
const unsigned char* u1 = reinterpret_cast<const unsigned char*>(s1);

View File

@ -40,6 +40,8 @@ inline void print_uint(int fd, T val, uint8_t base = 10)
print(fd, ptr);
}
size_t strlen(const char* s);
int strcmp(const char* s1, const char* s2);
char* strcpy(char* __restrict s1, const char* __restrict s2);