Commit Graph

506 Commits

Author SHA1 Message Date
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
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
David Farler
4377eb8d62 Merge pull request #453 from timbodeit/use_internal_sdk-remove-leftovers
[AddSwift.cmake] Remove leftover use_internal_sdk parameter values
2016-01-15 11:26:50 -08:00
Luke Larson
9f2105b36e [CMake] Globally track produced libraries per platform
rdar://problem/23955856
2016-01-12 18:36:36 -08:00
Davide Italiano
c3292dba02 [CMake] Pass -lpthread on FreeBSD.
At the time this code was originally written, Swift standard
library hasn't been ported to FreeBSD, so we didn't need any
additional library. This is not true anymore, so fix it.
2016-01-08 22:26:47 +00:00
Tim Bodeit
b0185ccb6d [AddSwift.cmake] Remove leftover use_internal_sdk parameter values
The `use_internal_sdk` flag has been removed from `_add_variant_link_flags` and
`_add_variant_c_compile_flags` in commit
d9bbb6caf0

In four instances where previously FALSE was given as the value for that
parameter, this value has not been removed from the call.
This causes the two functions to try to append flags to FALSE instead of the
respective link_flags and c_compile_flags variables.
2016-01-06 18:29:36 +01:00
Ryan Lovelett
dd342bbb84 Remove unused method add_swift_llvm_loadable_module
This function was discovered to be unused during the review of #435. It
was requested that it be removed as a subsequent pull.
2015-12-22 20:20:12 -05:00
Dmitri Gribenko
67da5b6483 Merge pull request #480 from dcci/coalesce
Coalesce protocol conformance sections on FreeBSD.
2015-12-13 03:30:13 -08:00
Davide Italiano
10ee8ba877 Update AddSwift.cmake 2015-12-13 06:25:51 -05:00
Davide Italiano
c97d1753d5 Coalesce protocol conformance sections on FreeBSD. 2015-12-13 11:27:06 +00:00
Dmitri Gribenko
ba6643c7a4 CMake: allow the build to succeed when the path to Xcode contains spaces
Tests still have issues in that setup.
2015-12-11 18:56:30 -08:00
Landon Fuller
a51494a146 Add comment to clarify the empty if block, as per gribozavr's review feedback. 2015-12-04 14:02:28 -07:00
Landon Fuller
a7ec794287 Add basic build system and Driver support for FreeBSD targets/hosts. 2015-12-04 12:24:46 -07:00
Chris Willmore
872b8ac8b0 Linux cmake script env doesn't have pushd/popd. 2015-11-20 18:53:33 -07:00
Chris Willmore
df2fe71d15 Pull libswiftStdlibStubs.a, libswiftRuntime.a into libswiftCore.a
libswiftStdlibStubs.a is meant to be an intermediate built product
that's pulled into libswiftCore.a, not its own thing. Add a post-build
step for libswiftCore.a to pull all the object files into it from
libswiftStdlibStubs.a.

(Also, be careful only to do this for private link libraries that are
actually targets.)

<rdar://problem/23621157>
2015-11-20 17:26:33 -08:00
Chris Willmore
3d79008bbf Revert "Pull libswiftStdlibStubs.a, libswiftRuntime.a into libswiftCore.a"
This reverts commit 7dee5354f5 because it
broke the Linux build.
2015-11-20 17:12:10 -08:00
Chris Willmore
7dee5354f5 Pull libswiftStdlibStubs.a, libswiftRuntime.a into libswiftCore.a
libswiftStdlibStubs.a is meant to be an intermediate built product
that's pulled into libswiftCore.a, not its own thing. Add a post-build
step for libswiftCore.a to pull all the object files into it from
libswiftStdlibStubs.a.

<rdar://problem/23621157>
2015-11-20 17:04:52 -08:00
David Farler
d9bbb6caf0 Remove checks and references to internal Apple SDKs.
These aren't available for use outside of Apple.

rdar://problem/23302539
2015-11-16 16:07:55 -08:00
Jordan Rose
24b5136700 [CMake] Remove bogus dependency on "bin/swiftc".
When we're building the compiler, we already depend on the "swift" target.
When we're /not/ building the compiler, it had better already be there.

Squelches a CMake warning.
2015-11-13 16:25:34 -08:00
David Farler
ad95b5ff81 Use analogous rpath settings for Swift libraries on Linux
This was defaulting to the build directory, which isn't helpful
post-install. Set Swift libraries to look in the same directory
(ORIGIN) or /usr/lib/swift/linux.

rdar://problem/22766758
2015-11-12 17:15:20 -08:00
Dmitri Hrybenko
2e51d23875 Un-ifdef object literals
Swift SVN r32880
2015-10-25 07:50:53 +00:00
Dmitri Hrybenko
de5fe48bc5 CMake: allow customizing install_name for standard library dylibs
<rdar://problem/23173251>

Swift SVN r32865
2015-10-24 04:56:32 +00:00
Dmitri Hrybenko
d679d9aa0b CMake: remove a feature to install stdlib dylibs
We're not using it.

