Commit Graph

1633 Commits

Author SHA1 Message Date
Dmitri Gribenko
9f0d94c1b8 CMake: add dependencies on common gyb modules in 'utils/' 2016-04-18 14:00:37 -07: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
befbebcd30 [gardening] "OSX" → "OS X" 2016-04-11 23:12:40 +02: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
practicalswift
abfecfde17 [gardening] if ([space]…[space]) → if (…), for(…) → for (…), while(…) → while (…), [[space]x, y[space]] → [x, y] 2016-04-04 16:22:11 +02:00
Dmitri Gribenko
495cade645 Drop the libbsd dependency
We were only using arc4random, and now we use C++ <random> instead.  See
also PR #1939.
2016-03-30 17:37:21 -06: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
Jordan Rose
c43943d7a8 [build-script] Remove -X option for "edit-only" Xcode projects.
This has caused plenty of confusion and should no longer be necessary anyway.
2016-03-16 09:28:52 -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
Saleem Abdulrasool
8454cdbe55 Use the new LLVM cmake paths
Update the paths that we look in for the cmake modules from LLVM which changed
recently on SVN trunk.  Check the old paths first, and if that fails, check the
new path.  This permits building against either layout.
2016-02-16 15:15:10 -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
Jordan Rose
ba24407c65 [CMake] Fix build when SWIFT_STDLIB_ENABLE_RESILIENCE is off.
*Shatner voice* CMaaaaaaaaaake!
2016-02-10 10:37:05 -08:00
Jordan Rose
a4a4a80ac4 [CMake] Don't pass -sil-serialize-all under SWIFT_STDLIB_ENABLE_RESILIENCE.
Thanks, Slava!
2016-02-10 10:29:01 -08:00
Jordan Rose
6012485a24 [CMake] Remove old experimental option SWIFT_STDLIB_USE_ASSERT_CONFIG_RELEASE.
This is now controlled by SWIFT_STDLIB_ASSERTIONS.
2016-02-09 16:32:45 -08:00
Jordan Rose
1b8caf5998 [CMake] Add an option to compile the stdlib resiliently.
The short-term goal here is to get everything compiling and all the tests
passing.
The mid-term goal is to test the performance of a resilient stdlib.
The long-term goal is to make this the default (and only) build mode.

This should be considered EXPERIMENTAL; we can't even build libSwiftCore
successfully yet.
2016-02-09 16:32:45 -08:00
Dmitri Gribenko
b728b89b9d Merge pull request #1126 from harlanhaskins/profdata-merge
[coverage] Automatic merger for LLVM profile data
2016-02-03 11:02:47 -08:00
William Dillon
ab7c87e7e8 Implemented ARMv6 and fixed up ARMv7 2016-01-29 21:41:22 +00:00
Harlan Haskins
9fccf5058a [coverage] Fixed conflicts with master 2016-01-28 10:05:38 -08:00
Dmitri Gribenko
aeeb9c1325 Move collection testing code from StdlibUnittest to a new library
This brings down StdlibUnittest build time to 90 seconds with either
a DebugAssert or a ReleaseAssert compiler.

The new library, StdlibCollectionTests, is only built when running
validation tests.
2016-01-26 18:58:03 -08:00
Harlan Haskins
c6c0b3d5d0 [coverage] Removed explicit swift-%p.profraw arguments from CMake commands, because we're using LLVM's environment variables 2016-01-25 19:49:03 -08:00
Ben Langmuir
1ad89fb8a7 [CMake] Always use @rpath for XCTest
rdar://problem/23942371
2016-01-25 18:14:47 -08:00
Joe Groff
c62274c3b6 Link Swift images on ELF using -Bsymbolic.
We don't want references to local symbols within an image to be relocatable, since this increases startup time and causes problems with relative references.
2016-01-20 14:41:53 -08:00
David Farler
401666421d Properly set dylib versions on Darwin for production builds
This passes -current_version and -compatibility_version to the
Darwin linker when SWIFT_COMPILER_VERSION is set.

rdar://problem/23434683
2016-01-20 13:22:43 -08:00
Dmitri Gribenko
a74355426e Merge pull request #1008 from modocache/build-script-sil-verify-all
[build-script] Unify naming: `SIL_VERIFY_ALL`
2016-01-20 00:40:15 -08:00
Luke Larson
ba619a9ff2 [CMake] Support code coverage analysis 2016-01-19 18:51:07 -08:00
Brian Gesiak
cad395bf3b [build-script] Unify naming: SWIFT_SIL_VERIFY_ALL
Although the user sets the option using `--sil-verify-all`, various
build scripts refer to the option as `SWIFT_VERIFY_ALL`. Code comments
indicate that this may have been a separate setting at one time.

Remove the misleading comments and unify naming with
`--sil-verify-all` and `SWIFT_SIL_VERIFY_ALL`. This more closely matches what
the option actually does (adds `-Xfrontend -sil-verify-all` to `swiftc`
invocations during the build process).
2016-01-19 11:11:39 -05:00
Dmitri Gribenko
5a1f8b25a5 Merge pull request #979 from antonblanchard/powerpc64_merge
Add powerpc64le Linux support
2016-01-15 18:14:45 -08:00