Commit Graph

141 Commits

Author SHA1 Message Date
Arnold Schwaighofer
de0218bf09 Adjust to LLVM's DarwinSDKInfo.h changes 2021-08-05 12:15:22 -07:00
Mishal Shah
3722bcb85a Revert "[concurrency] Implement a compatibility .a library for Concurrency." 2021-07-29 11:26:51 -07:00
Michael Gottesman
8441871a04 [concurrency] Implement a compatibility .a library for Concurrency.
In a back deployment scenario, this will provide a place where one could provide
function implementations that are not available in the relevant stdlib.

This is just setting up for future work and isn't doing anything interesting
beyond wiring it up/making sure that it is wired up correctly with tests.
2021-07-23 17:30:18 -07:00
Jeremy Legendre
1a381683e4 Fix relative libLTO path 2021-07-12 15:36:33 -04:00
Jeremy Legendre
35735e7d0c [LTO] Driver support for -lto_library flag
This commit adds support for the -lto_library flag, allowing users to specify a custom LTO library on Darwin. This also fixes an issue where the default LTO library is used even if Driver is run from inside an alternate toolchain.
2021-07-05 18:01:40 -04:00
Artem Chikin
3dc6837bc4 Pass .tbd inputs down to the linker invocation.
Part of rdar://78881502
2021-06-04 14:44:09 -07:00
Alex Hoppen
7e6b5b24a4 [Driver] Don't validate arclite linking if the driver is only set up to get the swift-frontend invocation
If the driver is only set up to get the frontend invocation (e.g. from sourcekitd), don't validate that we can link against ARCLite because
a) we don't care about link-time when we are only interested in the frontend invocation
b) finding arclite might cause us to find clang using xcrun which in turn can cause sourcekitd to hang.

