Commit Graph

1631 Commits

Author SHA1 Message Date
Saleem Abdulrasool
e3b699bb59 build: overwrite the fat libraries with the targets
Ensure that the use the target specific names for the fat libraries for
non-MachO targets which do not support fat libraries.  This fixes the
windows build.
2018-12-03 19:39:50 -08:00
swift-ci
1c703bfc94 Merge pull request #20902 from compnerd/windows-modules 2018-11-29 22:16:04 -08:00
Saleem Abdulrasool
3d1839a016 build: support SWIFT_MODULE_DEPENDS_WINDOWS
Add support for depending on swift modules for the windows target.  This
is needed as the private swift modules start to build on Windows.
2018-11-29 19:26:59 -08:00
Saleem Abdulrasool
16a4af0e5b build: assume a parallel tree layout for unified builds
Attempt to repair the build for the unified swift build.  This allows us
to build a single unified toolchain with swift support.  In this layout
assume that cmark and clang are peers of LLVM rather than located in
`tools`.  Doing so allows a uniform layout of the tree and a simpler
build approach.
2018-11-29 12:26:02 -08:00
Michael Gottesman
f0fb3cf70f [gardening] Invert an if condition to reduce indentation. 2018-11-28 23:18:27 -08:00
Daniel Rodríguez Troitiño
def11722a9 Split link flags and link libraries lists to make gold happy.
gold is more strict than lld about the order of the arguments, that's
why CMake offers two different properties for the linker: LINK_FLAGS and
LINK_LIBRARIES. The former _add_variant_link_flags was adding the
libraries to LINK_FLAGS, when the correct thing is to add them to
LINK_LIBRARIES.

The change adds a new output variable for _add_variant_link_flags which
will containt the linked libraries, and CMake will be able to generate
the correct command line invocation for when gold is used.

This should fix the Android CI build.
2018-11-27 15:24:52 -08:00
Jordan Rose
db7529fa5c Merge pull request #20784 from jrose-apple/generated-nine-out-of-ten
[CMake] Conditionalize generation of .swiftinterface files
2018-11-27 09:09:55 -08:00
Saleem Abdulrasool
d1eb3a54b4 Merge pull request #20766 from compnerd/importing-fat
build; correct swift fat library linking on Windows
2018-11-26 21:36:31 -08:00
Jordan Rose
605c9f619f [CMake] Conditionalize generation of .swiftinterface files
SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES is the new setting.

rdar://problem/44942414
2018-11-26 17:04:46 -08:00
Saleem Abdulrasool
d8bce85076 build; correct swift fat library linking on Windows
Windows does not link against the library but the import library.  When
building the target specific bits, we unfortunately do not use the cmake
build infrastructure properly.  This results in us trying to link
against libraries which do not exist.  Redirect the link to the right
files.  This allows us to build swift-reflection-test.
2018-11-26 16:38:38 -08:00
Saleem Abdulrasool
6a0989b7a2 build: pass /GR- when using cl-like drivers
When building with clang-cl, we should pass /GR- rather than the
gcc-style driver options.  This repairs the build of swift on Windows.
2018-11-26 12:50:18 -08:00
Saleem Abdulrasool
66fa742732 Merge pull request #20718 from compnerd/host-tools-dce
host tools DCE
2018-11-26 09:55:17 -08:00
Saleem Abdulrasool
adfb508317 build: specify architecture when building for Windows
The Windows SDK requires that the architecture is specified.
2018-11-25 19:09:29 -08:00
Saleem Abdulrasool
1f9feb550f add_swift_host_tool: DCE DEPENDS (NFC) 2018-11-23 11:03:34 -08:00
Saleem Abdulrasool
9110ae733e add_swift_host_tool: DCE COMPILE_FLAGS (NFC) 2018-11-23 11:03:34 -08:00
Saleem Abdulrasool
47e060878d add_swift_host_tool: DCE SWIFT_MODULE_DEPENDS (NFC) 2018-11-23 11:03:34 -08:00
Harlan Haskins
b707b891d5 Merge pull request #20554 from harlanhaskins/swiftsyntaxn't
[CMake] Remove swift-syntax install component
2018-11-14 11:16:06 -08:00
Harlan Haskins
0a861af752 [CMake] Remove swift-syntax install component 2018-11-13 17:29:01 -08:00
Michael Gottesman
e2d7f77557 [semantic-sil] Enable the mandatory sil ownership optimization on all stdlib overlays.
We can do this b/c all overlays pass the ownership verifier, so it is safe.
2018-11-13 16:08:14 -08:00
Saleem Abdulrasool
5e9a70812f Merge pull request #20351 from compnerd/optionless
build: remove DONT_STRIP_MAIN_SYMBOL, DISABLE_ASLR flags
2018-11-12 10:34:38 -08:00
Andrew Trick
945ee929ad Merge pull request #20302 from atrick/enforce-exclusivity
Enable run-time exclusivity checking in release mode.
2018-11-07 08:47:01 -08:00
Michael Gottesman
a761d7c0ba Revert "Revert "Revert "[Build System: CMake] make add_swift_library a wrapper to add_llvm_library"""
This reverts commit 121f5b64be.

