Commit Graph

633 Commits

Author SHA1 Message Date
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
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
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
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
Saleem Abdulrasool
70a32af57b build: make the lipo detection uniform
Change the standalone SDK overlay build and unified build lipo detection
identical.
2018-10-18 12:12:06 -07:00
Saleem Abdulrasool
9e30ae35d0 build: fix parameter name in cmake
Fix the parameter name in `_add_swift_library_single` which would
previously not pass any value for the `INSTALL_IN_COMPONENT` due to a
missed alteration when the function was refactored.  Spotted by
inspection.
2018-10-16 17:28:15 -07:00
Saleem Abdulrasool
ef14e9dc02 build: replace some is_darwin_sdk usage
Use the simpler inline form of the check in most places.  The two sites
that remain have multiple uses in a single function.  It should be
possible to replace those as well, though it is unclear if the overhead
of inlining the check to all the places in the function will make a
measurable difference.
2018-10-15 18:00:43 -07:00
Saleem Abdulrasool
dae761fbd5 build: workaround incorrectly cased import libraries in WinSDK
The Windows SDK proides kernel32.Lib which on case sensitive file systems will
fail (due to the capital L in the extension).  Workaround that by creating
symbolic links to handle this.  This mirrors the technique used in LLVM.
2018-10-12 14:44:34 -07:00
Saleem Abdulrasool
ab5d729ae0 build: extract the C++ header search path for android
Extract the C++ header search path from the system header search path.  This is
needed to ensure that we do not push the C++ headers into the swift compiler
search path.  The reason here is that when building the module, we would attempt
to include the C++ headers, which we cannot do since the ClangImporter in swift
explicitly sets the langugage to C.  This would break the stdlib build for
android.
2018-10-09 15:41:22 -07:00
Saleem Abdulrasool
6d2ea53dfd build: workaround cross-compilation for Windows
When cross-compiling the Windows standard library in release mode, we
would get undefined symbols due to LLVM invoking
`add_definitions(-D_DEBUG)`.  This would change the behaviour of certain
functions from MSVCRT resulting in undefined symbols.  Scrub out the
unwanted `-D_DEBUG`.
2018-10-05 15:58:29 -07:00
Saleem Abdulrasool
a4d06887df build: simplify a condition further (NFC)
Cleanup the nested conditions here as per Ross' suggestion.  NFC.
2018-09-24 14:55:10 -07:00
Saleem Abdulrasool
9a0422565c Merge pull request #19491 from compnerd/simplify-add-library
[CMake] Simplify add_swift_library
2018-09-24 14:47:36 -07:00
Saleem Abdulrasool
7974e391a9 build: collapse two checks into a single one (NFC)
Merge two cases into a single case rather than keeping them separate.
Additionally check the condition early rather than perform the action
and then revert it.  NFC.
2018-09-24 11:30:50 -07:00
Saleem Abdulrasool
d426a71e1d build: remove nested tautological condition (NFC)
The entire if block is in the `SWIFTLIB_TARGET_LIBRARY` condition, so
these checks add nothing but a level of indentation.  (NFC)
2018-09-24 10:53:24 -07:00
Saleem Abdulrasool
36f77a8901 build: hoist architecture independent variables (NFC)
Hoist out the some of the architecture independent variables outside of
the inner loop.  This should simplify the logic for the function and
improve generation times.  (NFC)
2018-09-24 10:53:18 -07:00
Saleem Abdulrasool
583ceaede5 build: support android aarch64
This adds the needed support to enable building the standard library for android
aarch64 assuming that the appropriate parameters are passed to CMake.
2018-09-24 09:55:10 -07:00
swift-ci
662073e440 Merge pull request #19489 from compnerd/debug 2018-09-23 18:54:58 -07:00
Saleem Abdulrasool
dd6a6d3fd7 build: correct build type check
This corrects the casing which would previously not match.
Unfortunately, the `MATCHES` operator also does not handle the case
insensitivity properly.  This enables building just the standard library
on Linux for Windows.
2018-09-23 16:24:39 -07:00
Saleem Abdulrasool
e7ba154d59 build: avoid passing in --sysroot= twice on Android
This just cleans up the invocation generation for android to avoid passing in
`--sysroot=` twice to the driver with the same value.  This has no impact, but
cleans up the command line so it is easier to see what is going on.
2018-09-21 14:26:17 -07:00
Saleem Abdulrasool
addfb56061 build: do not use the VFS overlay on MSVC
When building for Windows on Windows using Visual Studio, we would attempt to
pass the clang specific flags to cl.  It would then attempt to treat the overlay
definition as an input and fail.  Although this shouldn't be needed on Windows,
it keeps the builds with clang similar across Linux and Windows.
2018-09-11 10:28:57 -07:00
Saleem Abdulrasool
6fb43d44c7 build: don't define _CRT_USE_BUILTIN_OFFSETOF
This is defined by cl in Visual Studio 2017, and causes a warning.  Do not add
this macro when building with MSVC.
2018-09-11 10:28:57 -07:00
Doug Gregor
f8e53d9129 [Standard library] Audit protocol member overrides in protocols.
Add the `-warn-implicit-overrides` flag when building the standard library
and overlays, so that each protocol member that overrides a member of an
inherited protocol will produce a warning unless annotated with either
‘override’ or ‘@_nonoverride’.

