aboutsummaryrefslogtreecommitdiff
path: root/libc/cmake/modules
diff options
context:
space:
mode:
authorSchrodinger ZHU Yifan <yifanzhu@rochester.edu>2024-01-04 15:51:14 -0500
committerGitHub <noreply@github.com>2024-01-04 12:51:14 -0800
commit2bc994456c5be2ab6d98b94de2349302577a9823 (patch)
tree191c30f3b2dd0c52d1bf249efd0270c87c732f93 /libc/cmake/modules
parentd67c2d85548437ef8c3bb12a29ea330180b87913 (diff)
downloadllvm-2bc994456c5be2ab6d98b94de2349302577a9823.zip
llvm-2bc994456c5be2ab6d98b94de2349302577a9823.tar.gz
llvm-2bc994456c5be2ab6d98b94de2349302577a9823.tar.bz2
[libc] major refactor of startup library (#76092)
* 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) ```
Diffstat (limited to 'libc/cmake/modules')
-rw-r--r--libc/cmake/modules/LLVMLibCTestRules.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 51d484b..b69839a 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -498,6 +498,9 @@ function(add_integration_test test_name)
libc.src.string.memcpy
libc.src.string.memmove
libc.src.string.memset
+ # __stack_chk_fail should always be included to allow building libc with
+ # stack protector.
+ libc.src.compiler.__stack_chk_fail
)
list(REMOVE_DUPLICATES fq_deps_list)
@@ -665,6 +668,9 @@ function(add_libc_hermetic_test test_name)
libc.src.string.memmove
libc.src.string.memset
libc.src.__support.StringUtil.error_to_string
+ # __stack_chk_fail should always be included to allow building libc with
+ # stack protector.
+ libc.src.compiler.__stack_chk_fail
)
if(TARGET libc.src.time.clock)