Commit Graph

62 Commits

Author SHA1 Message Date
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
Doug Gregor
3a9b8bc658 [Driver] Add unversioned triple to the output of -print-target-info.
SwiftPM wants to use the unversioned triple to know where to put
results. Vend this as part of -print-target-info.
2019-12-19 09:10:58 -08:00
Saleem Abdulrasool
23b1a6b87a Driver: add support for WASI/WASM toolchain
Treat WASM/WASI as a generic Unix toolchain.  This adds the necessary
support to build a toolchain for WASM/WASI.
2019-12-04 20:14:08 -08:00
pi1024e
47aa97708e Simplifying the flow (#28010)
* Simplified flow of Platform.cpp to reduce number of branches

* Update Platform.cpp

* Update Platform.cpp
2019-11-09 16:41:58 -08:00
swift-ci
a6f4a4650b Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-04 12:43:45 -07:00
Joe Groff
0ae86c9c9d IRGen: Backward-deploy fix using open-coded accessors.
If we mangled an opaque associated type while targeting an older OS, we can use a \9
accessor reference string to instantiate the associated type.
2019-09-04 10:22:17 -07:00
Brent Royal-Gordon
fb20b503ba Merge branch 'master' into master-rebranch
# Conflicts:
#	lib/ClangImporter/ClangImporter.cpp
#	test/IRGen/builtins.swift
#	test/IRGen/enum.sil
#	tools/driver/autolink_extract_main.cpp
#	utils/build-presets.ini
2019-08-08 17:07:59 -07:00
Saleem Abdulrasool
5de7c6f33e Basic: normalise android triples when loading modules
The android API level can be ignored when loading the module.  The API
level controls the NDK APIs which are available and is equivalent to the
SDK version for Darwin.  This allows us to keep the API level in the
triple which future versions of Android's toolchain does.
2019-08-05 20:14:30 -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
c2556ebf7d <rdar://43616773> Add swift::tripleHasSwiftInTheOS helper. 2019-08-02 13:27:02 -07:00
swift-ci
ed38fe6251 Merge remote-tracking branch 'origin/master' into master-next 2019-06-04 10:09:06 -07:00
Joe Groff
4ed8de10f9 Revert "Revert "Use autolinking to pull in compatibility libraries."" 2019-06-03 20:10:51 -07:00
swift-ci
fd329da063 Merge remote-tracking branch 'origin/master' into master-next 2019-06-03 14:29:47 -07:00
Joe Groff
a7cc3a38cc Revert "Use autolinking to pull in compatibility libraries." 2019-06-03 14:18:39 -07:00
swift-ci
40c3c8caa5 Merge remote-tracking branch 'origin/master' into master-next 2019-06-03 08:30:09 -07:00
Joe Groff
dffd1b27a1 Use autolinking to pull in compatibility libraries.
Many build systems that support Swift don't use swiftc to drive the linker. To make things
easier for these build systems, also use autolinking to pull in the needed compatibility
libraries. This is less ideal than letting the driver add it at link time, since individual
compile jobs don't know whether they're building an executable or not. Introduce a
`-disable-autolink-runtime-compatibility` flag, which build systems that do drive the linker
with swiftc can pass to avoid autolinking.

rdar://problem/50057445
2019-05-31 13:11:14 -07:00
Saleem Abdulrasool
a75e8fbd21 Basic: adjust for LLVM SVN r357552
`Emscripten` is now an OS in the enumeration.
2019-04-03 09:40:07 -07:00
swift-ci
2a8c973aff Merge remote-tracking branch 'origin/master' into master-next 2019-02-28 16:09:52 -08:00
Brent Royal-Gordon
64760981d0 [NFC] Restyle getTargetSpecificModuleTriple()
* Adds documentation comments.
* Turns redundant cases into comments.
* Removes the else branch in a couple “if (…) return …; else return …;” patterns.
2019-02-27 11:44:10 -08:00
Brent Royal-Gordon
c1cc51d1f3 Use target triple for “universal” modules
When loading a module supporting multiple targets, the module loader now looks for a file named with a normalized version of the target triple first, and only falls back to the architecture name if the normalized triple is not found.
2019-02-27 11:43:12 -08:00
Bob Wilson
93b29dcc89 master-next: Add switch case for new Hurd triple in llvm r347832 2019-02-08 14:22:56 -08:00
Bob Wilson
411fae3e5e [master-next] Add HermitCore OS type for LLVM triples
LLVM r340675 added a new HermitCore OS type to triples, which broke the
Swift build because it is using -Werror,-Wswitch and the new value was not
handled in swift::getPlatformNameForTriple
2019-02-07 16:52:45 -08:00
Davide Italiano
35968ed6bc [Platform] Catch up with LLVM upstream. COWS is now WASI. 2019-01-16 10:25:30 -08:00
Adrian Prantl
5a9a59ec6a Add missing enum case 2019-01-15 11:01:33 -08:00
Bob Wilson
fa5ee3d717 master-next: Add switch case for new Hurd triple in llvm r347832 2018-11-29 12:56:14 -08:00
swift-ci
d5b96980be Merge remote-tracking branch 'origin/master' into master-next 2018-09-14 09:09:31 -07:00
Saleem Abdulrasool
d281b98220 litter the tree with llvm_unreachable
This silences the instances of the warning from Visual Studio about not all
codepaths returning a value.  This makes the output more readable and less
likely to lose useful warnings.  NFC.
2018-09-13 15:26:14 -07:00
Bob Wilson
8aa01ec974 [master-next] Add HermitCore OS type for LLVM triples
LLVM r340675 added a new HermitCore OS type to triples, which broke the
Swift build because it is using -Werror,-Wswitch and the new value was not
handled in swift::getPlatformNameForTriple
2018-08-27 10:37:20 -07:00
Jordan Rose
d11704bcc9 Add swift::getNonSimulatorPlatform for DarwinPlatformKind
And use it in getDarwinLibraryNameSuffixForTriple, making the logic
there clearer.

Suggested by David U!
2018-07-11 15:09:53 -07:00
swift-ci
4815c1a745 Merge remote-tracking branch 'origin/master' into master-next 2017-11-28 19:50:29 -08:00
Graydon Hoare
d3613b8017 [Platform] Support triple.isSimulatorEnvironment() 2017-11-28 13:51:01 -08:00
Michael Gottesman
b369760f43 [upstream-update] Add AMDPAL to getPlatformNameForTriple switch. 2017-10-01 23:22:36 -07:00
swift-ci
a448d28b77 Merge remote-tracking branch 'origin/master' into master-next 2017-09-22 18:09:44 -07:00
Calvin Hill
aee81d272f Add Initial platform support for Haiku. (#11583) 2017-09-22 21:06:56 -04:00
Bob Wilson
213965b629 [master-next] Reapply change to remove Bitrig platform.
This reverts commit 35cbd7e847.
2017-08-03 17:11:42 -07:00
Bob Wilson
35cbd7e847 Roll-back part of master-next change 63a9943a46
The swift-4.1-branch of LLVM still has the Bitrig platform.
2017-08-03 14:12:37 -07:00
Jordan Rose
63a9943a46 Trivial updates for upstream LLVM changes.
- BitRig is gone
- llvm::enumerate's element type now uses methods instead of fields

No intended functionality change.
2017-07-25 14:11:03 -07:00
Bob Wilson
951e26323e Add case for Ananas OS to fix warning after LLVM r306237. 2017-07-05 11:56:00 -07:00
Hugh Bellamy
2c1bc3c822 Fix warnings for unhandled triples after LLVM upstream update
> warning C4062: enumerator 'llvm::Triple::Fuchsia' in switch of enum
'llvm::Triple::OSType' is not handled
> warning C4062: enumerator 'llvm::Triple::Contiki' in switch of enum
'llvm::Triple::OSType' is not handled
> warning C4062: enumerator 'llvm::Triple::LastOSType' in switch of enum
'llvm::Triple::OSType' is not handled
2017-01-26 10:11:34 +00:00
Han Sangjin
b8dd577693 [swiftc] Fixed for Cygwin
Fixed for the difference of Cygwin with other Windows variants (MSVC,
Itanium, MinGW).

- The platform name is renamed to "cygwin" from "windows" which is used
  for searching the standard libraries.

- The consideration for DLL storage class (DllExport/DllImport) is not
  required for Cygwin and MinGW. There is no problem when linking in
  these environment.

- Cygwin should use large memory model as default.(This may be changed
  if someone ports to 32bit)

- Cygwin and MinGW should use the autolink feature in the sameway of
  Linux due to the linker's limit.
2017-01-19 05:48:24 +09:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Michael Gottesman
636311072c [gardening] Eliminate warning from build due to uncovered switch. 2016-10-19 10:49:15 -07:00
Saleem Abdulrasool
83901998c9 Port for PS4
Add support for the PS4 OS.  Update the standard library and add a target unit
test.
2016-06-30 20:14:50 -07:00
Saleem Abdulrasool
0cf0786481 Basic: use switch instead of cascading if's
Rather than have a series of cascading if conditionals, use a switch.  Although
Darwin and android are special, they can be handled just as cleanly in the
switch version.  NFC.
2016-06-27 12:02:45 -07:00
Ryan Lovelett
0c0bcbb094 Convert "armv7l" to "armv7" for the architecture component of paths (#2369)
On the Raspberry Pi 2 when trying to import Glibc, without this patch, it will attempt to
find the module map at "/usr/lib/swift/linux/armv7l/glibc.modulemap" and
fail to do so.

With this patch it will attempt to find the module map at
"/usr/lib/swift/linux/armv7/glibc.modulemap" where it will succeed in
finding the module map.

Similar behavior currently happens in the Driver and Frontend. To DRY up
this behavior it has been extracted to the Swift platform.
2016-05-02 15:25:58 -07:00
Zhuowei Zhang
7c502b6344 Port to Android
This adds an Android target for the stdlib. It is also the first
example of cross-compiling outside of Darwin.

Mailing list discussions:

1. https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151207/000171.html
2. https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000492.html

The Android variant of Swift may be built using the following `build-script`
invocation:

```
$ utils/build-script \
  -R \                                           # Build in ReleaseAssert mode.
  --android \                                    # Build for Android.
  --android-ndk ~/android-ndk-r10e \             # Path to an Android NDK.
  --android-ndk-version 21 \
  --android-icu-uc ~/libicu-android/armeabi-v7a/libicuuc.so \
  --android-icu-uc-include ~/libicu-android/armeabi-v7a/icu/source/common \
  --android-icu-i18n ~/libicu-android/armeabi-v7a/libicui18n.so \
  --android-icu-i18n-include ~/libicu-android/armeabi-v7a/icu/source/i18n/
```

Android builds have the following dependencies, as can be seen in
the build script invocation:

1. An Android NDK of version 21 or greater, available to download
   here: http://developer.android.com/ndk/downloads/index.html.
2. A libicu compatible with android-armv7.
2016-04-12 19:26:21 -04:00
practicalswift
ea0ac3ac67 [gardening] Remove all tabs in C++ code 2016-04-08 21:22:57 +02:00
AnnaZaks
767d9ca914 Merge pull request #1434 from apple/asan
[asan] Add basic support for Address Sanitizer function instrumentation
2016-02-29 18:58:40 -08:00
zaks
2110235fd3 [asan] Cleanup based on Jordan's review comments 2016-02-26 16:02:40 -08:00