An annotation of `override` will mean that the overriding requirement will be treated identically to the overridden declaration. If for some reason a concrete type’s conformance to the inheriting protocol provides a different witness for the overriding requirement than the conformance to the inherited protocol’s witness for the overridden requirement, the witness for the inheriting (more-specialized) protocol will be ignored. A protocol requirement marked ‘override’ only makes sense when the declaration is needed to help associated type inference, which is why the ‘override’ annotations correlate so closely with ABI FIXMEs.

An annotation of `@_nonoverride` means that the two protocol requirements will be treated independently, and may be bound to different witnesses. Use `@_nonoverride` when we might need different witnesses, e.g., because the semantics of the potentially-overriding declaration differ from that of the potentially-overridden declaration. `BidirectionalCollection.index(_:offsetBy:)` is the most obvious example, because the `BidirectionalCollection` ’s version of `index(_:offsetBy:)` allows negative indices. `RandomAccessCollection` ’s version is also marked `@_nonoverride` because it is required to be asymptotically faster than the `Collection` or `BidirectionalCollection` versions.
2018-09-05 13:51:26 -07:00
Xi Ge
be38d8a1d0 cmake: simplify Swift module dependency for Swift host tools. NFC (#18600) 2018-08-09 15:18:37 -07:00
Arnold Schwaighofer
b05f0b428d Code sign swift-reflection-test executables
They run on a target.
2018-08-09 09:18:04 -07:00
Alex Hoppen
d926b74836 [incrParse] Add test cases to test the incremental syntax tree transfer 2018-07-24 16:32:23 -07:00
Davide Italiano
87f61d4b32 [CMake] Export target libraries.
lldb needs this to link against reflection.
Patch by Michael Gottesman, I take no credit.
2018-06-27 14:42:36 -07:00
Michael Gottesman
c01266bcab [cmake] Add an option to not pass bitcode_hide_symbols to libLTO when embedding bitcode. 2018-06-06 20:22:20 -07:00
Ross Bayer
bfbce3695a Always build the "non-overlay" apinotes when building Platform. (#16851) 2018-05-29 10:34:44 -07:00
Michael Gottesman
5e53730c44 [cmake] Cleanup the cmake used for adding new fuzzer host tools. 2018-05-06 09:29:38 -07:00
Michael Gottesman
06b19d7a44 Merge pull request #16341 from dcci/demanglefuzz
[tools] Add a libfuzzer based swift demangler fuzzer.
2018-05-06 09:15:28 -07:00