[libc-commits] [libc] [libc] major refactor of startup library (PR #76092)

via libc-commits libc-commits at lists.llvm.org
Wed Dec 20 15:04:28 PST 2023


================
@@ -0,0 +1,141 @@
+//===-- Implementation file of do_start -----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#include "startup/linux/do_start.h"
+#include "src/__support/OSUtil/syscall.h"
+#include "src/__support/threads/thread.h"
+#include "src/stdlib/atexit.h"
+#include "src/stdlib/exit.h"
+#include "src/unistd/environ.h"
+
+#include <linux/auxvec.h>
+#include <linux/elf.h>
+#include <stdint.h>
+#include <sys/mman.h>
+#include <sys/syscall.h>
+
+namespace LIBC_NAMESPACE {
+
+// TODO: this symbol will be moved to config.linux.app
+AppProperties app;
+
+using InitCallback = void(int, char **, char **);
+using FiniCallback = void(void);
+
+extern "C" int main(int argc, char **argv, char **envp);
----------------
michaelrj-google wrote:

main should be outside of the namespace for clarity.

https://github.com/llvm/llvm-project/pull/76092


More information about the libc-commits mailing list