Commit Graph

303 Commits

Author SHA1 Message Date
Harlan
90b05744d0 [build] Don't attempt to build the runtime with coverage (#2958) 2016-06-08 17:58:47 -07:00
Michael Gottesman
a5d817257a [build-script-impl] Rename swift-enable-lto => swift-tools-enable-lto
This makes it clear to the user that they are enabling lto only for swift tools,
not for the swift standard library/runtime.

rdar://24717107
2016-06-07 19:03:03 -07:00
Dmitri Gribenko
83b9815c52 CMake: Xcode: add a dummy source file to standard library dylib as well
This seems to be needed when object libraries are in use.
2016-06-02 01:13:40 -07:00
Dmitri Gribenko
66626baa88 CMake: set the 'header' property on .def and .td files 2016-06-02 01:13:40 -07:00
Dmitri Gribenko
2b001bb7f7 CMake: fix non-optimized standard library builds
Fix fallout from my recent change: SwiftOnoneSupport was attempted to be
linked into the runtime, but only in non-optimized mode.
2016-06-01 10:27:29 -07:00
Dmitri Gribenko
d227aeb64d CMake: use object libraries instead of repacking static archives 2016-06-01 03:06:33 -06:00
SpringsUp
ca24fd5785 Specify '-resource-dir' when compiling Swift libraries, so we can find
libraries for the destination host when cross-compiling.
2016-05-27 15:36:03 +02:00
David Farler
2a81691eab AddSwift.cmake: Install into resource dir based on TARGET_LIBRARY
not IS_STDLIB. There are other non-stdlib libraries that can go
into the platform resource directory, such as libswiftRemoteMirror.dylib.

rdar://problem/26435454
2016-05-23 19:54:02 -07:00
Dmitri Gribenko
d9d0825813 CMake: build target libraries together with the stdlib
This avoids building swiftRemoteMirror for all targets by default.
2016-05-21 23:36:44 -07:00
Dmitri Gribenko
92c34760ad CMake: pass down the HOST_LIBRARY flag to _add_swift_library_single() 2016-05-21 23:36:44 -07:00
Dmitri Gribenko
b31581ca55 CMake: rename an obscure IS_HOST flag to HOST_LIBRARY 2016-05-21 23:36:44 -07:00
David Farler
f3500e4a3c lib/SwiftReflection shouldn't link libswiftCore
Although this is a target library, it does not need to link against
the standard library, because it doesn't have any Swift content in
it. We need to add a separate build flag for having CMake content
because saying a library "IS_STDLIB" isn't correct for this case.

rdar://problem/26399625
2016-05-20 17:28:25 -07:00
Sandeep Dasgupta
c529006896 This will make archiving compatible to other archive tools 2016-05-19 18:37:19 -07:00
Michael Gottesman
b901341bb5 [cmake] Remove debug statement that snuck in.
I believe this came in during changes to cmark. I talked with DFarler and he
said it was debug code. Lets remove it.
2016-05-18 17:22:00 -07:00
Brian Gesiak
4afca9d92b [CMake] Move 'handle_swift_sources', add function
Create a new CMake file responsible for functions that handle Swift
source files, such as `handle_swift_sources`. Also, add a new function,
`add_swift_source_group`, to this file. This function reduces some
duplication in `AddSwift.cmake`.
2016-05-05 16:35:20 -07:00
David Farler
450a3d82c4 AddSwift: Fix typo in static library dependency append 2016-04-27 12:55:00 -07:00
practicalswift
9a078b54ef [gardening] Fix recently introduced typo: "a executable" → "an executable"
[gardening] Fix recently introduced typo: "a offset" → "an offset"
[gardening] Fix recently introduced typo: "accessiblity" → "accessibility"
[gardening] Fix recently introduced typo: "cant" → "can't"
[gardening] Fix recently introduced typo: "inteference" → "interference"
[gardening] Fix recently introduced typo: "unsatified" → "unsatisfied"
[gardening] Remove accidental space.
2016-04-24 22:11:59 +02:00
Slava Pestov
0d34bc21ef IRGen: Emit reflection metadata for certain builtin types when -enable-reflection-builtins flag is passed in
These types are not directly referenced as fields of aggregate types,
but are needed for reflection type lowering.

