Commit Graph

826 Commits

Author SHA1 Message Date
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
Dmitri Hrybenko
167f4faa0d CMake: don't hide symbol names in bitcode for debuggability
rdar://22330874

Swift SVN r31313
2015-08-18 22:03:01 +00:00
Jordan Rose
f5b1efb354 Move client-affecting configuration options into a generated Config.h.
This way they can be used from other projects, like LLDB. The downside
is we now have to make sure the header is included consistently in all
the places we care about, but I think in practice that won't be a problem,
especially not with tests.

rdar://problem/22240127

Swift SVN r31173
2015-08-12 17:50:13 +00:00
Jordan Rose
953424072e Guard "object literals" feature with SWIFT_ENABLE_OBJECT_LITERALS.
This is not a feature we're releasing at the moment, so provide a way
to turn it off.

rdar://problem/21935551

Swift SVN r30966
2015-08-04 00:16:52 +00:00
Michael Gottesman
c551ec6e17 Add support for emitting sib files to _compile_swift_files.
I am going to use this to enable the perftestsuite to compile .sib files next to
.o files. It will make it easier to work with the PerfTestSuite for the perf
engineers.

Swift SVN r30885
2015-07-31 21:29:44 +00:00
Dmitri Hrybenko
3b4e8cecca CMake: use the just-built libLTO to link the bitcode
The compiler in the toolchain might be too old, and might not be able to
parse the new bitcode format from llvm trunk.

rdar://21014369

Swift SVN r30047
2015-07-09 23:25:00 +00:00
Dmitri Hrybenko
7cdcb16cc4 CMake: LLVMParseArguments.cmake was removed, migrate to cmake_parse_arguments
Swift SVN r29699
2015-06-25 22:01:37 +00:00
Jordan Rose
99768eb346 Revert "Switch overlays from using @exported to -import-underlying-module."
This reverts r29441 because it breaks the Linux build. I'll talk to Dmitri
about this tomorrow.

See rdar://problem/21254367

Swift SVN r29444
2015-06-17 05:02:21 +00:00
Jordan Rose
c8bfc87c4e Switch overlays from using @exported to -import-underlying-module.
Some day we'll close the hole for @exported in the previous commit.

Swift SVN r29441
2015-06-17 04:48:06 +00:00
Doug Gregor
ffe4de6d6e Small fixes per Jordan's review
Swift SVN r29396
2015-06-16 00:05:12 +00:00
Doug Gregor
576902114c Allow per-SDK SWIFT_COMPILE_FLAGS.
Swift SVN r29394
2015-06-15 23:43:36 +00:00
Doug Gregor
1ae67e338c Explicitly weak-link the Contacts framework into its overlay.
Fixes rdar://problem/21030937, which came about because CNErrorDomain
is missing availability information, so we generate a normal external
reference rather than a weak one.

Swift SVN r28824
2015-05-20 05:08:21 +00:00
Dmitri Hrybenko
09b6048145 CMake: rename allow-bitcode-section to embed-bitcode-section
I forgot to 'git add' everything the first time.

Swift SVN r28767
2015-05-19 08:27:16 +00:00
Dmitri Hrybenko
ea17483633 Add CMake options and #ifs to hide tvOS
Swift SVN r28752
2015-05-19 05:15:52 +00:00
Dmitri Hrybenko
bb0ab47805 Add more missing dependencies for SDK overlays
Swift SVN r28612
2015-05-15 05:26:17 +00:00
Dmitri Hrybenko
a81fe1a617 CMake: don't eliminate dependencies on SwiftPrivate
... when building the overlay separately

We required this hack previously because we were not rebuilding
SwiftPrivate as a part of the overlay.

Swift SVN r28554
2015-05-14 03:20:29 +00:00
David Farler
08eb0034db Start including LLVM bitcode sections in Swift dylibs
This ports staged changes on the Xcode 7 branch back to master.
This change requires 7A113 or greater, or 7A92k or greater.

rdar://problem/20730441

Swift SVN r28537
2015-05-13 21:58:43 +00:00
Jordan Rose
d92a039ba7 Make the CoreImage overlay (nee QuartzCore) work for both 10.11 and older OSs.
On OS X 10.10 and earlier, CoreImage is a sub-framework of QuartzCore.
Users of CoreImage use "import QuartzCore" and link against QuartzCore.

On OS X 10.11 (and in the OS X 10.11 SDK), CoreImage is a top-level
framework. Users of CoreImage use "import CoreImage" and would link against
CoreImage. Of course, QuartzCore continues to re-export CoreImage's API.

When backwards-deploying, we need to continue linking against QuartzCore,
but still need to bring in the overlay if you import CoreImage. That's
what this patch does.

rdar://problem/20196610

Swift SVN r28449
2015-05-12 01:29:37 +00:00
Slava Pestov
fd256e70e3 EmitGuaranteedSelf is always on now
NFC except for removal of flag

Swift SVN r28427
2015-05-11 18:21:37 +00:00
David Farler
8c2248a482 Don't embed LLVM bitcode into the XCTest overlay
With bitcode enabled, the XCTest overlay fails to link because
XCTest.framework itself was not built with bitcode. For now, we should
not build this overlay with bitcode. It isn't embedded in apps.

