From c894bc08318c44103a3b7eaceca7a8a2e19969dc Mon Sep 17 00:00:00 2001 From: Alexandra Cherdantseva Date: Mon, 3 Feb 2025 08:47:36 +0200 Subject: Linker: Restore support for WHOLE_ARCHIVE with Swift libraries Add Swift linker information modules missed by commit c1c4cf9545 (Linker configuration: introduce a new architecture, 2024-06-05, v3.31.0-rc1~307^2~1) and needed since commit 1e35163ae8 (WHOLE_ARCHIVE link feature: rely now on linker configuration, 2024-07-01, v3.31.0-rc1~307^2). Fixes: #26657 --- Modules/Platform/Linker/Apple-AppleClang-Swift.cmake | 6 ++++++ Modules/Platform/Linker/Apple-Swift.cmake | 5 +++++ Modules/Platform/Linker/Linux-GNU-Swift.cmake | 6 ++++++ Modules/Platform/Linker/Linux-GNUgold-Swift.cmake | 6 ++++++ Modules/Platform/Linker/Linux-LLD-Swift.cmake | 6 ++++++ Modules/Platform/Linker/Linux-Swift.cmake | 5 +++++ Modules/Platform/Linker/Windows-MSVC-Swift.cmake | 6 ++++++ Modules/Platform/Linker/Windows-Swift.cmake | 5 +++++ Modules/Platform/Linker/WindowsPhone-MSVC-Swift.cmake | 4 ++++ Modules/Platform/Linker/WindowsPhone-Swift.cmake | 5 +++++ Modules/Platform/Linker/WindowsStore-MSVC-Swift.cmake | 4 ++++ Modules/Platform/Linker/WindowsStore-Swift.cmake | 5 +++++ 12 files changed, 63 insertions(+) create mode 100644 Modules/Platform/Linker/Apple-AppleClang-Swift.cmake create mode 100644 Modules/Platform/Linker/Apple-Swift.cmake create mode 100644 Modules/Platform/Linker/Linux-GNU-Swift.cmake create mode 100644 Modules/Platform/Linker/Linux-GNUgold-Swift.cmake create mode 100644 Modules/Platform/Linker/Linux-LLD-Swift.cmake create mode 100644 Modules/Platform/Linker/Linux-Swift.cmake create mode 100644 Modules/Platform/Linker/Windows-MSVC-Swift.cmake create mode 100644 Modules/Platform/Linker/Windows-Swift.cmake create mode 100644 Modules/Platform/Linker/WindowsPhone-MSVC-Swift.cmake create mode 100644 Modules/Platform/Linker/WindowsPhone-Swift.cmake create mode 100644 Modules/Platform/Linker/WindowsStore-MSVC-Swift.cmake create mode 100644 Modules/Platform/Linker/WindowsStore-Swift.cmake diff --git a/Modules/Platform/Linker/Apple-AppleClang-Swift.cmake b/Modules/Platform/Linker/Apple-AppleClang-Swift.cmake new file mode 100644 index 0000000..633cc90 --- /dev/null +++ b/Modules/Platform/Linker/Apple-AppleClang-Swift.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Apple-AppleClang) + +__apple_linker_appleclang(Swift) diff --git a/Modules/Platform/Linker/Apple-Swift.cmake b/Modules/Platform/Linker/Apple-Swift.cmake new file mode 100644 index 0000000..f5404fa --- /dev/null +++ b/Modules/Platform/Linker/Apple-Swift.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# AppleClang is the default linker +include(Platform/Linker/Apple-AppleClang-Swift) diff --git a/Modules/Platform/Linker/Linux-GNU-Swift.cmake b/Modules/Platform/Linker/Linux-GNU-Swift.cmake new file mode 100644 index 0000000..06929ef --- /dev/null +++ b/Modules/Platform/Linker/Linux-GNU-Swift.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-GNU) + +__linux_linker_gnu(Swift) diff --git a/Modules/Platform/Linker/Linux-GNUgold-Swift.cmake b/Modules/Platform/Linker/Linux-GNUgold-Swift.cmake new file mode 100644 index 0000000..b9b6d15 --- /dev/null +++ b/Modules/Platform/Linker/Linux-GNUgold-Swift.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-GNU-Swift) + +set(CMAKE_Swift_PLATFORM_LINKER_ID GNUgold) diff --git a/Modules/Platform/Linker/Linux-LLD-Swift.cmake b/Modules/Platform/Linker/Linux-LLD-Swift.cmake new file mode 100644 index 0000000..3428034 --- /dev/null +++ b/Modules/Platform/Linker/Linux-LLD-Swift.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-LLD) + +__linux_linker_lld(Swift) diff --git a/Modules/Platform/Linker/Linux-Swift.cmake b/Modules/Platform/Linker/Linux-Swift.cmake new file mode 100644 index 0000000..638f3c7 --- /dev/null +++ b/Modules/Platform/Linker/Linux-Swift.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/Linux-GNU-CXX) diff --git a/Modules/Platform/Linker/Windows-MSVC-Swift.cmake b/Modules/Platform/Linker/Windows-MSVC-Swift.cmake new file mode 100644 index 0000000..c29af13 --- /dev/null +++ b/Modules/Platform/Linker/Windows-MSVC-Swift.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-MSVC) + +__windows_linker_msvc(Swift) diff --git a/Modules/Platform/Linker/Windows-Swift.cmake b/Modules/Platform/Linker/Windows-Swift.cmake new file mode 100644 index 0000000..9478d04 --- /dev/null +++ b/Modules/Platform/Linker/Windows-Swift.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# MSVC is the default linker +include(Platform/Linker/Windows-MSVC-Swift) diff --git a/Modules/Platform/Linker/WindowsPhone-MSVC-Swift.cmake b/Modules/Platform/Linker/WindowsPhone-MSVC-Swift.cmake new file mode 100644 index 0000000..44d5b2d --- /dev/null +++ b/Modules/Platform/Linker/WindowsPhone-MSVC-Swift.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-MSVC-Swift) diff --git a/Modules/Platform/Linker/WindowsPhone-Swift.cmake b/Modules/Platform/Linker/WindowsPhone-Swift.cmake new file mode 100644 index 0000000..6d59769 --- /dev/null +++ b/Modules/Platform/Linker/WindowsPhone-Swift.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# MSVC is the default linker +include(Platform/Linker/WindowsPhone-MSVC-Swift) diff --git a/Modules/Platform/Linker/WindowsStore-MSVC-Swift.cmake b/Modules/Platform/Linker/WindowsStore-MSVC-Swift.cmake new file mode 100644 index 0000000..44d5b2d --- /dev/null +++ b/Modules/Platform/Linker/WindowsStore-MSVC-Swift.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-MSVC-Swift) diff --git a/Modules/Platform/Linker/WindowsStore-Swift.cmake b/Modules/Platform/Linker/WindowsStore-Swift.cmake new file mode 100644 index 0000000..9262564 --- /dev/null +++ b/Modules/Platform/Linker/WindowsStore-Swift.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# MSVC is the default linker +include(Platform/Linker/WindowsStore-MSVC-Swift) -- cgit v0.12