Sorry to revert this again. This commit makes some pretty big changes. After
messing with the merge-conflict created by this internally, I did not feel
comfortable landing this now. I talked with Saleem and he agreed with me that
this was the right thing to do.
2018-11-06 13:24:00 -08:00
Saleem Abdulrasool
f3e4982179 build: remove DONT_STRIP_MAIN_SYMBOL, DISABLE_ASLR flags
These flags are unused by the single add_swift_executable call.  Remove
support for these flags.
2018-11-05 22:46:09 -08:00
Saleem Abdulrasool
d082e15d99 Merge pull request #20340 from compnerd/symlinks
build: do not create WinSDK symlinks when unneeded
2018-11-05 22:33:59 -08:00
Saleem Abdulrasool
a5d360ba7a build: do not create WinSDK symlinks when unneeded
When building on case insensitive filesystems, there is no need to
create the library symlink forest as the paths will be resolved properly
due to the insensitivity.  This avoids a bit of work and spew on
Windows.
2018-11-05 16:16:08 -08:00
Saleem Abdulrasool
121f5b64be Revert "Revert "[Build System: CMake] make add_swift_library a wrapper to add_llvm_library""
This reverts commit 103f9a8246.
2018-11-05 14:37:40 -08:00
Saleem Abdulrasool
c46f61c83c build: handle directories for unified build
The directory paths would collide with a cross-compiled unified build of
LLVM and swift.  Adjust the directories to work in that environment.
2018-11-03 18:14:01 -07:00
Andrew Trick
a17dbc7c74 Enable run-time exclusivity checking in release mode.
This change could impact Swift programs that previously appeared
well-behaved, but weren't fully tested in debug mode. Now, when running
in release mode, they may trap with the message "error: overlapping
accesses...".

Recent optimizations have brought performance where I think it needs
to be for adoption. More optimizations are planned, and some
benchmarks should be further improved, but at this point we're ready
to begin receiving bug reports. That will help prioritize the
remaining work for Swift 5.

Of the 656 public microbenchmarks in the Swift repository, there are
still several regressions larger than 10%:

TEST                    OLD      NEW      DELTA      RATIO
ClassArrayGetter2       139      1307     +840.3%    **0.11x**
HashTest                631      1233     +95.4%     **0.51x**
NopDeinit               21269    32389    +52.3%     **0.66x**
Hanoi                   1478     2166     +46.5%     **0.68x**
Calculator              127      158      +24.4%     **0.80x**
Dictionary3OfObjects    391      455      +16.4%     **0.86x**
CSVParsingAltIndices2   526      604      +14.8%     **0.87x**
Prims                   549      626      +14.0%     **0.88x**
CSVParsingAlt2          1252     1411     +12.7%     **0.89x**
Dictionary4OfObjects    206      232      +12.6%     **0.89x**
ArrayInClass            46       51       +10.9%     **0.90x**

The common pattern in these benchmarks is to define an array of data
as a class property and to repeatedly access that array through the
class reference. Each of those class property accesses now incurs a
runtime call. Naturally, introducing a runtime call in a loop that
otherwise does almost no work incurs substantial overhead. This is
similar to the issue caused by automatic reference counting. In some
cases, more sophistacated optimization will be able to determine the
same object is repeatedly accessed. Furthermore, the overhead of the
runtime call itself can be improved. But regardless of how well we
optimize, there will always a class of microbenchmarks in which the
runtime check has a noticeable impact.