Also, use a SetVector to collect referenced builtin types, instead of
a SmallPtrSet, to ensure compiler output is deterministic.
2016-04-22 22:36:05 -07:00
Slava Pestov
98abbdb332 Emit reflection metadata, but not reflection names, by default
This allows the reflection type lowering test to pass with the
default build configuration.
2016-04-21 15:15:30 -07:00
Dmitri Gribenko
af874abdbf Merge pull request #2244 from modocache/swiftandroid-ndk-version-bump-r11c
[android] Support latest Android NDK r11c
2016-04-20 15:15:21 -07:00
Brian Gesiak
b1a4fd90b5 [RemoteAST] Only build remoteast-test for host
swift-remote-ast has dependencies that cannot be satisfied by all
of the targets Swift supports. Specifically, the Android target is
unable to link libraries that libRemoteAST depends on, such as uuid.
To fix builds for unsupported platforms, only build remoteast-test
for the host platform.
2016-04-20 17:16:07 -04:00
Brian Gesiak
a7e2329444 [android] Support latest Android NDK r11c
- Update the documentation to reflect that Swift supports (only)
  the latest NDK version. Based on what I've heard from Android
  developers that use the NDK, this is a reasonable requirement.
- The most recent version of the Android NDK no longer includes a
  "4.8" toolchain version. Change the default to "4.9", and update
  the paths in the documentation to match.
- The build script option "--android-ndk-version" was misleading.
  This parameter actually refers to the Android API level. Swift
  currently supports 21 (Android 5.0) and above (although supporting
  lower API levels would be desirable).
2016-04-20 11:20:29 -04:00
swift-ci
728d21a00d Merge pull request #1442 from SwiftAndroid/master 2016-04-12 23:30:17 -07:00
Slava Pestov
9d6f723d14 Reflection: Add -swift-stdlib-enable-reflection-metadata flag for testing
This causes IRGen to emit metadata for our new out-of-process reflection
mechanism. Eventually this flag should be the default.
2016-04-12 19:15:36 -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
1ef6ea8c4c [gardening] \t → " " 2016-04-08 21:59:13 +02:00
Dmitri Gribenko
29e4c4e9b7 CMake: fix spelling of a variable name 2016-04-07 11:44:11 -07:00
David Farler
e1eca69d1a Ensure swiftReflection is always built for the host
swift-reflection-dump, a host-side tool, requires this library that
normally builds for the configured platform. So, if the host platform
isn't configured to build for some reason, swift-reflection-dump will
fail to link.
2016-04-04 15:23:07 -07:00
David Farler
61c14d1759 Use target_link_libraries for fat executable dependencies
These were getting added to the link command line manually,
which can cause coincidental library ordering issues.
2016-03-28 16:34:44 -07:00
David Farler
5ea5bb06a3 Split swift-refleciton-test into host and target test targets
swift-reflection-test is now the test that forks a swift executable
and performs remote reflection, making it runnable on other targets,
such as the iOS simulator.

swift-reflection-dump is now a host-side tool that dumps the remote
reflection sections for any platform binary and will continue to
link in LLVM object file support.

This necessitates finally moving lib/Refleciton into stdlib/public,
since we're linking target-specific versions of the test tool and
we would eventually like to adopt some of this functionality in
the runtime anyway.
2016-03-28 16:34:44 -07:00
Slava Pestov
34e41f2e81 built-script: Add --swift-stdlib-sil-serialize-all flag
We want to have the option of building the standard library without
-sil-serialize-all.

For now, the build crashes in the SIL verifier due to various issues;
upcoming patches will address these.

This is part of the larger goal of building the stdlib with
-enable-resilience.

Part of https://bugs.swift.org/browse/SR-267.
2016-03-22 17:13:34 -07:00
Doug Gregor
da60535ced [Driver / API Notes] Re-introduce "-apinotes" driver flag to compile API notes.
Using Clang to compile API notes introduces a dependency on the
underlying Clang, which can cause problems as Clang's support for API
notes evolves. Re-introduce the "-apinotes" driver flag into the Swift
driver to allow us to compile API notes, and use that (rather than
Clang) to precompile API notes for the overlays.
2016-03-04 14:12:15 -08:00
Michael Gottesman
11c8a7c674 [cmake] Add support for specifying the number of parallel link jobs for swift.
I am going to use the link job for limiting swift lto compile time.

