Commit Graph

1342 Commits

Author SHA1 Message Date
Jonas Devlieghere
8198d82845 [utils] Set CMAKE_OSX_DEPLOYMENT_TARGET for LLDB 2021-07-12 11:36:36 -07:00
Eric Miotto
376b6f20eb Implement differently logic to strip and copy the tvos libraries 2021-07-05 13:50:39 -07:00
Eric Miotto
245db5371d Strip i386 arch from tvOS compiler-rt lib (if present)
This is to avoid the following issue when generating toolchains for
macOS

```
ld: building for tvOS, but linking in object file built for tvOS
Simulator, file '/tmp/strip.mgCPcB' for architecture i386
fatal error:
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip:
internal link edit command failed
```

This reverts commit 8470faf309, #37929

Addresses rdar://80098850
2021-07-05 10:50:29 -07:00
Min-Yih Hsu
4ec8ee8b90 Merge pull request #38167 from mshockwave/dev-sil-deserialize
[SIL][Frontend] Simplify debug info generation flow for SIL files
2021-07-01 10:08:22 -07:00
Min-Yih Hsu
d00a6cc0e3 [SIL][Frontend] Simplify debug info generation flow for SIL files
- If any of the `-g<kind>` flag is given -- except `-gnone`, debug
   info will be printed into every generated SIL files.
 - The `-gsil` is deprecated in favor of `-sil-based-debuginfo`. The
   SILDebugInfoGenerator Pass now generates intermediate SIL file with
   name "<output file>.sil_dbg_<n>.sil". Other functionalities of that
   Pass remain the same.
2021-06-30 17:21:58 -07:00
Butta
a4ff4db508 [build] Add the flags to enable cross-compiling the corelibs
Pass the Swift and CMake flags needed to cross-compile Foundation and so on, with
the first example of Android. Add a new flag, --cross-compile-deps-path, which is
used to search for cross-compiled libraries, like libcurl, that the corelibs
depend on. Also add a new flag, --common-swift-flags, to pass additional Swift
flags to the corelibs.
2021-06-29 06:41:41 +05:30
Mishal Shah
8470faf309 Revert "Strip i386 arch from tvOS simulator lib" 2021-06-15 11:34:49 -07:00
Mishal Shah
a8ae401d0a Strip i386 arch from tvOS simulator lib 2021-06-11 17:25:25 -07:00
Mishal Shah
5a7b8c7922 Merge pull request #37823 from apple/xcode-13-beta-main
[main] Support Xcode 13 beta
2021-06-10 09:21:09 -07:00
Erik Eckstein
809ce72e05 libswift: build support for the initial libswift
* add the (still empty) libswift package
* add build support for libswift in CMake
* add libswift to swift-frontend and sil-opt