rdar://50659268
2021-03-16 23:47:50 +01:00
Alejandro Alonso
424802fb34 Revert SE-0283 (#34492)
Reverted despite build failures.
2020-10-29 17:32:06 -07:00
Azoy
df9778e2e8 [Compatibility53] Add compatibility library for 5.3 and backport tuple Equatable conformance
Fix some comments

Unnecessary cast
2020-10-22 18:27:03 -04:00
Robert Widmann
6125d25cb4 [NFC] Silence Non-Exhaustive Switch Warnings on Windows 2020-10-14 13:26:09 -07:00
Michael Gottesman
f196c16532 Merge pull request #32430 from kateinoigakukun/katei/llvm-lto-driver
[LTO] Support LLVM LTO for driver
2020-09-18 14:49:07 -05:00
Brent Royal-Gordon
1ac99176d8 Revert "[Apple Silicon] Adjust linking deployment target from 11.0 down to 10.16 on x86."
This reverts the functional portions of commit 5566ace6e0 and adjusts the tests.
2020-08-03 11:37:35 -07:00
Yuta Saito
d6cddaabb5 [LTO] Support LLVM LTO for driver
This commit adds LTO support for handling linker options and LLVM BC
emission. Even for ELF, swift-autolink-extract is unnecessary because
linker options are embeded in LLVM BC content when LTO.
2020-07-31 10:17:59 +09:00
Brent Royal-Gordon
6e7c6fdd9b Merge pull request #33148 from brentdax/runtime-revolution
Adjust to simulator compiler-rt change
2020-07-28 16:42:09 -07:00
Brent Royal-Gordon
86ff24bfbf [NFC] Clean up unused simulator special cases
The previous commit makes various simulator-specific platform helpers dead code. Remove them.
2020-07-27 18:21:42 -07:00
Brent Royal-Gordon
9a76985fe5 Adjust to simulator compiler_rt change
The compiler_rt static library for iOS simulator is now packaged in a separate static archive from the one for iOS devices. Adjust linker invocation to match.

Fixes rdar://66192830 / rdar://66060312.
2020-07-27 18:21:42 -07:00
Xi Ge
cc8d27c419 Front-end: sink SDK version implementation to lib/Basic. NFC 2020-07-27 16:16:12 -07:00
Nathan Hawes
962e0bbd56 Merge pull request #32606 from nathawes/prefer-macOS-to-OSX-spelling-when-printing-platform
[AST] Prefer the 'macOS' spelling over 'OSX' when printing the platform kind.
2020-07-09 17:11:27 -07:00
martinboehme
40104ba8b1 Link against the C++ standard library when C++ interop is enabled (#30914)
This doesn't yet allow including C++ headers on platforms where libc++
isn't the default; see comments in UnixToolChains.cpp for details.

However, it does, for example, allow throwing and catching exceptions in C++
code used through interop, unblocking
https://github.com/apple/swift/pull/30674/files.

The flags (-enable-experimental-cxx-interop and -experimental-cxx-stdlib) carry
"experimental" in the name to emphasize that C++ interop is still an
experimental feature.

Co-authored-by: Michael Forster <forster@google.com>
2020-07-09 15:59:26 +02:00
Nathan Hawes
244dc4a768 [AST] Rename PlatformKind::OSX to PlatformKind::macOS
Because the names are coming from a .def file used for printing too, this
simplifies the printing logic as well.
2020-07-08 16:29:31 -07:00
Doug Gregor
f818a1e1b0 [Driver/IRGen] Put backward-deployment libraries into a table.
Describe the backward-deployment libraries via a preprocessor-driven
table. Macro-metaprogramming the two places in the code base---the
driver and IRGen---to use this tabble to determine which
backward-compatibility libraries to link against.
2020-07-07 23:11:37 -07:00
Mishal Shah
60d996f060 [Apple Silicon] Add support for triple and availability canonicalization 2020-07-02 19:26:25 -07:00
Mishal Shah
710ba14ddc [Apple Silicon] [Platform] Baseline arm64 simulators at iOS/tvOS 14.0 and watchOS 7.0. 2020-07-02 19:18:52 -07:00
Mishal Shah
a8aec14bce [Apple Silicon] Adjust linking deployment target from 11.0 down to 10.16 on x86. 2020-07-02 18:31:09 -07:00
Mishal Shah
3c9e72f6e1 [Apple Silicon] [macCatalyst] Baseline arm64(e) macCatalyst at Swift 5.3/iOS 14.0. 2020-07-02 18:28:33 -07:00
Mishal Shah
134f202e01 [Apple Silicon] Baseline arm64 macOS at Swift 5.3 / macOS 10.16 2020-07-02 16:42:15 -07:00
Saleem Abdulrasool
71309a8fa9 Revert "[LTO] Support LLVM level link time optimization on Darwin, Linux and Windows" 2020-06-07 11:25:48 -07:00
Yuta Saito
915c4a6997 [LTO] Support LLVM level link time optimization
This commit adds -lto flag for driver to enable LTO at LLVM level.
When -lto=llvm given, compiler emits LLVM bitcode file instead of object
file and perform thin LTO using libLTO.dylib plugin.
When -lto=llvm-full given, perform full LTO instead of thin LTO.
2020-05-31 08:12:52 +09:00
Doug Gregor
2e3b220d44 [Basic] Remove swift::tripleIsAnySimulator().
It's just Triple::isSimulatorEnvironment() now.
2020-04-20 08:50:34 -07:00
Saleem Abdulrasool
fbbf61f297 Revert "[Darwin] Further restrict inference of the simulator environment" 2020-04-19 16:43:22 -07:00
Doug Gregor
22cdddd84e Merge pull request #30771 from DougGregor/stop-inferring-simulator
[Darwin] Further restrict inference of the simulator environment
2020-04-17 20:59:39 -07:00
Joe Groff
948372b87c Merge pull request #31087 from jckarter/compatibility-51
Start a Compatibility51 library for backporting fixes to Swift 5.1 runtimes
2020-04-17 15:06:50 -07:00
Joe Groff
42514f42e0 Start a Compatibility51 library for backporting fixes to Swift 5.1 runtimes 2020-04-17 10:41:48 -07:00
Doug Gregor
992ca5651a [Basic] Remove swift::tripleIsAnySimulator().
It's just Triple::isSimulatorEnvironment() now.
2020-04-16 11:42:07 -07:00
Doug Gregor
290e9edaf8 [Driver/Frontend] Add target variant SDK version for Catalyst. 2020-04-15 22:11:11 -07:00
Doug Gregor
548e28170a [Driver/Frontend] Thread the target SDK version through to the IR.
Teach the driver to pass the SDK version it computes (from the SDK
settings JSON in a Darwin-based platform's SDK) down into the frontend.
The frontend then sets that SDK version in the LLVM module, which
eventually makes its way into the Mach-O file.

Last part of rdar://problem/60332732.
2020-04-15 21:42:28 -07:00
Doug Gregor
82ceb29576 [Driver] Fix platform name to match what the linker does, not what it says 2020-04-03 13:51:29 -07:00
Doug Gregor
970ff6b818 [Driver] Read SDK version information to pass to the Darwin linker.
Recent-ish SDKs for Darwin platforms include an SDKSettings.json
file with version information and Catalyst SDK version mappings. Read
these (when available) and use them to pass the appropriate SDK
version down to the Darwin linker via `-platform_version`.

Finishes rdar://problem/55972144.
2020-04-02 21:07:26 -07:00
Doug Gregor
6edc32568c [Driver] Adjust Mac Catalyst deployment target to >= iOS 13 for the linker
Mac Catalyst was introduced with an iOS deployment target of 13.0.
If given a deployment target before that, adjust the deployment target
to 13.0 for the linker.
2020-04-02 21:07:26 -07:00
Doug Gregor
336c0c2d54 [Driver] Use -platform_version to specify platform versions for the Darwin linker
Standardize the way in which we pass platform version information to
the Darwin linker, using the `-platform_version` option. In the case
of Mac Catalyst, there may be two such platform arguments.

The eventual point of this refactoring is to also pass information
about the SDK version, which `-platform_version` supports but the
mix of `-*_version_min` parameters do not. For now, the SDK
version is stubbed out to 0.0.0, which is this option's "unknown"
value.

Part of rdar://problem/55972144.
2020-04-02 21:07:26 -07:00
Devin Coughlin
655d89b146 [Driver/Frontend] Add Driver support for macCatalyst and library search paths
Add support in the driver and frontend for macCatalyst target
targets and library search paths.

The compiler now adds two library search paths for overlays when compiling
for macCatalyst: one for macCatalyst libraries and one for zippered macOS
libraries. The macCatalyst path must take priority over the normal macOS path
so that in the case of 'unzippered twins' the macCatalyst library is
found instead of the macOS library.

To support 'zippered' builds, also add support for a new -target-variant
flag. For zippered libraries, the driver invocation takes both a -target and a
-target-variant flag passes them along to the frontend. We support builds both
when the target is a macOS triple and the target variant is macCatalyst and
also the 'reverse zippered' configuration where the target is macCatalyst and the
target-variant is macOS.
2020-01-21 18:28:17 -08:00
David Ungar
aee3cb482e Try both in filelist for linker 2019-11-18 22:19:43 -08:00
David Ungar
1f60d4479e Work with either source of inputs. 2019-11-18 17:53:52 -08:00
David Ungar
76c4742ba0 Use correct designator for filelist 2019-11-18 17:07:22 -08:00
Dan Zheng
3bbc50430b Add -no-toolchain-stdlib-rpath flag. (#27207)
Add `-no-toolchain-stdlib-rpath` flag: the negative version of
`-toolchain-stdlib-rpath`.

Make `-no-toolchain-stdlib-rpath` be the default: use `/usr/lib/swift` as
default RPATH on Darwin platforms instead of toolchain standard library.

Adapted from https://github.com/apple/swift/pull/27206.

tensorflow branch requires the opposite default (use toolchain standard
library as RPATH) because some stdlib modules like TensorFlow do not exist in
`/usr/lib/swift`.
2019-09-21 04:38:25 -07:00
Jordan Rose
87b7ee1bc0 Tweak Swift-in-OS check to account for linker limitations
The backwards-deployment install name trickery we're using doesn't
handle "patch" components in version numbers, so we still need to
provide an rpath even when deploying to macOS 10.14.4.
2019-08-02 13:33:36 -07:00
Graydon Hoare
fa244b2334 Factor out toolchains::Darwin::addLinkerInputArgs. 2019-08-02 13:33:36 -07:00
Jordan Rose
7fb43af6e5 Factor out toolchains::Darwin::addSanitizerArgs. 2019-08-02 13:33:36 -07:00
Graydon Hoare
71dd7417be Factor out toolchains::Darwin::addProfileGenerationArgs. 2019-08-02 13:33:36 -07:00
Graydon Hoare
7953d59571 Factor out toolchains::Darwin::addDeploymentTargetArgs. 2019-08-02 13:33:36 -07:00