aboutsummaryrefslogtreecommitdiff
path: root/libc/startup/linux/do_start.cpp
AgeCommit message (Collapse)AuthorFilesLines
10 days[libc][NFC] Add stdint.h proxy header to fix dependency issue with ↵lntue1-1/+1
<stdint.h> includes. (#150303) https://github.com/llvm/llvm-project/issues/149993
2024-09-11[libc] fix tls teardown while being used (#108229)Schrodinger ZHU Yifan1-5/+6
The call chain to `Mutex:lock` can be polluted by stack protector. For completely safe, let's postpone the main TLS tearing down to a separate phase. fix #108030
2024-08-11Revert "libc: Remove `extern "C"` from main declarations" (#102827)Schrodinger ZHU Yifan1-1/+1
Reverts llvm/llvm-project#102825
2024-08-11libc: Remove `extern "C"` from main declarations (#102825)David Blaikie1-1/+1
This is invalid in C++, and clang recently started warning on it as of #101853
2024-08-05[libc][startup] fix main thread TLS unmapped with wrong value (#102009)Schrodinger ZHU Yifan1-1/+1
We have been unmapping a wrong address all the time. ```c munmap(0x704cffebb000, 41048) = 0 munmap(0x704cffec6000, 69632) = 0 munmap(0x704cffe9f000, 41048) = 0 munmap(0x704cffeaa000, 69632) = 0 munmap(0x704cffe83000, 41048) = 0 munmap(0x704cffe8e000, 69632) = 0 munmap(0x704cffe67000, 41048) = 0 munmap(0x704cffe72000, 69632) = 0 munmap(0x704cffe4b000, 41048) = 0 munmap(0x704cffe56000, 69632) = 0 munmap(0x704cffe2f000, 41048) = 0 munmap(0x704cffe3a000, 69632) = 0 munmap(0x704cfff51028, 41048) = -1 EINVAL (Invalid argument) ```
2024-07-27revert all tid changes (#100915)Schrodinger ZHU Yifan1-5/+0
2024-07-20reland "[libc] implement cached process/thread identity (#98989)" (#99765)Schrodinger ZHU Yifan1-0/+5
2024-07-18Revert "[libc] implement cached process/thread identity" (#99559)Schrodinger ZHU Yifan1-5/+0
Reverts llvm/llvm-project#98989
2024-07-18[libc] implement cached process/thread identity (#98989)Schrodinger ZHU Yifan1-0/+5
migrated from https://github.com/llvm/llvm-project/pull/95965 due to corrupted git history
2024-07-12[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98597)Petr Hosek1-2/+3
This is a part of #97655.
2024-07-12Revert "[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace ↵Mehdi Amini1-3/+2
declaration" (#98593) Reverts llvm/llvm-project#98075 bots are broken
2024-07-11[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98075)Petr Hosek1-2/+3
This is a part of #97655.
2024-06-25[libc][arm32] define argc type and stack alignment (#96367)Nick Desaulniers (paternity leave)1-2/+2
https://github.com/ARM-software/abi-aa/blob/main/aapcs32/aapcs32.rst#6212stack-constraints-at-a-public-interface mentions that the stack on ARM32 is double word aligned. Remove confused comments around ArgcType. argc is always an int, passed on the stack, so we need to store a pointer to it (regardless of ILP32 or LP64).
2024-06-24[libc][startup] create header for ElfW and use in startup (#96510)Nick Desaulniers (paternity leave)1-4/+5
This is necessary for 32b platforms such as ARM and i386. Link: #94128
2024-01-24[libc][NFC] remove TODO about AppProperties (#79356)Schrodinger ZHU Yifan1-1/+0
``` AppProperties app; ``` is marked as a weak symbol in header now. One can just use `&app != nullptr` to check if `app` is defined. There is no need to define it for overlay mode.
2024-01-22[libc] support PIE relocations (#78993)Schrodinger ZHU Yifan1-8/+21
For some reasons, we are using `-fpie` (libc/cmake/modules/LLVMLibCObjectRules.cmake:31) without supporting it. According to @lntue, some of the hermetic tests are broken without proper PIE support. This patch implements basic relocations support for PIE.
2024-01-04[libc] major refactor of startup library (#76092)Schrodinger ZHU Yifan1-0/+140
* separate initialization routines into _start and do_start for all architectures. * lift do_start as a separate object library to avoid code duplication. * (addtionally) address the problem of building hermetic libc with -fstack-pointer-* The `crt1.o` is now a merged result of three components: ``` ___ |___ x86_64 | |_______ start.cpp.o <- _start (loads process initial stack and aligns stack pointer) | |_______ tls.cpp.o <- init_tls, cleanup_tls, set_thread_pointer (TLS related routines) |___ do_start.cpp.o <- do_start (sets up global variables and invokes the main function) ```