diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake --- a/libc/cmake/modules/LLVMLibCTestRules.cmake +++ b/libc/cmake/modules/LLVMLibCTestRules.cmake @@ -402,7 +402,6 @@ # SUITE # SRCS [src2.cpp ...] # HDRS [hdr1.cpp ...] -# STARTUP # DEPENDS # ARGS # ENV @@ -420,7 +419,7 @@ cmake_parse_arguments( "INTEGRATION_TEST" "" # No optional arguments - "SUITE;STARTUP" # Single value arguments + "SUITE" # Single value arguments "SRCS;HDRS;DEPENDS;ARGS;ENV;COMPILE_OPTIONS" # Multi-value arguments ${ARGN} ) @@ -428,20 +427,20 @@ if(NOT INTEGRATION_TEST_SUITE) message(FATAL_ERROR "SUITE not specified for ${fq_target_name}") endif() - if(NOT INTEGRATION_TEST_STARTUP) - message(FATAL_ERROR "The STARTUP to link to the integration test is missing.") - endif() if(NOT INTEGRATION_TEST_SRCS) message(FATAL_ERROR "The SRCS list for add_integration_test is missing.") endif() + if(NOT TARGET libc.startup.${LIBC_TARGET_OS}.crt1) + message(FATAL_ERROR "The 'crt1' target for the integration test is missing.") + endif() get_fq_target_name(${test_name}.libc fq_libc_target_name) get_fq_deps_list(fq_deps_list ${INTEGRATION_TEST_DEPENDS}) list(APPEND fq_deps_list - # All integration tests need to inherit the same dependencies as the - # startup code. - ${INTEGRATION_TEST_STARTUP} + # All integration tests use the operating system's startup object and need + # to inherit the same dependencies. + libc.startup.${LIBC_TARGET_OS}.crt1 # We always add the memory functions objects. This is because the # compiler's codegen can emit calls to the C memory functions. libc.src.string.bcmp diff --git a/libc/test/integration/src/__support/threads/CMakeLists.txt b/libc/test/integration/src/__support/threads/CMakeLists.txt --- a/libc/test/integration/src/__support/threads/CMakeLists.txt +++ b/libc/test/integration/src/__support/threads/CMakeLists.txt @@ -11,8 +11,6 @@ libc-support-threads-integration-tests SRCS thread_detach_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.src.__support.threads.mutex libc.src.__support.threads.thread @@ -24,8 +22,6 @@ libc-support-threads-integration-tests SRCS thread_tls_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.src.__support.threads.thread ) diff --git a/libc/test/integration/src/pthread/CMakeLists.txt b/libc/test/integration/src/pthread/CMakeLists.txt --- a/libc/test/integration/src/pthread/CMakeLists.txt +++ b/libc/test/integration/src/pthread/CMakeLists.txt @@ -6,8 +6,6 @@ libc-pthread-integration-tests SRCS pthread_mutex_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.include.pthread libc.src.errno.errno @@ -25,8 +23,6 @@ libc-pthread-integration-tests SRCS pthread_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.include.pthread libc.src.pthread.pthread_create @@ -39,8 +35,6 @@ libc-pthread-integration-tests SRCS pthread_equal_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.include.pthread libc.src.errno.errno @@ -60,8 +54,6 @@ libc-pthread-integration-tests SRCS pthread_name_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.include.errno libc.include.pthread @@ -83,8 +75,6 @@ libc-pthread-integration-tests SRCS pthread_exit_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.include.pthread libc.src.pthread.pthread_create @@ -98,8 +88,6 @@ libc-pthread-integration-tests SRCS pthread_tss_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.include.pthread libc.src.pthread.pthread_create @@ -117,8 +105,6 @@ libc-pthread-integration-tests SRCS pthread_once_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.include.pthread libc.src.pthread.pthread_once diff --git a/libc/test/integration/src/spawn/CMakeLists.txt b/libc/test/integration/src/spawn/CMakeLists.txt --- a/libc/test/integration/src/spawn/CMakeLists.txt +++ b/libc/test/integration/src/spawn/CMakeLists.txt @@ -26,8 +26,6 @@ spawn-integration-tests SRCS posix_spawn_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc_posix_spawn_test_binary libc.test.integration.src.spawn.test_binary_properties diff --git a/libc/test/integration/src/stdio/CMakeLists.txt b/libc/test/integration/src/stdio/CMakeLists.txt --- a/libc/test/integration/src/stdio/CMakeLists.txt +++ b/libc/test/integration/src/stdio/CMakeLists.txt @@ -9,8 +9,6 @@ stdio-integration-tests SRCS sprintf_size_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.src.stdio.sprintf ARGS @@ -26,8 +24,6 @@ stdio-integration-tests SRCS sprintf_size_test.cpp - STARTUP - libc.startup.linux.crt1 ARGS "%s %c %d" "First arg" diff --git a/libc/test/integration/src/stdlib/CMakeLists.txt b/libc/test/integration/src/stdlib/CMakeLists.txt --- a/libc/test/integration/src/stdlib/CMakeLists.txt +++ b/libc/test/integration/src/stdlib/CMakeLists.txt @@ -7,8 +7,6 @@ stdlib-integration-tests SRCS getenv_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.src.stdlib.getenv ENV diff --git a/libc/test/integration/src/threads/CMakeLists.txt b/libc/test/integration/src/threads/CMakeLists.txt --- a/libc/test/integration/src/threads/CMakeLists.txt +++ b/libc/test/integration/src/threads/CMakeLists.txt @@ -6,8 +6,6 @@ libc-threads-integration-tests SRCS mtx_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.include.threads libc.src.errno.errno @@ -25,8 +23,6 @@ libc-threads-integration-tests SRCS thrd_equal_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.include.threads libc.src.threads.mtx_destroy @@ -45,8 +41,6 @@ libc-threads-integration-tests SRCS thrd_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.include.threads libc.src.errno.errno @@ -60,8 +54,6 @@ libc-threads-integration-tests SRCS thrd_exit_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.include.threads libc.src.threads.thrd_create @@ -75,8 +67,6 @@ libc-threads-integration-tests SRCS tss_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.include.threads libc.src.threads.thrd_create @@ -94,8 +84,6 @@ libc-threads-integration-tests SRCS call_once_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.include.threads libc.src.threads.call_once @@ -114,8 +102,6 @@ libc-threads-integration-tests SRCS cnd_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.include.threads libc.src.threads.cnd_init diff --git a/libc/test/integration/src/unistd/CMakeLists.txt b/libc/test/integration/src/unistd/CMakeLists.txt --- a/libc/test/integration/src/unistd/CMakeLists.txt +++ b/libc/test/integration/src/unistd/CMakeLists.txt @@ -7,8 +7,6 @@ unistd-integration-tests SRCS getcwd_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.src.__support.CPP.string_view libc.src.errno.errno @@ -22,8 +20,6 @@ unistd-integration-tests SRCS fork_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc.include.errno libc.include.signal @@ -67,8 +63,6 @@ unistd-integration-tests SRCS execv_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc_execv_test_normal_exit libc_execv_test_signal_exit @@ -86,8 +80,6 @@ unistd-integration-tests SRCS execve_test.cpp - STARTUP - libc.startup.linux.crt1 DEPENDS libc_execv_test_normal_exit libc_execv_test_signal_exit diff --git a/libc/test/integration/startup/linux/CMakeLists.txt b/libc/test/integration/startup/linux/CMakeLists.txt --- a/libc/test/integration/startup/linux/CMakeLists.txt +++ b/libc/test/integration/startup/linux/CMakeLists.txt @@ -9,8 +9,6 @@ add_integration_test( startup_args_test SUITE libc-startup-tests - STARTUP - libc.startup.linux.crt1 SRCS args_test.cpp ARGS @@ -23,8 +21,6 @@ add_integration_test( startup_no_envp_test SUITE libc-startup-tests - STARTUP - libc.startup.linux.crt1 SRCS main_without_envp.cpp ) @@ -32,8 +28,6 @@ add_integration_test( startup_no_args_test SUITE libc-startup-tests - STARTUP - libc.startup.linux.crt1 SRCS main_without_args.cpp ) @@ -41,8 +35,6 @@ add_integration_test( startup_tls_test SUITE libc-startup-tests - STARTUP - libc.startup.linux.crt1 SRCS tls_test.cpp DEPENDS @@ -55,8 +47,6 @@ add_integration_test( init_fini_array_test SUITE libc-startup-tests - STARTUP - libc.startup.linux.crt1 SRCS init_fini_array_test.cpp )