Update libc

This commit is contained in:
Alex
2022-11-07 08:34:02 +02:00
parent a003ec0889
commit 68e65dd602
10 changed files with 98 additions and 1 deletions

View File

@ -1,4 +1,5 @@
build:
cp include/* ../out/system/include
make --quiet -C runtime build
make --quiet -C libgcc build
make --quiet -C src build

11
libc/include/dlfcn.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef __FENNIX_LIBC_DLFCN_H__
#define __FENNIX_LIBC_DLFCN_H__
#include <types.h>
void *dlopen(const char *filename, int flags);
void *dlsym(void *handle, const char *symbol);
int dlclose(void *handle);
char *dlerror(void);
#endif // !__FENNIX_LIBC_DLFCN_H__

View File

@ -0,0 +1,6 @@
#ifndef __FENNIX_LIBC_TYPES_H__
#define __FENNIX_LIBC_TYPES_H__
#define NULL ((void *)0)
#endif // !__FENNIX_LIBC_TYPES_H__

0
libc/runtime/crti.c Normal file
View File

0
libc/runtime/crtn.c Normal file
View File

23
libc/src/dlfcn.c Normal file
View File

@ -0,0 +1,23 @@
#include <dlfcn.h>
static char *error = "Not implemented";
__attribute__((weak)) void *dlopen(const char *filename, int flags)
{
return NULL;
}
__attribute__((weak)) void *dlsym(void *handle, const char *symbol)
{
return NULL;
}
__attribute__((weak)) int dlclose(void *handle)
{
return -1;
}
__attribute__((weak)) char *dlerror(void)
{
return error;
}