aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/sysdeps/dripos/generic/entry.cpp
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-07 17:28:52 -0500
committerIan Moffett <ian@osmora.org>2024-03-07 18:24:51 -0500
commitf5e48e94a2f4d4bbd6e5628c7f2afafc6dbcc459 (patch)
tree93b156621dc0303816b37f60ba88051b702d92f6 /lib/mlibc/sysdeps/dripos/generic/entry.cpp
parentbd5969fc876a10b18613302db7087ef3c40f18e1 (diff)
build: Build mlibc + add distclean target
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/sysdeps/dripos/generic/entry.cpp')
-rw-r--r--lib/mlibc/sysdeps/dripos/generic/entry.cpp35
1 files changed, 0 insertions, 35 deletions
diff --git a/lib/mlibc/sysdeps/dripos/generic/entry.cpp b/lib/mlibc/sysdeps/dripos/generic/entry.cpp
deleted file mode 100644
index 2b8b914..0000000
--- a/lib/mlibc/sysdeps/dripos/generic/entry.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <bits/ensure.h>
-#include <mlibc/elf/startup.h>
-
-// defined by the POSIX library
-void __mlibc_initLocale();
-
-extern "C" uintptr_t *__dlapi_entrystack();
-
-extern char **environ;
-static mlibc::exec_stack_data __mlibc_stack_data;
-
-struct LibraryGuard {
- LibraryGuard();
-};
-
-static LibraryGuard guard;
-
-LibraryGuard::LibraryGuard() {
- __mlibc_initLocale();
-
- // Parse the exec() stack.
- mlibc::parse_exec_stack(__dlapi_entrystack(), &__mlibc_stack_data);
- mlibc::set_startup_data(__mlibc_stack_data.argc, __mlibc_stack_data.argv,
- __mlibc_stack_data.envp);
-}
-
-extern "C" void __mlibc_entry(int (*main_fn)(int argc, char *argv[], char *env[])) {
- // TODO: call __dlapi_enter, otherwise static builds will break (see Linux sysdeps)
- auto result = main_fn(__mlibc_stack_data.argc, __mlibc_stack_data.argv, environ);
- exit(result);
-}
-