--- swift/tools/libSwiftScan/CMakeLists.txt.orig	2024-06-06 04:26:30 UTC
+++ swift/tools/libSwiftScan/CMakeLists.txt
@@ -26,6 +26,8 @@ target_link_libraries(libSwiftScan PRIVATE
     swiftRemoteInspection
     swiftCompilerModules)
 
+target_link_options(libSwiftScan PRIVATE "SHELL:-Xlinker -z" "SHELL:-Xlinker nostart-stop-gc")
+
 set_target_properties(libSwiftScan
     PROPERTIES
     OUTPUT_NAME ${SWIFT_SCAN_LIB_NAME})
