1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:18:13 +00:00
serenity/Libraries/LibC/crt0_shared.cpp
Itamar 58c583f584 LibC: Add libc.so
We now compile everything with -static flag so libc.a would be use
2020-12-14 23:05:53 +01:00

32 lines
586 B
C++

#include <AK/Types.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/internals.h>
#include <unistd.h>
extern "C" {
int main(int, char**, char**);
extern void __libc_init();
extern void _init();
extern char** environ;
extern bool __environ_is_malloced;
int _start(int argc, char** argv, char** env);
int _start(int argc, char** argv, char** env)
{
// asm("int3");
environ = env;
__environ_is_malloced = false;
__libc_init();
// _init();
int status = main(argc, argv, environ);
return status;
}
}
void* __dso_handle = nullptr;