Commit Graph

1330 Commits

Author SHA1 Message Date
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
Dave Lee
804459df81 Merge pull request #34212 from apple/build-Remove-unused-lldb-cmake
[build] Remove unused lldb cmake
2020-10-14 11:03:17 -07:00
Dave Lee
b02dc2b25b LLDB_PATH_TO_SWIFT_SOURCE too 2020-10-13 21:13:13 -07:00
Eric Miotto
0f6611cfad [build] properly install compiler-rt from Xcode toolchain (#31247)
Similarly to what was done for #25547, copy the compiler-rt built-ins
for embedded platforms from the Xcode toolchain into the new generated
one, so to avoid link time errors.

Addresses SR-12001, rdar://57837918
2020-10-12 07:12:04 -07:00
Dave Lee
27330f169d [build] Remove unused lldb cmake 2020-10-06 18:17:32 -07:00
Saleem Abdulrasool
563c99bc7c Merge pull request #34160 from buttaface/arm
[android] Add support for building the toolchain for ARMv7
2020-10-04 14:40:44 -07:00
Dave Lee
573886d5d6 [build] Remove forced tracing of lldb dotest 2020-10-03 11:59:59 -07:00
Butta
f7576a7bef [android] Add support for building the toolchain for ARMv7 2020-10-03 18:55:23 +05:30
Eric Miotto
7271fd079e [build] Run dsymutil on multiple files at a time (#34149)
The change in #33654 had the effect of not leveraging dsymutil
parallelism -- pass instead multiple file at once.

Addresses rdar://69550787
2020-10-02 10:06:44 -07:00
Alex Lorenz
a4c39632f4 [build-script] copy over the compiler-rt .a archives from the toolchian only when necessary 2020-09-23 12:12:21 -07:00
Kuba (Brecka) Mracek
41f91d5365 Add a SWIFT_FREESTANDING_MODULE_NAME CMake option (#34018) 2020-09-22 15:14:44 -07:00
Kuba (Brecka) Mracek
58f2ae695b Add a SWIFT_STDLIB_STABLE_ABI flag to be able to build the stdlib without -enable-library-evolution (#33443) 2020-09-21 16:33:00 -07:00
Michael Gottesman
48558f322b Merge pull request #33950 from gottesmm/pr-4bccd8250f399d6de00468d798d40b170fe4edf2
[build-script-impl] Add a comment explaining why an option isn't truly dead as per reviewers suggestion.
2020-09-15 21:26:54 -07:00