Commit Graph

1731 Commits

Author SHA1 Message Date
Erik Eckstein
45a2ae48ce benchmarks: replace the Ounchecked build with an Osize build
We don't measure Ounchecked anymore. On the other hand we want to benchmark the Osize build.
2017-10-06 14:09:43 -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
Michael Gottesman
48f4a276ba [benchmark] Only add -external suffix to targets in standalone builds where SWIFT_BENCHMARK_SUBCMAKE_BUILD is set.
This enables us to distinguish in between builds which are triggered by a
subcmake call from the main swift cmake file and one from a user who is trying
to compile the swift benchmark suite against a misc swift installation/use the
ninja file by hand.
2017-10-01 10:41:48 -07:00
Saleem Abdulrasool
15141bc217 build: quote library search path options
When passing the linker search path options to the driver, ensure that
we quote the argument.  We would previously incorrectly split the
arguments that were passed to the driver if there were spaces.  This
would manifest as link failures on Linux when cross-compiling to
Windows.
2017-09-27 19:08:42 -07:00
Saleem Abdulrasool
699bacae37 build: allow compilation for Windows ARM
The Windows ARM SDK is incomplete.  However, the headers are complete
enough to support building the runtime.  Add the necessary definitions
to permit the stdlib to be built.
2017-09-26 17:32:51 -07:00
Saleem Abdulrasool
87250c24e5 Merge pull request #12055 from compnerd/xwindows
build: improve the Windows build infrastructure
2017-09-26 16:26:30 -07:00
Michael Gottesman
c2d8cc7ff0 [benchmark] Add support for building out of tree via build-script against the just built swift.
I recently broke the out of tree build by mistake [its fixed now ; )]. This
inspired me to make it easy to test this behavior by adding support to
build-script/cmake/etc for running an external benchmark build via
AddExternalProjects.

Now I can just call build-script with --build-external-benchmarks and thats it!
It should just work! It already helped me to avoid breaking the external build
twice!

I hope that eventually we get this on a bot to make sure it keeps working [or
even added to the smoke tests ; )].

*NOTE* This is disabled by default so it will not affect normal builds.

