Commit Graph

506 Commits

Author SHA1 Message Date
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
Bob Wilson
a71dd66eb2 Merge pull request #16407 from bob-wilson/rdar37053028
[build-script] NFC: Update a comment regarding LLD for Apple platforms
2018-05-04 21:36:53 -07:00
Bob Wilson
7bb9ae73c7 [build-script] NFC: Update a comment regarding LLD for Apple platforms
PR #14306 fixed the problem in https://bugs.swift.org/browse/SR-6878 but
included a comment about mysterious behavior on macOS. I did some
investigation and found that Clang assumes that Darwin platforms use
a different name for LLD. My impression is that LLD is not yet ready for
prime time on Darwin, so leaving it disabled for Apple platforms seems
like the right thing for now. This just updates the comments to explain
what will need to change whenever someone wants to reenable it.

rdar://problem/37053028
2018-05-04 17:33:30 -07:00
Davide Italiano
98292f4277 [tools] Add a libfuzzer based swift demangler fuzzer.
The debugger demangles names pretty often and we would like
to ensure it never crashes.
2018-05-04 17:31:35 -07:00
Nathan Lanza
7429856034 Change various search and linker paths to account for changes in NDK16
ndk14 introduced "unified headers" which merged the headers for all
different API versions into one directory which effectively split the
"SWIFT_SDK_ANDROID_ARCH_${ARCH}_PATH" into two different directories.

Add include and library specific paths to various compilation and link
invocations across the Swift project to account for this change. Remove
some broken sysroot/sdk specific settings.
2018-05-02 14:18:11 -07:00
Saleem Abdulrasool
8ad1e63858 build: correctly check if we are cross-compiling to Windows
The `-sdk` parameter to the swift compiler causes problems when
cross-compiling to Windows on Linux.  Because the host follows the
traditional unix layout but the headers do not correspond to the target
environment, there are conflicting definitions and incorrect definitions
of basic types imported from C.  Ensure that we do not pass the `-sdk`
parameter to allow correctly building the libraries for the target.
2018-04-19 09:39:34 -07:00
swift-ci
577b2722f7 Merge pull request #13140 from troughton/windows-cross-compile-fixes 2018-04-18 10:56:06 -07:00
Thomas Roughton
823bb0a530 Check for CMAKE_BUILD_TYPE_DEBUG instead of RELEASE
… since MinSizeRel and RelWithDebugInfo are also configurations.
2018-04-18 19:13:47 +12:00
Saleem Abdulrasool
46cc2fa3a5 build: fix typo (IC -> ICU) 2018-04-17 11:26:58 -07:00
Saleem Abdulrasool
88620bc9f5 build: refactor parameter names (NFC)
Create a list that makes it easy to see and add options to the CMake
macro when building.  This makes the `cmake_parse_arguments` call much
more legible by adhering to the CMake recommendations.  NFC.
2018-04-13 18:07:17 -07:00
Jordan Rose
20ae19ef22 [CMake] Improve Xcode project generation with folders (#15738)
- Re-enable the use of folders with the USE_FOLDER setting. This got
  lost a while ago when we stopped including LLVM's top-level
  CMakeLists.txt.

- Put a bunch of new targets into folders.

Should not affect the built product and definitely shouldn't affect
anyone not building with Xcode (or MSVC, I guess).
2018-04-04 18:22:59 -07:00
Saleem Abdulrasool
949216d716 build: disable static RTTI on Windows if possible
Newer SDKs have the ability to disable the static RTTI usage as well as
the dynamic.  We had to enable the use of static RTTI previously for the
use of `std::function`.  Disable the static RTTI if possible.
2018-03-31 16:48:35 -07:00
swift-ci
8e533e3975 Merge pull request #15638 from compnerd/libdir 2018-03-30 17:34:33 -07:00
Saleem Abdulrasool
547a8f6e04 build: library search directories are directories
Use the directory portion of the path to the ICU libraries for the
library search directory.
2018-03-30 15:26:27 -07:00
Nathan Lanza
e06c52584f Change various uses of SWIFT_SDK_${SDK}_PATH to its architecture specific vairant
Cross-compilation for multiple architectures & sdks require various
variables to be split to specify the arch/adk variant being focused on.
This change modifies various uses of the `SWIFT_SDK_${SDK}_PATH` to
`SWIFT_SDK_${SDK}_ARCH_${ARCH}`
2018-03-30 17:50:59 +00:00
Michael Gottesman
0bc86e095f Replace -enable-guaranteed-normal-arguments with -disable-guaranteed-normal-arguments.
rdar://38874323
2018-03-26 12:25:22 -07:00
Nathan Lanza
6a3794110f Fix simple typo from SDK to ARCH 2018-03-18 21:18:56 -07:00
swift-ci
1d4450e26a Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-03-03 07:18:00 -08:00
David Zarzycki
763008ccd7 Merge pull request #14908 from davezarzycki/nfc_cmake_limit_leaf_frame_pointer_opt_to_production
[CMake] Limit -momit-leaf-frame-pointer to production builds
2018-03-03 10:11:52 -05:00
swift-ci
53a66db52f Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-03-01 16:39:55 -08:00
Saleem Abdulrasool
4585bc53d6 build: emulate /GR- when compiling for Windows
The /GR- emulation is needed to support building on Windows.
std::function in Microsoft's C++ runtime requires the use of `typeid`.
We do not want to emit RTTI data.  `-frtti -fno-rtti-data` allows the
use of the `typeid` and `dynamic_cast` behaviours but will not emit the
RTTI data.  With this change, it is possible to build the Windows
runtime once again.
2018-03-01 14:14:02 -08:00
David Zarzycki
b1641fd338 [CMake] Limit -momit-leaf-frame-pointer to production builds
When building with asserts or debug information, don't disable leaf
frame pointers because some debugging/analysis tools have buggy or
nonexistent support for DWARF-style backtraces.
2018-03-01 12:34:58 -05:00
swift-ci
d89cbfe481 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-02-28 10:40:59 -08:00
Thomas Roughton
5173e3c799 SwiftPrivate now builds on Windows with Pull-14710 2018-02-20 22:21:54 +13:00
Saleem Abdulrasool
e77d4c7c98 build: explicitly state arch for ICU
This is needed to support cross-compilation on targets which do not
support FAT binaries (i.e. non-MachO targets).  The primary user of this
functionality right now is Windows, but this support is needed for Linux
and android as well.
2018-02-19 23:27:54 -08:00
swift-ci
c6d31e959a Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-02-09 08:38:05 -08:00
Doug Gregor
774bee2294 Revert "Re-apply "SwiftSyntax: Teach SwiftSyntax to use SourceKitd to serialize syntax trees. (#14424)" (#14465)"
This reverts commit f8c77e17ce.
2018-02-08 22:58:45 -08:00
swift-ci
4fc58f568f Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-02-08 15:18:50 -08:00