Swift SVN r32864
2015-10-24 04:56:28 +00:00
Jordan Rose
2a1a6edf9e [CMake] Update for changes to LLVM CMake API (LLVM r248911).
This (mostly coincidentally) only affects Xcode users.

Swift SVN r32853
2015-10-24 00:42:40 +00:00
Todd Fiala
711c76e1ae Add gold linker support for Swift executables and shared libraries on Linux.
This skips the Swift standard library due to the linker script incompatibility
issue.

As before for other related projects, the build-script-impl option
'--use-gold-linker' triggers usage of this.


Swift SVN r32706
2015-10-15 15:26:12 +00:00
Dmitri Hrybenko
0c1b6f8760 CMake: fix separate overlay builds
When building overlay separately, look for dylibs in the overlay
build directory first, and only then fall back to the compiler resource
directory.

If the overlay changes the ABI, we shouldn't even try the dylibs in the
compiler resource directory, that is certain to fail the build or
result in miscompiles.

rdar://22866170

Swift SVN r32382
2015-10-01 22:14:49 +00:00
David Farler
2a0f027317 Review changes for _compiler_version
A couple of small tweaks to _compiler_version based on review comments:
- Fix &&/|| rejection to work with _compiler_version on either side of the
expression. Also add some test cases around this.
- Use clang/LLVM facilities for isdigit and atoi.
- Assert if parsing an invalid version string and there is no diagnostic
engine.
- Clean up some crumbs in the CMake configs.

rdar://problem/22730282

Swift SVN r32212
2015-09-24 22:47:01 +00:00
David Farler
9d373d0fc7 Add _compiler_version build configuration
This configuration clause will suppress lex diagnostics and skip parsing
altogether if the code under the clause isn't active - the compiler must
have a repository version greater than or equal to the version given to
_compiler_version.

This option is only meant to be used sparingly and not to track the
Swift *language* version.

Example, if using a compiler versioned 700.0.28:

  #if _compiler_version("700.0.23")
    print("This code will compile for versions 700.0.23 and later.")
  #else
    This + code + will + not + be + parsed
  #endif

Included are new diagnostics for checking that the version is formatted
correctly and isn't empty.

New tests:
- Compiler version comparison unit tests
- Build configuration diagnostics
- Skipping parsing of code under inactive clauses

rdar://problem/22730282

Swift SVN r32195
2015-09-24 02:14:47 +00:00
Jordan Rose
68b6a442ae [CMake] Make .def files show up in Xcode even if they're in lib/.
...instead of include/. LLVM already takes care of .h files, but not .def.

Swift SVN r31632
2015-09-02 18:31:47 +00:00
Jordan Rose
765fab169a [CMake] Don't pretend to support MSVC.
These might very well be the right things to do, but no one's tested that.

Swift SVN r31537
2015-08-27 18:47:27 +00:00
Dmitri Hrybenko
7f09fbc63d Revert "CMake: don't hide symbol names in bitcode for debuggability"
This reverts commit r31313.

This change caused an unacceptable dylib size increase:
- watchOS core dylib size increased from 13 Mb to 25 Mb,
- iOS dylib size increased 40 Mb to 76 Mb.

The size change is due to change of the bitcode section size.  It can be
attributed to:
- actual symbol strings that we have started to include;
- full debug info.  Symbol obfuscation was also changing full debug info
  in LLVM metadata into line tables.

rdar://22330874, again.

Swift SVN r31473
2015-08-26 03:20:01 +00:00
Arnold Schwaighofer
f6224bd3f0 Allow libraries to specify to be compiled against the internal variant of the SDKs
We will need this to switch the darwin targets over to use ICU instead of going
to NSString for string operations. The public SDK does not contain the headers
for ICU - only the dylib.

For builds using a public SDK users can specify the path to an ICU install where
the headers can be found. If this path is specified the logic will not use
internal SDK variants.

Swift SVN r31471
2015-08-26 02:55:45 +00:00
Michael Gottesman
d074d6f646 [cmake] Add an option SWIFT_EXPERIMENTAL_EXTRA_NEGATIVE_REGEXP_FLAGS
This is a negative version of the flag
SWIFT_EXPERIMENTAL_EXTRA_REGEXP_FLAGS. The reason why an additional flag
is needed is that cmake does not support negative regexes in the regex
string itself. Instead you need to do:

if (NOT "..." MATCHES "...")
  ...
endif()

This suggests that we either needed to introduce more complexity into
SWIFT_EXPERIMENTAL_EXTRA_REGEXP_FLAGS or just introduce another flag. I
decided to go with the later.

Swift SVN r31417
2015-08-23 04:14:27 +00:00
Jordan Rose
53b1cf2b09 [CMake] Fix dependencies for CloudKit.
...which unfortunately meant splitting tvOS out from iOS.

Swift SVN r31343
2015-08-19 20:57:02 +00:00