The build can be controlled with the LIBSWIFT_BUILD_MODE cmake variable: by default it’s “DISABLE”, which means that libswift is not built. If it’s “HOSTTOOLS”, libswift is built with a pre-installed toolchain on the host system.
2021-06-09 11:25:15 +02:00
Mishal Shah
23c3b15f5f Support Xcode 13 beta
* Updating availability versions
* Remove all remaining overlays in stdlib/public/Darwin/*:
   - ObjectiveC
   - Dispatch
   - CoreFoundation
   - CoreGraphics
   - Foundation
2021-06-07 12:04:31 -07:00
Alex Hoppen
4e6749d8a8 [build-script] Make lib_InternalSwiftSyntaxParser.dylib fat
Run `recursive-lipo` on `lib_InternalSwiftSyntaxParser.dylib` to make it a fat dylib that contains slices for all platforms.

Resolves rdar://78039407
2021-05-21 14:05:50 +02:00
Eric Miotto
ece22f391f [gardening] remove unnecessary condition in symbol extraction logic (#37428)
This was introduced to avoid indentation changes when making this logic
amenable to testing in #37120 .
2021-05-19 11:56:06 -07:00
Eric Miotto
c3f8dacdf0 [Build] allow to generate symbols for a subset of binaries (#37120)
This would be needed to reduce overall build times in scenarios when
generating symbols for all binaries is too expensive and/or not needed.

At the same time, introduce tests around the logic that handles symbols.

Addresses rdar://76865276
2021-05-13 07:32:41 -07:00
Eric Miotto
1e5f790d06 [Build] allow to generate symbols for a subset of binaries
This would be needed to reduce overall build times in scenarios when
generating symbols for all binaries is too expensive and/or not needed.

Addresses rdar://76865276
2021-05-12 10:02:41 -07:00
Eric Miotto
b903a6cc65 Put symbol generation logic under test
...before adding the logic to filter paths

In particular:
* print the list of files that `cpio` copies, so we can test explicitly
  which files end up in the symroot (and also see those when asking for
  a toolchain in PR testing)
* use `find` instead of `grep` to filter files we want symbols generated
  for -- this is to avoid the script failing when there are no symbol to
  process, especially in lit tests
* remove an unnecessary check for `swift-api-digester` -- this is now a
  symlink to `swift-frontend` and we only process regular files.

Supports rdar://76865276
2021-05-12 09:52:30 -07:00
Yuta Saito
1719148588 Add test case to ensure working static link with concurrency module 2021-04-28 23:52:11 +09:00
Mishal Shah
b5a01ba5e0 Support for x86_64 watchOS simulator
* Start testing watchOS simulator x86_64 and i386 by default

Users will require to install watchOS 6.2 or older simulator to support i386.

1. Install watchOS 6.2 or older simulator (Xcode -> Preferences -> Components -> Simulators).
2. Create a 32-bit watchOS device.
3. Run:
`xcrun simctl create 'Apple Watch Series 2 - 42mm' com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm com.apple.CoreSimulator.SimRuntime.watchOS-6-2`
2021-04-22 20:06:17 -07:00
Robert Widmann
b65777eabe Merge pull request #36963 from CodaFi/arm64_32
Add arm64_32 support for Swift
2021-04-20 17:42:56 -07:00
Mishal Shah
1b099067bf Merge pull request #36324 from apple/add_build_script_log
Add build_script_log file to help us understand the build times for e…
2021-04-20 16:41:09 -07:00
Artem Chikin
0d2ea35d68 Merge pull request #36960 from artemcm/RecursiveLipoException
Add an option to `recursive-lipo` to explicitly specify files to be merged
2021-04-20 15:58:34 -07:00
Robert Widmann
0149ccd0ca Add arm64_32 support for Swift
Commit the platform definition and build script work necessary to
cross-compile for arm64_32.

arm64_32 is a variant of AARCH64 that supports an ILP32 architecture.
2021-04-20 14:59:04 -07:00
Robert Widmann
c8ba622532 Merge pull request #36875 from keith/ks/add-support-for-cross-compiling-from-apple-silicon-to-intel
Add support for cross compiling from Apple Silicon to Intel
2021-04-20 09:42:26 -07:00
Artem Chikin
792e3ddba7 Add an option to recursive-lipo to explicitly specify files to be merged, even if contained in verbatim-copy directories, and use it for libSwiftScan.
This library is contained in `lib/swift/<OS>/`, which `recursive-lipo` assumes contains the stdlib, and other Swift code built fat from the get-go. `libSwiftScan` is a part of the compiler build, and is therefore built for the host in a given build, which means toolchain installation requries that we use `lipo` to produce a fat shared library for it.

Resolves rdar://74490218
2021-04-19 15:11:04 -07:00
Eric Miotto
3a551f8fcc [build] allow to specify ninja targets to build for LLVM (#36910)
This is meant to support scenarios in which we need to build as little as
LLVM as possible for performance reasons (e.g. when enabling LTO).

While LLVM CMake build system offers options in this sense,
in our investigation they turned out not to be suitable,
since either they are not granular enough (`LLVM_INCLUDE/BUILD` flags)
or they require active opt out for any new tool added
(`*_BUILD_*_TOOL` flags)

When using this mechanism, there is the possibility to specify different
targets to use for cross-compile hosts.

Supports rdar://32019390
2021-04-15 12:45:00 -07:00
Keith Smiley
23bb2338a6 Add support for cross compiling from Apple Silicon to Intel
If you have an Apple Silicon machine but want to produce an Intel
binary, using `--cross-compile-hosts macosx-x86_64` can be useful.
2021-04-12 16:44:00 -07:00
Robert Widmann
1fda005789 Just cp compiler-rt Files If lipo Fails
This workaround to remove legacy architectures from the .a's can fail.
When that happens, it usually means i386 was not among any of the slices
to begin with, so just copy the library out to its destination.
2021-04-07 13:09:02 -07:00
Eric Miotto
d350a0525e [build] Clean llbuild before building by default (#36686)
Introduce a new parameter `--skip-llbuild-clean` to prevent this from
happening.

This mimicks similar logic in place for `swiftpm`, `swift-driver`
(#33563)  and `xctest` (#19512)

Addresses rdar://75057069
2021-04-05 07:19:40 -07:00
Eric Miotto
a9252354af [build] use python3 when testing installable package
`lit.py` now requires python3 to run
2021-03-30 08:03:09 -07:00
Mishal Shah
08097964e9 Log build-script calls to .build_script_log file to help understand the build
times for each command.
2021-03-15 23:39:59 -07:00
buttaface
e6f5913772 [android] Move to the NDK's unified sysroot (#34491)
Since the NDK removes the platforms/ and sysroot/ directories in the latest NDK
22, switch to the unified sysroot in toolchains/llvm/ and take advantage of a
bunch of simplification that's now possible.
2021-02-07 09:19:18 -08:00
Dario Rexin
bcd6416c89 Revert "[Concurrency] Build C only libdispatch before Swift on non-Darwin pla… (#35738)" (#35789)
This reverts commit 74e59ab77f.
2021-02-05 13:51:39 -08:00
Dario Rexin
74e59ab77f [Concurrency] Build C only libdispatch before Swift on non-Darwin pla… (#35738)
* [Concurrency] Build C only libdispatch before Swift on non-Darwin platforms

_Concurrency depends on libdispatch and since it is not available by
default on non-Darwin platforms, it needs to be built before the Swift
project, so that the dependency can be resolved.

* Fix clibdispatch installation and BuildSystem tests

* Fix build system tests on Darwin and formatting
2021-02-04 17:15:30 -08:00
Varun Gandhi
36b589d623 Merge pull request #35538 from mininny/disable-dead-stripping-option
[build-script] Add swift-disable-dead-stripping option for disabling dead stripping
2021-01-31 16:31:48 -08:00
Mishal Shah
9a336f2528 Disable CMark tests by default 2021-01-30 11:43:00 -08:00
Eric Miotto
f9be289b9e [build] Amend target options for common C flags (#35559)
Follow up of #35406

Addresses rdar://73502059
2021-01-27 07:06:21 -08:00
Minhyuk Kim
b0426829fe Add swift_disable_dead_stripping option for disabling dead stripping in Swift build 2021-01-22 23:56:02 +09:00
Ikko Ashimine
802788fc1b Fix typo in build-script-impl
targetting -> targeting
2021-01-20 23:09:34 +09:00
Robert Widmann
b436825948 Trade Usages of -m${platform}-version-min For -target
There's no reason to use -m${platform}-version-min as of clang-11/Xcode 11. Clang is now smart enough to parse -target and provide Apple's ld with the appropriate -platform_version argument string.
2021-01-13 11:00:39 -08:00
Varun Gandhi
c6490b23a8 Merge pull request #34963 from buttaface/droid
[android] Support building the host tools and with the static stdlib
2021-01-11 07:42:41 -08:00
Butta
c74884ce30 [build] Make it possible to actually build the stdlib with a prebuilt clang 2020-12-13 18:22:33 +05:30
Butta
47d94da235 [android] Support building the host tools and with the static stdlib 2020-12-05 15:36:57 +05:30
Eric Miotto
8fc2598167 [build-script] Allow to tune dsymutil parallelism (#34795)
This should enable scaling when using machines with large amount of
RAM.

To better support machines with lower spec, process one binary per
dsymutil invocation (reverting #34149).

Add some (limited) facilities to gather the time taken to execute
dsymutil to better assist in tuning the parameter -- these are printed in
JSON format in the log to allow for easier scraping

```
{ "command": "dsymutil", "start": "2020-11-18T18:10:47" }
{ "command": "dsymutil", "end": "2020-11-18T18:14:45" }
```

Addresses rdar://71018443
2020-12-01 07:11:10 -08:00
Saleem Abdulrasool
f18dbf289e build: handle spaces in Xcode better (NFC)
Quote the path to the python interpreter.  Without this change, using a
path with a space in it will prevent CMake from configuring as the
python interpreter's path will be split.
2020-11-25 08:49:36 -08:00
Eric Miotto
e55d6a80e8 Use dedicated module cache to build xctest, llbuild and Foundation (#34728)
This is a small step to ensure multiple build jobs running on the same
machine (e.g. in CI) do not stomp on each other.

This PR does not cover the version detection of the Swift compiler
during the CMake configuration -- in there the compiler gets called once
without any of the `CMAKE_Swift_FLAGS`.

Addresses rdar://71373494
2020-11-13 14:47:00 -08:00
Butta
b7d26337e3 [android] Add support for x86_64 arch 2020-11-11 11:19:14 +05:30
Eric Miotto
f4b86c94a0 Build libdispatch with its own module cache (#34638)
Some of the bots in CI run multiple jobs, so we need to be sure
libdispatch compilations do not attempt to share the module cache.

Addresses rdar://68100533
2020-11-10 07:06:34 -08:00
Mishal Shah
73dc49fc3e [Build System] Remove tvOS i368 slice before copying the libs 2020-10-19 23:05:02 -07:00
Mishal Shah
cc542c0f10 [Build System] Remove tvOS i386 slice from compiler-rt lib
To fix this issue:
ld: building for tvOS, but linking in object file built for tvOS Simulator, file '/tmp/strip.rgKCdx' for architecture i386
fatal error: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: internal link edit command failed

rdar://70443440
2020-10-19 18:59:09 -07:00
3405691582
f4b71b5077 [build] OpenBSD can install XCTest. 2020-10-16 19:25:32 -04:00