From d3535a33ea276e491da92171129a3789ec7e8718 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 9 May 2023 11:17:41 +0100 Subject: [PATCH 01/11] CMake: fix missing `SWIFT_CONCURRENCY_GLOBAL_EXECUTOR` value `SWIFT_CONCURRENCY_GLOBAL_EXECUTOR` is defined in `stdlib/cmake/modules/StdlibOptions.cmake`, which is not included during the first pass of evaluation of the root `CMakeLists.txt`. It is available on subsequent evaluations after the value is stored in CMake cache. This led to subtle bugs, where `usr/lib/swift_static/linux/static-stdlib-args.lnk` didn't contain certain flags on clean toolchain builds, but did contain them in incremental builds. Not having these autolinking flags in toolchain builds leads to errors when statically linking executables on Linux. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f8b08c2335ed..c4f6f19300290 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,6 +163,10 @@ set(SWIFT_HOST_VARIANT_ARCH "${SWIFT_HOST_VARIANT_ARCH_default}" CACHE STRING # This is primarily to support building smaller or faster project files. # +# Subsequent options may refer to `StdlibOptions`, which have to be defined first. +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/stdlib/cmake/modules) +include(StdlibOptions) + option(SWIFT_APPEND_VC_REV "Embed the version control system revision in Swift" TRUE) From 8d3a769c3f8c7c64258b1824166450ffef76ecaa Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Wed, 10 May 2023 14:05:25 +0100 Subject: [PATCH 02/11] Fix `-DSWIFT_PATH_TO_LIBDISPATCH_STATIC_BUILD` value --- test/Driver/static-stdlib-autolink-linux.swift | 3 +-- test/Driver/static-stdlib-linux.swift | 2 +- test/lit.cfg | 18 ++++++++---------- utils/build-script-impl | 2 +- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/test/Driver/static-stdlib-autolink-linux.swift b/test/Driver/static-stdlib-autolink-linux.swift index 2877c48d5c192..7d24e424c0b28 100644 --- a/test/Driver/static-stdlib-autolink-linux.swift +++ b/test/Driver/static-stdlib-autolink-linux.swift @@ -7,8 +7,7 @@ // RUN: echo 'public func asyncFunc() async { print("Hello") }' > %t/asyncModule.swift // RUN: %target-swiftc_driver -emit-library -emit-module -module-name asyncModule -module-link-name asyncModule %t/asyncModule.swift -static -static-stdlib -o %t/libasyncModule.a -// TODO: "-ldispatch -lBlocksRuntime" should be told by asyncModule.swiftmodule transitively -// RUN: %target-swiftc_driver -parse-as-library -static -static-stdlib -module-name main %s %import-static-libdispatch -I%t -L%t -ldispatch -lBlocksRuntime -o %t/main +// RUN: %target-swiftc_driver -parse-as-library -static -static-stdlib -module-name main %s %import-static-libdispatch -I%t -L%t -o %t/main // RUN: %t/main | %FileCheck %s // CHECK: Hello diff --git a/test/Driver/static-stdlib-linux.swift b/test/Driver/static-stdlib-linux.swift index 59d5e290efe32..e9cad2053867d 100644 --- a/test/Driver/static-stdlib-linux.swift +++ b/test/Driver/static-stdlib-linux.swift @@ -3,7 +3,7 @@ // REQUIRES: static_stdlib print("hello world!") // RUN: %empty-directory(%t) -// RUN: %target-swiftc_driver -static-stdlib -o %t/static-stdlib %s +// RUN: %target-swiftc_driver %import-static-libdispatch -static-stdlib -o %t/static-stdlib %s // RUN: %t/static-stdlib | %FileCheck %s // RUN: ldd %t/static-stdlib | %FileCheck %s --check-prefix=LDD // CHECK: hello world! diff --git a/test/lit.cfg b/test/lit.cfg index 259c7772be1f1..a69dbd974e13b 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -1483,19 +1483,13 @@ elif (run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'openbsd', 'windows- config.import_libdispatch = ('-I %s -I %s -L %s' % (libdispatch_source_dir, libdispatch_swift_module_dir, libdispatch_artifact_dir)) - libdispatch_static_artifact_dir = config.libdispatch_static_build_path - libdispatch_swift_static_module_dir = make_path(libdispatch_static_artifact_dir, 'src', 'swift', 'swift') + libdispatch_static_artifact_dir = os.path.join(config.libdispatch_static_build_path, 'lib') libdispatch_static_artifacts = [ - make_path(libdispatch_static_artifact_dir, 'src', 'libdispatch.a'), - make_path(libdispatch_static_artifact_dir, 'src', 'swift', 'libswiftDispatch.a'), - make_path(libdispatch_swift_static_module_dir, 'Dispatch.swiftmodule')] + make_path(libdispatch_static_artifact_dir, 'libdispatch.a'), + make_path(libdispatch_static_artifact_dir, 'libBlocksRuntime.a')] if (all(os.path.exists(p) for p in libdispatch_static_artifacts)): config.available_features.add('libdispatch_static') - config.import_libdispatch_static = ('-I %s -I %s -L %s -L %s -L %s' - % (libdispatch_source_dir, libdispatch_swift_static_module_dir, - make_path(libdispatch_static_artifact_dir, 'src'), - make_path(libdispatch_static_artifact_dir, 'src', 'BlocksRuntime'), - make_path(libdispatch_static_artifact_dir, 'src', 'swift'))) + config.import_libdispatch_static = '-L %s' % libdispatch_static_artifact_dir config.target_build_swift = ( '%s -target %s -toolchain-stdlib-rpath %s %s %s %s %s' @@ -2519,6 +2513,10 @@ run_filecheck = '%s %s --allow-unused-prefixes --sanitize BUILD_DIR=%s --sanitiz config.substitutions.append(('%FileCheck', run_filecheck)) config.substitutions.append(('%raw-FileCheck', shell_quote(config.filecheck))) config.substitutions.append(('%import-libdispatch', getattr(config, 'import_libdispatch', ''))) +# WARNING: the order of components in a substitution name has to be different from the previous one, as lit does +# a pure string substitution without understanding that these components are grouped together. That is, the following +# subsitution name can't be `%import-libdispatch-static`, otherwise the first two components will be substituted with +# the value of `%import-libdispatch` substitution with `-static` string appended to it. config.substitutions.append(('%import-static-libdispatch', getattr(config, 'import_libdispatch_static', ''))) # Disable COW sanity checks in the swift runtime by default. diff --git a/utils/build-script-impl b/utils/build-script-impl index d8a7b6d5951ac..8cefe8eddb2c1 100755 --- a/utils/build-script-impl +++ b/utils/build-script-impl @@ -2011,7 +2011,7 @@ for host in "${ALL_HOSTS[@]}"; do -DSWIFT_PATH_TO_CMARK_BUILD:PATH="$(build_directory ${host} cmark)" -DSWIFT_PATH_TO_LIBDISPATCH_SOURCE:PATH="${LIBDISPATCH_SOURCE_DIR}" -DSWIFT_PATH_TO_LIBDISPATCH_BUILD:PATH="$(build_directory ${host} libdispatch)" - -DSWIFT_PATH_TO_LIBDISPATCH_STATIC_BUILD:PATH="$(build_directory ${host} libdispatch_static)" + -DSWIFT_PATH_TO_LIBDISPATCH_STATIC_BUILD:PATH="$(build_directory ${host} swift)/$(basename $(build_directory ${host} libdispatch))-static-prefix" ) if [[ "${SWIFT_SDKS}" ]] ; then From d033990ec49e81b307bed70743419f2337e8b356 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Wed, 10 May 2023 19:36:27 +0100 Subject: [PATCH 03/11] Move `SWIFT_CONCURRENCY_USES_DISPATCH` to `StdlibOptions.cmake` It is only used in the stdlib build, so really has no business being set in the root `CMakeLists.txt`. --- CMakeLists.txt | 11 ++--------- stdlib/cmake/modules/StdlibOptions.cmake | 13 +++++++++++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4f6f19300290..9c768be2786d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -623,13 +623,6 @@ if(NOT EXISTS "${SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE}") message(SEND_ERROR "swift-syntax is required to build the Swift compiler. Please run update-checkout or specify SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE") endif() -# Use dispatch as the system scheduler by default. -# For convenience, we set this to false when concurrency is disabled. -set(SWIFT_CONCURRENCY_USES_DISPATCH FALSE) -if(SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY AND "${SWIFT_CONCURRENCY_GLOBAL_EXECUTOR}" STREQUAL "dispatch") - set(SWIFT_CONCURRENCY_USES_DISPATCH TRUE) -endif() - set(SWIFT_BUILD_HOST_DISPATCH FALSE) if(SWIFT_ENABLE_DISPATCH AND NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) # Only build libdispatch for the host if the host tools are being built and @@ -638,9 +631,9 @@ if(SWIFT_ENABLE_DISPATCH AND NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) set(SWIFT_BUILD_HOST_DISPATCH TRUE) endif() - if(SWIFT_BUILD_HOST_DISPATCH OR SWIFT_CONCURRENCY_USES_DISPATCH) + if(SWIFT_BUILD_HOST_DISPATCH) if(NOT EXISTS "${SWIFT_PATH_TO_LIBDISPATCH_SOURCE}") - message(SEND_ERROR "SourceKit and concurrency require libdispatch on non-Darwin hosts. Please specify SWIFT_PATH_TO_LIBDISPATCH_SOURCE") + message(SEND_ERROR "SourceKit requires libdispatch on non-Darwin hosts. Please specify SWIFT_PATH_TO_LIBDISPATCH_SOURCE") endif() endif() endif() diff --git a/stdlib/cmake/modules/StdlibOptions.cmake b/stdlib/cmake/modules/StdlibOptions.cmake index 7533bc4b94dc5..ce982f3052874 100644 --- a/stdlib/cmake/modules/StdlibOptions.cmake +++ b/stdlib/cmake/modules/StdlibOptions.cmake @@ -228,3 +228,16 @@ option(SWIFT_STDLIB_CONCURRENCY_TRACING "Enable concurrency tracing in the runtime; assumes the presence of os_log(3) and the os_signpost(3) API." "${SWIFT_STDLIB_CONCURRENCY_TRACING_default}") + +# Use dispatch as the system scheduler by default. +# For convenience, we set this to false when concurrency is disabled. +set(SWIFT_CONCURRENCY_USES_DISPATCH FALSE) +if(SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY AND "${SWIFT_CONCURRENCY_GLOBAL_EXECUTOR}" STREQUAL "dispatch") + set(SWIFT_CONCURRENCY_USES_DISPATCH TRUE) +endif() + +if(SWIFT_CONCURRENCY_USES_DISPATCH) + if(NOT EXISTS "${SWIFT_PATH_TO_LIBDISPATCH_SOURCE}") + message(SEND_ERROR "Concurrency requires libdispatch on non-Darwin hosts. Please specify SWIFT_PATH_TO_LIBDISPATCH_SOURCE") + endif() +endif() From 79766f53f23d01d832ee2a3d994e30f7dc940010 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Wed, 10 May 2023 19:37:51 +0100 Subject: [PATCH 04/11] Remove redundant `include(StdlibOptions)` --- CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c768be2786d6..b6d35ff781df0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,10 +163,6 @@ set(SWIFT_HOST_VARIANT_ARCH "${SWIFT_HOST_VARIANT_ARCH_default}" CACHE STRING # This is primarily to support building smaller or faster project files. # -# Subsequent options may refer to `StdlibOptions`, which have to be defined first. -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/stdlib/cmake/modules) -include(StdlibOptions) - option(SWIFT_APPEND_VC_REV "Embed the version control system revision in Swift" TRUE) From 9eefc24cb8de66a5f5fa2e0a3d31b164e237c3aa Mon Sep 17 00:00:00 2001 From: Dario Rexin Date: Tue, 23 May 2023 13:17:14 -0700 Subject: [PATCH 05/11] [Build] Only require libdispatch source on non-Darwin (#66081) --- stdlib/cmake/modules/StdlibOptions.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/cmake/modules/StdlibOptions.cmake b/stdlib/cmake/modules/StdlibOptions.cmake index ce982f3052874..5b10f93ad9f33 100644 --- a/stdlib/cmake/modules/StdlibOptions.cmake +++ b/stdlib/cmake/modules/StdlibOptions.cmake @@ -236,7 +236,7 @@ if(SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY AND "${SWIFT_CONCURRENCY_GLOBAL_EXECUTO set(SWIFT_CONCURRENCY_USES_DISPATCH TRUE) endif() -if(SWIFT_CONCURRENCY_USES_DISPATCH) +if(SWIFT_CONCURRENCY_USES_DISPATCH AND NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) if(NOT EXISTS "${SWIFT_PATH_TO_LIBDISPATCH_SOURCE}") message(SEND_ERROR "Concurrency requires libdispatch on non-Darwin hosts. Please specify SWIFT_PATH_TO_LIBDISPATCH_SOURCE") endif() From b76f303a8d0c20a8481d0dbc0422a7bf77c18389 Mon Sep 17 00:00:00 2001 From: Gwynne Raskind Date: Sun, 12 Mar 2023 20:31:18 -0500 Subject: [PATCH 06/11] Add the remaining toolchain-distributed runtime libs to autolink-extract deduplication # Conflicts: # lib/DriverTool/autolink_extract_main.cpp --- lib/DriverTool/autolink_extract_main.cpp | 32 ++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/lib/DriverTool/autolink_extract_main.cpp b/lib/DriverTool/autolink_extract_main.cpp index 3d6b7fdb8a2e1..6947077d7c643 100644 --- a/lib/DriverTool/autolink_extract_main.cpp +++ b/lib/DriverTool/autolink_extract_main.cpp @@ -244,13 +244,41 @@ int autolink_extract_main(ArrayRef Args, const char *Argv0, // Keep track of whether we've already added the common // Swift libraries that ususally have autolink directives - // in most object fiels + // in most object files std::unordered_map SwiftRuntimeLibraries = { + // Common Swift runtime libs {"-lswiftSwiftOnoneSupport", false}, {"-lswiftCore", false}, {"-lswift_Concurrency", false}, {"-lswift_StringProcessing", false}, - {"-lswift_RegexParser", false} + {"-lswift_RegexBuilder", false}, + {"-lswift_RegexParser", false}, + {"-lswift_Backtracing", false}, + {"-lswiftGlibc", false}, + {"-lBlocksRuntime", false}, + // Dispatch-specific Swift runtime libs + {"-ldispatch", false}, + {"-lDispatchStubs", false}, + {"-lswiftDispatch", false}, + // CoreFoundation and Foundation Swift runtime libs + {"-lCoreFoundation", false}, + {"-lFoundation", false}, + {"-lFoundationNetworking", false}, + {"-lFoundationXML", false}, + // Foundation support libs + {"-lcurl", false}, + {"-lxml2", false}, + {"-luuid", false}, + // ICU Swift runtime libs + {"-licui18nswift", false}, + {"-licuucswift", false}, + {"-licudataswift", false}, + // Common-use ordering-agnostic Linux system libs + {"-lm", false}, + {"-lpthread", false}, + {"-lutil", false}, + {"-ldl", false}, + {"-lz", false}, }; // Extract the linker flags from the objects. From fb86eca9b687975618be1f81886d6af1cdd6f19d Mon Sep 17 00:00:00 2001 From: Gwynne Raskind Date: Mon, 13 Mar 2023 09:29:21 -0500 Subject: [PATCH 07/11] Address PR feedback --- lib/DriverTool/autolink_extract_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DriverTool/autolink_extract_main.cpp b/lib/DriverTool/autolink_extract_main.cpp index 6947077d7c643..06c6ce581b322 100644 --- a/lib/DriverTool/autolink_extract_main.cpp +++ b/lib/DriverTool/autolink_extract_main.cpp @@ -243,7 +243,7 @@ int autolink_extract_main(ArrayRef Args, const char *Argv0, std::vector LinkerFlags; // Keep track of whether we've already added the common - // Swift libraries that ususally have autolink directives + // Swift libraries that usually have autolink directives // in most object files std::unordered_map SwiftRuntimeLibraries = { // Common Swift runtime libs From c4585938ef1d83869e1ee29c367dd74ad8e4ea40 Mon Sep 17 00:00:00 2001 From: Gwynne Raskind Date: Mon, 13 Mar 2023 16:55:14 -0500 Subject: [PATCH 08/11] Workaround for XCTest buildsystem rpath bug --- lib/DriverTool/autolink_extract_main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/DriverTool/autolink_extract_main.cpp b/lib/DriverTool/autolink_extract_main.cpp index 06c6ce581b322..45e40cc33a0b1 100644 --- a/lib/DriverTool/autolink_extract_main.cpp +++ b/lib/DriverTool/autolink_extract_main.cpp @@ -269,6 +269,8 @@ int autolink_extract_main(ArrayRef Args, const char *Argv0, {"-lcurl", false}, {"-lxml2", false}, {"-luuid", false}, + // XCTest runtime libs (due to an RPATH bug, this must come after Foundation) + {"-lXCTest", false}, // ICU Swift runtime libs {"-licui18nswift", false}, {"-licuucswift", false}, From 966af2576d719565f007faf01364a6e61abe55f6 Mon Sep 17 00:00:00 2001 From: Gwynne Raskind Date: Mon, 13 Mar 2023 18:39:01 -0500 Subject: [PATCH 09/11] Update autolink_extract_main.cpp --- lib/DriverTool/autolink_extract_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/DriverTool/autolink_extract_main.cpp b/lib/DriverTool/autolink_extract_main.cpp index 45e40cc33a0b1..7ff8114ec357d 100644 --- a/lib/DriverTool/autolink_extract_main.cpp +++ b/lib/DriverTool/autolink_extract_main.cpp @@ -246,6 +246,8 @@ int autolink_extract_main(ArrayRef Args, const char *Argv0, // Swift libraries that usually have autolink directives // in most object files std::unordered_map SwiftRuntimeLibraries = { + // XCTest runtime libs (must be first due to http://github.com/apple/swift-corelibs-xctest/issues/432) + {"-lXCTest", false}, // Common Swift runtime libs {"-lswiftSwiftOnoneSupport", false}, {"-lswiftCore", false}, @@ -269,8 +271,6 @@ int autolink_extract_main(ArrayRef Args, const char *Argv0, {"-lcurl", false}, {"-lxml2", false}, {"-luuid", false}, - // XCTest runtime libs (due to an RPATH bug, this must come after Foundation) - {"-lXCTest", false}, // ICU Swift runtime libs {"-licui18nswift", false}, {"-licuucswift", false}, From f1411cfe349237deaa46fcb34d735a9dab9b28e6 Mon Sep 17 00:00:00 2001 From: Gwynne Raskind Date: Mon, 13 Mar 2023 20:12:43 -0500 Subject: [PATCH 10/11] Okay, let's try actually having an ordering if we're trying to use an ordering --- lib/DriverTool/autolink_extract_main.cpp | 71 +++++++++++++----------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/lib/DriverTool/autolink_extract_main.cpp b/lib/DriverTool/autolink_extract_main.cpp index 7ff8114ec357d..f9294689ad9b5 100644 --- a/lib/DriverTool/autolink_extract_main.cpp +++ b/lib/DriverTool/autolink_extract_main.cpp @@ -245,43 +245,48 @@ int autolink_extract_main(ArrayRef Args, const char *Argv0, // Keep track of whether we've already added the common // Swift libraries that usually have autolink directives // in most object files - std::unordered_map SwiftRuntimeLibraries = { + + std::vector SwiftRuntimeLibsOrdered = { // XCTest runtime libs (must be first due to http://github.com/apple/swift-corelibs-xctest/issues/432) - {"-lXCTest", false}, + "-lXCTest", // Common Swift runtime libs - {"-lswiftSwiftOnoneSupport", false}, - {"-lswiftCore", false}, - {"-lswift_Concurrency", false}, - {"-lswift_StringProcessing", false}, - {"-lswift_RegexBuilder", false}, - {"-lswift_RegexParser", false}, - {"-lswift_Backtracing", false}, - {"-lswiftGlibc", false}, - {"-lBlocksRuntime", false}, + "-lswiftSwiftOnoneSupport", + "-lswiftCore", + "-lswift_Concurrency", + "-lswift_StringProcessing", + "-lswift_RegexBuilder", + "-lswift_RegexParser", + "-lswift_Backtracing", + "-lswiftGlibc", + "-lBlocksRuntime", // Dispatch-specific Swift runtime libs - {"-ldispatch", false}, - {"-lDispatchStubs", false}, - {"-lswiftDispatch", false}, + "-ldispatch", + "-lDispatchStubs", + "-lswiftDispatch", // CoreFoundation and Foundation Swift runtime libs - {"-lCoreFoundation", false}, - {"-lFoundation", false}, - {"-lFoundationNetworking", false}, - {"-lFoundationXML", false}, + "-lCoreFoundation", + "-lFoundation", + "-lFoundationNetworking", + "-lFoundationXML", // Foundation support libs - {"-lcurl", false}, - {"-lxml2", false}, - {"-luuid", false}, + "-lcurl", + "-lxml2", + "-luuid", // ICU Swift runtime libs - {"-licui18nswift", false}, - {"-licuucswift", false}, - {"-licudataswift", false}, + "-licui18nswift", + "-licuucswift", + "-licudataswift", // Common-use ordering-agnostic Linux system libs - {"-lm", false}, - {"-lpthread", false}, - {"-lutil", false}, - {"-ldl", false}, - {"-lz", false}, + "-lm", + "-lpthread", + "-lutil", + "-ldl", + "-lz", }; + std::unordered_map SwiftRuntimeLibraries; + for (const auto &RuntimeLib : SwiftRuntimeLibsOrdered) { + SwiftRuntimeLibraries[RuntimeLib] = false; + } // Extract the linker flags from the objects. for (const auto &BinaryFileName : Invocation.getInputFilenames()) { @@ -318,9 +323,11 @@ int autolink_extract_main(ArrayRef Args, const char *Argv0, OutOS << Flag << '\n'; } - for (const auto &RuntimeLib : SwiftRuntimeLibraries) { - if (RuntimeLib.second) - OutOS << RuntimeLib.first << '\n'; + for (const auto &RuntimeLib : SwiftRuntimeLibsOrdered) { + auto entry = SwiftRuntimeLibraries.find(RuntimeLib); + if (entry != SwiftRuntimeLibraries.end() && entry->second) { + OutOS << entry->first << '\n'; + } } From 3fd9fdf93e04813e1213903694be6b1b98510ebf Mon Sep 17 00:00:00 2001 From: Gwynne Raskind Date: Tue, 14 Mar 2023 11:58:46 -0500 Subject: [PATCH 11/11] Whoops. El smarty-pants over here forgot to put XCTest back where it goes after fixing ordering --- lib/DriverTool/autolink_extract_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/DriverTool/autolink_extract_main.cpp b/lib/DriverTool/autolink_extract_main.cpp index f9294689ad9b5..1f2538e1ac6e1 100644 --- a/lib/DriverTool/autolink_extract_main.cpp +++ b/lib/DriverTool/autolink_extract_main.cpp @@ -247,8 +247,6 @@ int autolink_extract_main(ArrayRef Args, const char *Argv0, // in most object files std::vector SwiftRuntimeLibsOrdered = { - // XCTest runtime libs (must be first due to http://github.com/apple/swift-corelibs-xctest/issues/432) - "-lXCTest", // Common Swift runtime libs "-lswiftSwiftOnoneSupport", "-lswiftCore", @@ -272,6 +270,8 @@ int autolink_extract_main(ArrayRef Args, const char *Argv0, "-lcurl", "-lxml2", "-luuid", + // XCTest runtime libs (must be first due to http://github.com/apple/swift-corelibs-xctest/issues/432) + "-lXCTest", // ICU Swift runtime libs "-licui18nswift", "-licuucswift",