rdar://problem/20884313

Swift SVN r28355
2015-05-09 01:28:05 +00:00
David Farler
db34787208 Add an AppleInternal path to framework search paths
watchOS XCTest was temporarily moved to an AppleInternal path,
so we need to add it to the framework search path to continue to
build the watchOS overlay.

rdar://problem/20883853

Swift SVN r28353
2015-05-09 01:23:06 +00:00
David Farler
89cef8171b Add support for LLVM bitcode sections
Add the machinery for, but don't enable, adding LLVM bitcode
sections to Swift standard library and overlay dylibs.

Part of rdar://problem/20730441.

Swift SVN r28329
2015-05-08 23:14:18 +00:00
David Farler
91c64fdbb1 Stop re-exporting the Objective-C library
and link it properly. This is needed to embed LLVM bitcode sections
in the standard library and overlays. The linker doesn't support
embedded bitcode and reexport flags (among others).

rdar://problem/20750099

Swift SVN r28052
2015-05-01 22:24:14 +00:00
David Farler
ca5876a866 swiftMarkup Library
Replace ReST-flavored documentation comments with Markdown.

rdar://problem/20180412

In addition to full Markdown support, the following extensions are
supported. These appear as lists at the top level of the comment's
"document". All of these extensions are matched without regard to
case.

Parameter Outlines
------------------

- Parameters:
  - x: ...
  - y: ...

Separate Parameters
-------------------

- parameter x: ...
- parameter y: ...

- Note:
Parameter documentation may be broken up across the entire comment,
with a mix of parameter documentation kinds - they'll be consolidated
in the end.

Returns
-------

- returns: ...

The following extensions are also list items at the top level, which
will also appear in Xcode QuickHelp as first-class citizens:

- Attention: ...
- Author: ...
- Authors: ...
- Bug: ...
- Complexity: ...
- Copyright: ...
- Date: ...
- Experiment: ...
- Important: ...
- Invariant: ...
- Note: ...
- Postcondition: ...
- Precondition: ...
- Remark: ...
- Remarks: ...
- See: ...
- Since: ...
- Todo: ...
- Version: ...
- Warning: ...

These match most of the extra fields in Doxygen, plus a few more per request.

Other changes
-------------
- Remove use of rawHTML for all markup AST nodes except for those
not representable by the Xcode QuickHelp XSLT - <h>, <hr/>, and of
course inline/block HTML itself.

- Update the doc comment RNG schema to more accurately reflect Xcode
QuickHelp.

- Clean up cmark CMake configuration.

- Rename "FullComment" to "DocComment"

- Update the Swift Standard Documentation (in a follow-up commit)

- Update SourceKit for minor changes and link against cmark
  (in a follow-up commit).

Swift SVN r27727
2015-04-26 00:07:15 +00:00
Doug Gregor
2c909b4d36 Remove Objective-C selector splitting options.
We're not going this way.

Swift SVN r27717
2015-04-25 03:59:00 +00:00
David Farler
21bc454392 Remove unused library search path
This library search path option isn't needed yet for CMark and
is probably not in the right place. Remove it for now.

Swift SVN r26721
2015-03-30 17:46:13 +00:00
Jordan Rose
38752c2d92 [CMake] Move swift_llvm_config to SwiftSharedCMakeConfig (for SourceKit).
...and rename it to swift_common_llvm_config.

This is the function that acts like llvm_config but handles the LLVM build
being a different configuration from the Swift (or SourceKit) build, which
can be problematic for multi-configuration build schemes like Xcode.

There's also one fix here: LLVM dependencies for dylibs weren't being
properly added. (This is the "SHARED_LIBRARY" case near the bottom.)

Swift SVN r26631
2015-03-27 16:36:43 +00:00
David Farler
654f74c4f4 Build armv7s for iOS, use architecture names in paths
Up to now we've been assuming that we have only one 32-bit target and
one 64-bit target per platform. There is a need to be able to build
armv7s for iOS, but assumptions abound in the organization of files per
architecture - tests, cmake targets, and installation.

- Build armv7s when building for iOS
- Use the actual architecture name, not blank or "/32" in all paths
  related to architecture.

Testing: Clean buildbot incremental RA tests pass (requires a test
update in SourceKit as well).

rdar://problem/20206215

Swift SVN r26600
2015-03-26 20:25:32 +00:00
David Farler
b60cf1efd4 Build iOS overlays for TVOS
SDK overlays built for iOS were guarded as iOS only. These are also
available in the tvOS SDK.

rdar://problem/20278575

Swift SVN r26499
2015-03-24 21:43:55 +00:00
David Farler
b60613458b cmark Build Support
<rdar://problem/20180372>

Build cmark alongside llvm and clang.
If the clone doesn't exist, build-script-impl will clone it in the
workspace. Also update the README and update-checkout scripts.

Swift SVN r26364
2015-03-20 22:32:19 +00:00
Erik Eckstein
5526a938e0 cmake: _compile_swift_files now accepts multiple output files.
Swift SVN r26257
2015-03-18 09:58:05 +00:00