Commit Graph

48 Commits

Author SHA1 Message Date
Slava Pestov
694fcddf4e Remove build-script flag to disable resilience 2018-03-16 19:56:17 -07:00
Michael Gottesman
56adc6b061 Revert "[cmake] Always add local swift compilation jobs to the local job pool."
This reverts commit c4038de7bc.

Seems to not be working... until I figure out why, I am reverting this.
2018-03-12 10:23:32 -07:00
Michael Gottesman
c4038de7bc [cmake] Always add local swift compilation jobs to the local job pool.
Compiling swift modules are always compiled local... so put them in the local
job pool.
2018-03-11 12:48:27 -07:00
Lance Parker
414614cf88 Revert "Revert "[stdlib]Enable Swift 4 mode for the overlays (#12608)"" (#12751)
This reverts commit bcf5d66c8e.
2017-11-06 14:03:48 -08:00
Mishal Shah
bcf5d66c8e Revert "[stdlib]Enable Swift 4 mode for the overlays (#12608)"
This reverts commit f54d8b4ef2.
2017-11-03 11:52:30 -07:00
Lance Parker
f54d8b4ef2 [stdlib]Enable Swift 4 mode for the overlays (#12608)
Enable Swift 4 mode for the overlays
2017-11-03 10:11:45 -07:00
Roman Levenstein
5047e1b475 Enable the serialization of sil_vtables by default and completely remove the -sil-serialize-vtables option
Only sil_vtables of public classes with fixed layout are serialized.
2017-10-21 11:36:12 -07:00
Roman Levenstein
48d9b99675 Remove -sil-serialize-witness-tables flag completely
The functionality is always enabled now and there is no need to have a dedicated flag for it.
2017-10-20 19:45:29 -07:00
Roman Levenstein
9134153bd3 Stop using -sil-serialize-all when building the standard library
We can finally get rid of -sil-serialize-all when building the standard library! This option will be completely eliminated in the future commits.

Instead of serializing just everything as we did before, we now serialize only functions annotated with @_inlineable. This way we can selectively control what needs to be available to the clients. This is an important step towards building a resilient standard library.

While this is a huge change for the serialization of the stdlib, it should be virtually invisible to the clients. For example, there are no noticeable performance regressions on any of the benchmarks.
2017-10-02 14:34:14 -07:00
Robert Widmann
0cf1b52452 Treat Cygwin as a separate OS
Cygwin is considered a distinct target with a distinct ABI, environment
conditions, and data types.  Though the goal of the project is
native Windows integration with UNIX-likes, that is not compatible with
the idea that the platform can be ignored as Win-like enough to have the
existing os(Windows) condition apply.
2017-06-28 13:31:05 -07:00
Hugh Bellamy
4a219e45d3 Merge pull request #8583 from hughbe/error-message-file
Improve error message for missing response file in line-directive
2017-06-22 14:31:26 +07:00
Arnold Schwaighofer
ca63326e1b Delete unused existential value witnesses from the old existential
implementation

And remove the SWIFT_RUNTIME_ENABLE_COW_EXISTENTIALS flag.
2017-06-02 14:34:41 -07:00
Erik Eckstein
7b6d9afe47 cmake: add a build-script-impl option --report-statistics to pass the -stats-output-dir option when compiling swift libraries 2017-06-01 12:16:20 -07:00
Doug Gregor
66b11cbc3d [SE-0160] Make deprecated @objc inference warnings opt-in.
The warnings about deprecated @objc inference in Swift 3 mode can be a
bit annoying; and are mostly relevant to the migration workflow. Make
the warning emission a three-state switch:

* None (the default): don't warn about these issues.
* Minimal (-warn-swift3-objc-inference-minimal): warn about direct
  uses of @objc entrypoints and provide "@objc" Fix-Its for them.
* Complete (-warn-swift3-objc-inference-complete): warn about all
  cases where Swift 3 infers @objc but Swift 4 will not.

Fixes rdar://problem/31922278.
2017-05-01 16:25:50 -07:00
Ted Kremenek
d36b0b6b1f Compile all standard library as Swift 3 mode. 2017-04-19 22:36:34 -07:00
Ted Kremenek
6106868eb1 Force -swift-version 3 for Standard Library and overlays. 2017-04-19 21:58:40 -07:00
Hugh Bellamy
7692a1a706 Improve error message for missing response file in line-directive 2017-04-06 22:55:55 +07:00
practicalswift
ca72b12287 [gardening] Remove accidental \t:s 2017-04-02 16:03:54 +02:00
Doug Gregor
6244abf9f9 [Driver] Surface -warn-swift3-objc-inference to swiftc.
The `-warn-swift3-objc-inference` option turns out to be extremely
useful in vetting code for unintended `@objc` entry points, so make it
available directly on `swiftc`.

But, bury the enable/disable flags under `-frontend` (they were
effectively there anyway because the driver wasn't propagating them).
2017-03-31 21:53:59 -07:00
Doug Gregor
79440cd7f4 [CMake] Warn about @objc inferred via the deprecated rules in stdlib/overlay builds
We want to know about these, both because they have an impact on our migration to Swift 4 and because we don’t want to vend extra Objective-C entry points.
2017-03-31 21:22:16 -07:00
Hugh Bellamy
1d1d070f13 Remove old .swiftdoc file before creating new .swiftdoc file 2017-03-25 14:47:19 +07:00
Doug Coleman
8c2bd5ae23 cmake: Initial standalone overlays builds.
./utils/build-overlay AVFoundation OSX macosx
rdar://problem/28707246
2017-03-14 12:51:42 -07:00
Arnold Schwaighofer
d42c806d60 Add an option to build the runtime with copy-on-write existentials 2017-03-09 17:22:35 -08:00
Mikio Takeuchi
a1efa55c63 Add -swift-stdlib-use-nonatomic-rc option to build-script-impl. std::getenv is still used in SILOptions.h since it has a wider coverage 2017-02-27 12:17:53 +09:00
Saleem Abdulrasool
d2fcc0c123 Merge pull request #7451 from hughbe/remove-swiftmodule
Fix build, edit, build loop on Windows
2017-02-19 11:38:59 -08:00
Hugh Bellamy
3387b90c4b [CMake] Replace manual fatal error messages in SwiftSource.cmake with preconditions 2017-02-17 11:53:41 +07:00
Hugh Bellamy
70054ba09e Fix build, edit, build loop on Windows 2017-02-14 09:40:54 +07:00
Hugh Bellamy
3b4187fcbb Fix line-directive tool to work around Windows command line max limit 2017-01-26 09:34:55 +00:00
Hugh Bellamy
89205d8f6b Invoke the line directive tool from python 2017-01-14 21:37:29 +00:00
Michael Gottesman
c9a6532e08 [cmake] Add support for generating targets for a -Onone sib stdlib and a -O sib stdlib, but do not build them by default.
This is useful for engineers who do not want to reconfigure to look at a
-Onone/-O sib stdlib.
2017-01-09 16:39:23 -08:00
Michael Gottesman
7f06ef40dc [cmake] Instead of using EMIT_SIB to generate sib output, just generate targets
for sib/sibgen files for libraries without building them by default.

This will let engineers just cd into the build directory and type:

ninja swift-stdlib-sib
ninja swift-stdlib-sibgen

To generate sib and sibgen files respectively.

There are still some dependency issues in between the sib targets, so to get
this to work well, I would suggest doing a full build and then using these
targets.
2016-12-17 18:38:32 -08:00
Jordan Rose
26d8a9f649 [CMake] Don't pass -embed-bitcode to module generation commands. (#6109)
These are the commands Pete added in 5834df3, doing slightly more work
by compiling Swift sources twice in order to start building downstream
libraries sooner.

Really, we should diagnose when -embed-bitcode is passed here, instead
of generating nonsense commands and then falling over. I filed
https://bugs.swift.org/browse/SR-3352 for that.

rdar://problem/29537164
2016-12-06 16:42:48 -08:00
Peter Cooper
43add7cfa1 Fix <rdar://problem/29053173> by checking for module_name before generating module command.
We need to actually have a module name and outputs or else the add_custom_command will try to
generate multiple commands all with the name NOTFOUND.

Note, this bug was introduced in 5834df33f9 via PR #5472.
2016-11-01 15:29:40 -07:00
Peter Cooper
53ecbf2486 Change stdlib build to depend on .swiftmodule's instead of .o's for swiftc deps.
Currently SwiftOnoneSupport.o waits on Swift.o to finish compiling before we start
compiling SwiftOnoneSupport.o.  We don't need the .o for compilation but instead just
need Swift.swiftmodule which we were generating anyway.

This change causes .o and { .swiftmodule, .swiftdoc } to be built independently of each
other.  Downstream compiles only wait on the module while downstream links wait on the .o.

Given that .apinotes are sometimes used by swiftc invocations, this also separates out
apinotes in to its own step which these other commands can both depend on.

The result of this is a 30% improvement in building the stdlib with -R and 20% with -d.
Specifically, -R drops from 3m to 2m and -d drops from 12m to just under 10m.
2016-10-31 14:25:14 -07:00
Michael Gottesman
b16d4fa505 [semantic-arc] Add build-script option --enable-sil-ownership to turn on the SIL ownership model.
rdar://28685236
2016-10-11 11:29:12 -07:00
Jordan Rose
aaebfc11c0 [CMake] Derive module names from target names rather than source file names. (#4494)
This will remove the restriction that overlays always need to have a source
file matching the name of the framework, at the "cost" of standardizing the
"swiftFoo" convention for libraries with a module named "Foo". (Until
someone exposes the MODULE_NAME setting at the add_swift_library level.)

If this passes all tests, a follow-up commit will adjust the names of
some of the source files in stdlib/.

rdar://problem/17535693
2016-08-26 09:08:26 -07:00
Dmitri Gribenko
0e838c4bbe Merge pull request #3428 from compnerd/msvc
Platform: port to msvcrt, add msvcrt module
2016-07-13 14:10:47 -07:00
Michael Gottesman
51af90bc8e [cmake] Rename SWIFT_BUILD_TOOLS => SWIFT_INCLUDE_TOOLS
In LLVM, the convention is that *_INCLUDE_* means that cmake will generate
targets but says nothing about whether or not something will be built by default
or not. This means that as far as cmake is concerned, those targets do not
exist.

On the other hand, *_BUILD_* determines whether or not a class of things is a
dependency of the "all" target. Of course this implies that *_BUILD_* implies
that *_INCLUDE_* must be set to TRUE.

Currently SWIFT_BUILD_TOOLS is implemented like a *_INCLUDE_* option, so change
its name to SWIFT_INCLUDE_TOOLS.
2016-07-12 21:08:55 -07:00
Saleem Abdulrasool
a05fd17b64 Platform: port to msvcrt, add msvcrt module
This adds the swiftMSVCRT module which is similar in spirit to swiftGlibc and
swiftDarwin, exposing the Microsoft C Runtime library to swift.  Furthermore,
disable pieces of the standard library which are not immediately trivially
portable to Windows.  A lot of this functionality can still be implemented and
exposed to the user, however, this is the quickest means to a PoC for native
windows support.

As a temporary solution, add a -DCYGWIN flag to indicate that we are building
for the cygwin windows target.  This allows us to continue supporting the cygwin
environment whilst making the windows port work natively against the windows
environment (msvc).  Eventually, that will hopefully be replaced with an
environment check in swift.
2016-07-12 17:31:06 -07:00
swift-ci
a02d518778 Merge pull request #2744 from compnerd/ELF-is-protected 2016-06-05 23:02:39 -07:00
Dmitri Gribenko
85ff8ff556 CMake: work around an issue with CMake Xcode generator and the Swift driver
The Swift driver does not update the mtime of the output files if the
existing output files on disk are identical to the ones that are about
to be written.  This behavior confuses the makefiles used in CMake Xcode
projects: the makefiles will not consider everything up to date after
invoking the compiler.  As a result, the standard library gets rebuilt
multiple times during a single build.

To work around this issue we touch the output files so that their mtime
always gets updated.
2016-06-02 16:04:43 -07:00
Saleem Abdulrasool
8f01620179 Revert "Build workaround: only consider shims to be protected in Swift code on Darwin."
This reverts commit 3e20817f8c.  Now that we are
using gold, this should work.  The work around is only needed for BFD linkers.
2016-05-27 07:44:59 -07:00
David Farler
a38a4ce596 SwiftRemoteMirror: Turn on reflection metadata by default
Flip the enable flags to disable and make these IRGen options
true by default.

rdar://problem/26206547
2016-05-21 17:40:37 -07:00
John McCall
3e20817f8c Build workaround: only consider shims to be protected in Swift code on Darwin.
GNU ld seems to have problems with PC-relative references to
protected functions that aren't calls.  We'll generate that
pattern in Swift code in release builds because of function
merging.  The workaround is to just not tell the compiler
that these symbols can be addressed PC-relative when we might
be using GNU ld, which I've conservatively approximated as
"not Darwin" while I try to figure out what changed to cause this.
2016-05-19 16:46:58 -06:00
John McCall
b1983621d3 Fix the declaration of shim visibility on ELF platforms.
Declarations with protected visibility are assumed to be defined
within the current linkage unit, so we have to use default visibility
if we don't know that we're building that.  Teach the shim
visibility header to only use protected visibility when the
__SWIFT_CURRENT_DYLIB macro is defined, and define it when building
the standard library.  Eventually we should change
SWIFT_RUNTIME_STDLIB_INTERFACE and SWIFT_RUNTIME_EXPORT to be
parameterized by the defining dylib so that this works for all the
overlay stubs, too; for now, special-casing swiftCore is necessary
to fix the LInux build.
2016-05-19 14:38:34 -06:00
Erik Eckstein
62597ea58f build_script: Add an option to build the swift libraries multiple times to check if incremental compilation works.
A script checks if the output object file is written only once even if the compiler is invoked multiple times.
The main purpose of this check is to ensure that the compiler is deterministic (until IRGen).
2016-05-18 10:01:14 -07:00
David Farler
83c17d29b7 Remove -enable-refleciton-builtins flag, now unnecessary
We can always potentially emit 'builtin' reflection metadata, since
that now includes imported types referenced by the module.

rdar://problem/26259668
2016-05-12 20:49:35 -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