*NOTE* This just builds the external benchmarks. There is an rpath issue that
prevents you from running them (the benchmarks have the rpath set as if they are
next to the stdlib, but they are not. This can be fixed in a few different ways,
but I do not have time to finish implementing it = (. But this commit is a good
first step and at least detects build errors.
2017-09-25 12:31:39 -07:00
Saleem Abdulrasool
27d051a6c3 build: improve the Windows build infrastructure
Rather than use the `INCLUDE` and `LIB` environment variables to build
the Windows code, use the `UniversalCRTSdkDir`, `UCRTVersion`, and
`VCToolsInstallDir` variables.  Using these we can compute the right set
of include directories and library search paths for the various
architectures.  This will enable us to build multiple variants of the
Windows stdlib at the same time.

Additionally, rather than relying on the magic environment variables to
be processed by the driver, pass them explicitly to the driver through
the build system.  This also is needed to allow parallel builds of
various architecture variants of the stdlib on Windows.
2017-09-23 16:08:42 -07:00
Calvin Hill
aee81d272f Add Initial platform support for Haiku. (#11583) 2017-09-22 21:06:56 -04:00
swift-ci
afe5c6b910 Merge pull request #12066 from compnerd/offsetof 2017-09-22 15:50:15 -07:00
Saleem Abdulrasool
3aea816d7c build: use more portable offsetof
When building for Windows, when using `offsetof` in a C++ context, we
would use a `reinterpret_cast`, which is not permissible in the context
of a `constexpr` statement which we do use.  Use a CRT specific macro to
use the `__builtin_offsetof` version of the implementation.  Repairs the
Windows stdlib build with the new include path handling.
2017-09-22 13:08:49 -07:00
Saleem Abdulrasool
b25894b4a4 build: add additional case of special handling for exherbo
The file system layout on exherbo is different from most other Linux
distributions.  Add an additional ignored case for the include paths for
when cross-compiling the stdlib to additional targets.
2017-09-21 23:09:26 -07:00
Brian Gesiak
1c5c75bec3 [CMake] Remove Xcode effective platform name check
The CMake function `get_effective_platform_for_triple` appears to only
be used in one location: from within `escape_path_for_xcode`.
The `get_effective_platform_for_triple` function's only purpose appears to be
to check whether `SWIFT_HOST_TRIPLE` contains the string "macos", and if not,
it emits an error.

However, because on macOS hosts the build-script-impl is responsible
for setting the `SWIFT_HOST_TRIPLE` variable, when `cmake -G Xcode` is invoked
directly to configure the Swift project, this variable is unset, and so
`get_effective_platform_for_triple` emits an error.

I considered two solutions:

1. Have `swift/CMakeLists.txt` set a default `SWIFT_HOST_TRIPLE`, as it
   does for Linux. This would prevent `get_effective_platform_for_triple`
   from emitting an error.
2. Remove `get_effective_platform_for_triple` altogether.

I chose (2) here. `get_effective_platform_for_triple` doesn't appear to
do anything besides restrict the host platform arbitrarily. If users
are somehow able to configure the project using `cmake -G Xcode` on
Linux, shouldn't the Swift's CMake allow them to do so?

Test plan:
1. Configure and build using Xcode and an in-tree Swift checkout.
2. Configure and build using `utils/build-script --xcode`.
2017-08-30 00:11:12 -04:00
George Karpenkov
020801beb4 Update -sanitize=fuzzer option to take into account new libFuzzer location. (#11595) 2017-08-28 17:16:55 -07:00
Michael Ilseman
85c2a886e6 Merge pull request #11546 from amraboelela/android-icu-swift
Android: adding swift suffix to icu generated libs to resolve conflict
2017-08-22 14:10:06 -07:00
Mishal Shah
df070b858f Update swift master to build with Xcode 9 beta 6, macOS 10.13, iOS 11, tvOS 11, and watchOS 4 SDKs. 2017-08-22 11:52:50 -07:00
Amr Aboelela
4bf6f5475d Android: adding swift suffix to icu generated libs to resolve conflict with Android's icu libs 2017-08-21 16:17:17 -07:00
Harlan
ade67ca899 [Syntax] Swift libSyntax API (#11320)
* Create Swift libSyntax API

This patch is an initial implementation of the Swift libSyntax API. It
aims to provide all features of the C++ API but exposed to Swift.

It currently resides in SwiftExperimental and will likely exist in a
molten state for a while.

* Only build SwiftSyntax on macOS
2017-08-14 16:47:48 -07:00
George Karpenkov
efe143c2f4 Adding support for -sanitize=fuzzer flag (#11381)
Similarly to Clang, the flag enables coverage instrumentation, and links
`libLLVMFuzzer.a` to the produced binary.
Additionally, this change affects the driver logic, and enables the
concurrent usage of multiple sanitizers.
2017-08-07 18:16:51 -07:00
swift-ci
d189132667 Merge remote-tracking branch 'origin/master' into master-next 2017-08-01 09:28:54 -07:00
David Zarzycki
dc1d0943b2 [CMake] Infer -Werror=switch via asserts being enabled (#11098)
LLVM-style projects like Swift make heavy use of switch statements and
therefore -Werror=switch is very useful during feature development. That
being said, if asserts are disabled, then you're probably not actively
hacking on the project and -Werror (or warnings in general) aren't
helpful.
2017-08-01 09:23:25 -07:00
swift-ci
5afdf423fb Merge remote-tracking branch 'origin/master' into master-next 2017-07-28 13:28:58 -07:00
Mishal Shah
64a77ca716 Update master to build with Xcode 9 beta 4, macOS 10.13, iOS 11, tvOS 11, and watchOS 4 SDKs. 2017-07-28 11:17:59 -07:00
Chris Bieneman
9c35042ae6 Merge remote-tracking branch 'origin/master' into master-next 2017-07-28 09:51:36 -07:00
Chris B
762841ffa8 Merge pull request #11177 from llvm-beanz/swift-cmake-cross-compile
Support CMake's built-in cross compilation mechanisms, and LLVM's native tools configuration.
2017-07-26 15:44:59 -07:00
swift-ci
0ce8483aa6 Merge remote-tracking branch 'origin/master' into master-next 2017-07-25 18:48:50 -07:00
Harlan
a5098e6b69 Generate libSyntax API (#10926)
* Generate libSyntax API

This patch removes the hand-rolled libSyntax API and replaces it with an
API that's entirely automatically generated. This means the API is
guaranteed to be internally stylistically and functionally consistent.
2017-07-25 18:19:58 -07:00
Chris Bieneman
93717c663c Rename SWIFT_TABLEGEN to LLVM_TABLEGEN
Swift doesn't produce its own tablegen and by faking out the LLVM CMake infrastructure into thinking it does all of LLVM's build cross compilation support breaks.
2017-07-25 14:14:56 -07:00
swift-ci
0de4d6fa79 Merge remote-tracking branch 'origin/master' into master-next 2017-07-17 14:28:56 -07:00
Arnold Schwaighofer
f2c8c2a256 Cleanup dead configuration code for copy-on-write existentials
Copy-on-write existentials are enabled and none of these flags are used
2017-07-17 12:22:03 -07:00
swift-ci
5d753e1f3b Merge remote-tracking branch 'origin/master' into master-next 2017-06-28 19:48:39 -07:00
Jacob Mizraji
9c95eb8335 Refactor OSX archs for job config 2017-06-28 16:57:53 -07:00
Jacob Mizraji
d789323649 Refactoring for job configuration 2017-06-28 16:54:40 -07:00
Greg Parker
7b009eccde Merge remote-tracking branch 'origin/master' into master-next 2017-06-28 15:25:17 -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
Jordan Rose
9e936aaa3c [CMake] iOS simulator should still build 32-bit by default. (#10510)
Accidentally deleted and never noticed because all of the package
builds configure this explicitly.
2017-06-23 10:26:58 -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
Saleem Abdulrasool
3c4c910e7b build: create and use a wrapper for add_llvm_tool_symlink
Introduce a new function `add_swift_tool_symlink`.  Use this instead of the
`add_llvm_tool_symlink` and `install_in_swift_component`.  This mimics the
behaviour in clang as well as the general pattern of renaming the functions from
the LLVM build infrastructure.
2017-06-16 15:59:12 -07:00
swift-ci
e057a05fbe Merge remote-tracking branch 'origin/master' into master-next 2017-06-14 16:28:39 -07:00
Mishal Shah
c5ff1f2cac Update master to build with Xcode 9 beta 1, OS X 10.13, iOS 11, tvOS 11, and watchOS 4 SDKs. 2017-06-14 16:20:35 -07:00
Bob Wilson
52d14e3f0d Set SWIFT_TABLEGEN_TARGET as required by LLVM r305142.
With the change in LLVM r305142, CMake will fail if SWIFT_TABLEGEN_TARGET
is not set. When cross-compiling, it could be set differently than
SWIFT_TABLEGEN_EXE but it does not look like Swift supports that yet. For
now, just set it to the same value as SWIFT_TABLEGEN_EXE.
2017-06-12 10:53:06 -07:00
Robert Widmann
b9836e64e2 Merge pull request #9869 from johnno1962a/master
Ensure fatalError message logged on Android
2017-06-07 09:15:04 -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
John Holdsworth
304f556f5d Cmake changes for -llog and -latomic V 2017-06-01 01:53:29 +01:00
John Holdsworth
b5bd098d23 Cmake changes for -llog and -latomic IV 2017-06-01 01:35:55 +01:00
John Holdsworth
32bd9f1e49 Cmake changes for -llog and -latomic III 2017-06-01 01:25:55 +01:00
John Holdsworth
0ab8788cc8 Cmake changes for -llog and -latomic II 2017-05-30 23:16:58 +01:00
John Holdsworth
c7ea92a280 Cmake changes for -llog and -latomic 2017-05-30 22:26:30 +01:00
Kuba (Brecka) Mracek
fc7dbefcf8 Revert backtrace ban and start printing backtraces from the runtime again (#9528)
* Revert "[strip -ST] Disable runtime stack trace dumping on Darwin when asserts are disabled."
This reverts commit 6bc28ff1c9.
* Bring back important fixes from the revert of 6bc28ff1c9.
* Change swift::swift_reportError to only print the backtrace in assert builds (swift::warning prints backtrace always).
2017-05-12 15:46:35 -07:00