The reason not to use the same variables as LLVM (i.e. LLVM_PARALLEL_LINK_JOBS)
is that Swift since it is compiling more IR may have a larger memory
representation implying less parallel linking jobs than LLVM can be used on
bots.
2016-03-01 16:33:53 -08:00
Michael Gottesman
5c3513657a When compiling with lto enabled, use -gline-tables-only instead of -g when debugging is enabled.
-g uses too much memory. -g-line-stables at least lets you get stack traces,
etc.

This is also what clang does IIRC.
2016-02-29 19:51:12 -08:00
Roman Levenstein
cc224e1408 Modify a CMake rule: executables generated by Swift depend on swiftSwiftOnoneSupport.
This makes sure that such executables are only built after swiftSwiftOnoneSupport is built.
2016-02-29 18:35:18 -08:00
Michael Gottesman
96d1864a38 [cmake] Fix some errors in the cmake code that enables LTO.
When I originally committed the LTO code, I tried to match the coding style of
the code right above it that enabled code coverage. Turns out that the code
coverage code did not have a weird coding style and instead just had a bug.

I fixed both of the issues and also enabled the LTO flag on non-Darwin.
2016-02-29 13:04:49 -08:00
Michael Gottesman
644005dd5f [cmake] Remove the code needed to support USR dtrace probes. We do not use them anymore. 2016-02-26 15:55:41 -08:00
Mishal Awadah
0448b73e8c [cmake] Remove debug message. 2016-02-25 18:48:11 -08:00
mawadah
9494681745 [cmake] Allow Swift libraries to individually build for specific
deployment targets.
2016-02-25 16:54:43 -08:00
practicalswift
1647e018c2 [gardening] Fix recently introduced typo: "optmized" → "optimized" 2016-02-25 22:17:27 +01:00
Roman Levenstein
8dff92ad4d Move pre-specializations of popular types away from the standard library.
Pre-specializations were only used by Onone builds, but were kept inside the standard library dylyb anyways. This commit moves all the pre-specializations into a dedicated Swift module and a dynamic library, which are only used by Onone builds.

This reduces the code size of libswiftCore.dylib by 4%-5%.
2016-02-25 11:23:15 -08:00
Todd Fiala
ceb58eac1e Merge branch 'master' of ssh://github.com/apple/swift 2016-02-22 22:00:10 -08:00
Todd Fiala
efc6cc3e2a Revert "Most swift targets should depend on SwiftOnoneSupport, except Core and SwiftOnoneSupport"
This reverts commit a374d1b0fa.
2016-02-22 21:19:32 -08:00
Xi Ge
dd74e1c0ef [Serialization] Add a new front-end argument to specify the path of the group info file. NFC 2016-02-22 20:28:39 -08:00
Roman Levenstein
a374d1b0fa Most swift targets should depend on SwiftOnoneSupport, except Core and SwiftOnoneSupport 2016-02-22 19:29:22 -08:00
Han Sangjin
e06c7136cb Porting to Cygwin. rebased and squashed 2016-02-22 13:20:21 +09:00
Michael Gottesman
e3548ddaf6 [cmake] Add an option to compile the compiler with -flto.
This doesn't hit the runtime. I am going to try that in a little bit.

I saw some nice reductions in compile time in the SILOptimizer in the stdlib.
Specifically, we went from spending ~33 seconds in the siloptimizer -> ~23
seconds. There were other improvements as well.

Keep in mind, I have not tested this with debug info, so it may hog all of your
ram due to crazy amounts of debug info. It would be good to try and do what LLVM
does which is to compile with line tables but not full types.

rdar://24717107
2016-02-18 02:15:16 -08:00
William Dillon
d0d9b1de5a Discard swift.ld and support gold linker 2016-02-17 17:47:35 -08:00
Luke Larson
d4ece4b4d0 [benchmark] Correctly depend on stdlib targets 2016-02-15 17:22:07 -08:00
David Farler
e6b15b6027 Consistently use list(APPEND for adding linker arguments
The Xlinker flags were getting globbed into a single string since
we started adding current/compatibility version arguments to the
linker.

rdar://problem/24622276
2016-02-12 13:54:07 -08:00