@@ -571,6 +571,8 @@ function(add_integration_test test_name)
571
571
target_compile_options (${fq_build_target_name} PRIVATE
572
572
${compile_options} ${INTEGRATION_TEST_COMPILE_OPTIONS} )
573
573
574
+ set (compiler_runtime "" )
575
+
574
576
if (LIBC_TARGET_ARCHITECTURE_IS_AMDGPU )
575
577
target_link_options (${fq_build_target_name} PRIVATE
576
578
${LIBC_COMPILE_OPTIONS_DEFAULT} ${INTEGRATION_TEST_COMPILE_OPTIONS}
@@ -599,17 +601,19 @@ function(add_integration_test test_name)
599
601
set (link_options
600
602
-nolibc
601
603
-nostartfiles
602
- -static
604
+ -nostdlib
603
605
${LIBC_LINK_OPTIONS_DEFAULT}
604
606
${LIBC_TEST_LINK_OPTIONS_DEFAULT}
605
607
)
606
608
target_link_options (${fq_build_target_name} PRIVATE ${link_options} )
609
+ list (APPEND compiler_runtime ${LIBGCC_S_LOCATION} )
607
610
endif ()
608
611
target_link_libraries (
609
612
${fq_build_target_name}
610
- ${fq_target_name} .__libc__
611
613
libc.startup.${LIBC_TARGET_OS}.crt1
612
614
libc.test.IntegrationTest.test
615
+ ${fq_target_name} .__libc__
616
+ ${compiler_runtime}
613
617
)
614
618
add_dependencies (${fq_build_target_name}
615
619
libc.test.IntegrationTest.test
@@ -770,6 +774,7 @@ function(add_libc_hermetic test_name)
770
774
${HERMETIC_TEST_COMPILE_OPTIONS} )
771
775
772
776
set (link_libraries "" )
777
+ set (compiler_runtime "" )
773
778
foreach (lib IN LISTS HERMETIC_TEST_LINK_LIBRARIES )
774
779
if (TARGET ${lib} .hermetic )
775
780
list (APPEND link_libraries ${lib} .hermetic )
@@ -807,20 +812,22 @@ function(add_libc_hermetic test_name)
807
812
set (link_options
808
813
-nolibc
809
814
-nostartfiles
810
- -static
815
+ -nostdlib
811
816
${LIBC_LINK_OPTIONS_DEFAULT}
812
817
${LIBC_TEST_LINK_OPTIONS_DEFAULT}
813
818
)
814
819
target_link_options (${fq_build_target_name} PRIVATE ${link_options} )
815
- list (APPEND link_libraries ${LIBGCC_S_LOCATION} )
820
+ list (APPEND compiler_runtime ${LIBGCC_S_LOCATION} )
816
821
endif ()
817
822
target_link_libraries (
818
823
${fq_build_target_name}
819
824
PRIVATE
820
825
libc.startup.${LIBC_TARGET_OS}.crt1
821
826
${link_libraries}
822
827
LibcHermeticTestSupport.hermetic
823
- ${fq_target_name} .__libc__ )
828
+ ${fq_target_name} .__libc__
829
+ ${compiler_runtime}
830
+ )
824
831
add_dependencies (${fq_build_target_name}
825
832
LibcTest.hermetic
826
833
libc.test.UnitTest.ErrnoSetterMatcher
0 commit comments