As a general guideline, avoid performing class property access within
the most performance critical loops, particularly on different objects
in each loop iteration. If that isn't possible, it may help if the
visibility of those class properties is private or internal.
2018-11-02 16:54:31 -07:00
Xi Ge
103f9a8246 Revert "[Build System: CMake] make add_swift_library a wrapper to add_llvm_library" 2018-11-02 12:49:07 -07:00
Saleem Abdulrasool
c3555cf0c4 add_swift_host_library: special handling for GYB sources 2018-10-31 12:46:31 -07:00
Saleem Abdulrasool
e92c2a251e add_swift_host_library: make a trivial wrapper around add_llvm_library 2018-10-31 12:46:31 -07:00
Saleem Abdulrasool
1bb88b7ec4 add_swift_host_library: remove LINK_FLAGS 2018-10-31 12:46:31 -07:00
Saleem Abdulrasool
ce32a87d79 add_swift_host_library: remove LINK_INTERFACE_LIBRARIES 2018-10-31 12:46:31 -07:00
Saleem Abdulrasool
c5c64ca3ea add_swift_host_library: rename LLVM_COMPONENT_DEPENDS to LINK_COMPONENTS 2018-10-31 12:46:31 -07:00
Saleem Abdulrasool
39dde93c88 add_swift_host_library: rename LINK_LIBRARIES to LINK_LIBS 2018-10-31 12:46:31 -07:00
Saleem Abdulrasool
e0b839330d add_swift_host_library: remove C_COMPILE_FLAGS 2018-10-31 12:46:31 -07:00
Saleem Abdulrasool
738a00a0c0 add_swift_host_library: remove FILE_DEPENDS 2018-10-31 12:46:31 -07:00
Saleem Abdulrasool
b2b8048b3f build: split out host and target library builds fully
Remove this special case handling for building a host library as a target
library.  This is the last piece needed to support cross-compiling lldb.  As a
bonus, it cleans up some of the logic in our special build system.
2018-10-30 10:56:14 -07:00
Devin Coughlin
c119bfaaba [Build] Relax CMAKE_C_COMPILER_ID "Clang" check to match AppleClang
In https://github.com/apple/swift/pull/19973 the logic that adds "-target" when
building the C parts of the Standard Library and overlays was changed to use
CMAKE_C_COMPILER_ID to only do so when the compiler ID is "Clang". However,
on Apple toolchains the compiler ID is "AppleClang", so the target was no
longer being explicitly set.

Update the logic to relax the explicit check for "Clang" to also allow
"AppleClang".

rdar://problem/45579667
2018-10-29 18:01:30 -07:00
swift-ci
ecf29e694a Merge pull request #20115 from compnerd/wimplib 2018-10-28 18:28:44 -07:00
Saleem Abdulrasool
af8fc10bd1 build: install the import libraries for windows
When building the target libraries, we need to install the import
library as well.  Unfortunately, due to the way that the swift build
system works, we do not have the ability to rely on CMake doing the
right thing and taking care of this for us.  We have to manually
construct and track the import library due to the fact that we fight the
cross-compilation support.  Add some logic to extract the import
libraries and install them so that uses can actually build for Windows.
2018-10-28 13:08:50 -07:00
Saleem Abdulrasool
ecf0b58d72 build: remove unused options in add_swift_host_library
Debride the function now that it is handles only the host libraries for
the tools.  These are closer in spirit to the LLVM libraries and this
function can really become a trivial wrapper around llvm_add_library.
2018-10-28 10:45:42 -07:00
Michael Gottesman
aba53ee0ca Merge pull request #20110 from gottesmm/pr-301c86df6766d9a2fc825201c9c10888ba2d4310
[cmake] Eliminate dead target code from add_swift_host_library and de…
2018-10-27 16:58:52 -07:00
swift-ci
2f2ce13953 Merge pull request #20107 from compnerd/frontend-is-not-cc 2018-10-27 15:39:29 -07:00
Michael Gottesman
1e6d9482b1 [cmake] Eliminate dead target code from add_swift_host_library and dead host code from add_swift_target_library. 2018-10-27 15:30:28 -07:00
Michael Gottesman
3f17bb6ddf Carefully split the build's invocation of add_swift_library into host/target variants.
The key thing here is that all of the underlying code is exactly the same. I
purposely did not debride anything. This is to ensure that I am not touching too
much and increasing the probability of weird errors from occurring. Thus the
exact same code should be executed... just the routing changed.
2018-10-27 12:58:51 -07:00
Saleem Abdulrasool
d4ea2781e8 build: pass the Windows headers properly
The Windows headers are the system (sysroot) headers.  They are not
consumed by swift but the clang importer.  Furthermore, they should be
treated as system headers.  Correct the flags used for the invocation.
This fixes the build of the SDK overlay for Windows.
2018-10-27 11:38:30 -07:00
Michael Gottesman
b36c6e5dd6 [sil-ownership] Enable ownership verification on all of the stdlib libraries.
rdar://29791263
2018-10-26 12:09:53 -07:00
Jordan Rose
6cd780395b [CMake] Make GNU-style response files for long argument lists (#18958)
...i.e. an actual shell-like argument list, rather than a
semicolon-separated list (CMake's internal stringification mechanism
for lists). Apart from being a little easier to read, this also works
directly with the response file support in swiftc itself now (not
depending on utils/line-directive).

(It's still not /quite/ enough to expand on a command-line, though,
since that will escape the quotes. The 'sed' command can get around
that: $(sed "s/'//g" foo.txt).)
2018-10-23 19:45:56 -07:00
Saleem Abdulrasool
15355ab20a build: be more conservative when passing -target
When building the swift tools with gcc, we would fail as we would try to
pass `-target` to gcc, which does not support this option.  Invert the
condition and only pass the argument when building with clang.
2018-10-21 15:30:49 -07:00