Commit Graph

506 Commits

Author SHA1 Message Date
Xi Ge
f8c77e17ce Re-apply "SwiftSyntax: Teach SwiftSyntax to use SourceKitd to serialize syntax trees. (#14424)" (#14465) 2018-02-08 15:11:31 -08:00
swift-ci
5328820324 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-02-07 00:38:40 -08:00
Xi Ge
50cde06cf0 Revert "SwiftSyntax: Teach SwiftSyntax to use SourceKitd to serialize syntax trees. (#14424)" 2018-02-06 23:20:42 -08:00
swift-ci
e7655698a4 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-02-06 19:59:04 -08:00
Xi Ge
871c9dac2a SwiftSyntax: Teach SwiftSyntax to use SourceKitd to serialize syntax trees. (#14424)
When using SwiftSyntax as a standalone tool, we invoke Swiftc
internally to get serialized syntax trees. This is not ideal for
several reasons: (1) we have to hard-code the relative path of swiftc
to invoke it; (2) we have to rely on standard input/output to pass the
tree across the process boundaries; and (3) we have to maintain two
different ways to get syntax tree (swiftc and sourcekitd).

This patch attempts to teach SwiftSyntax to use SourceKitd to get the
tree just like other clients. We first add a SourceKitd client library
written in Swift; and next teach SwiftSyntax to adopt this SourceKitd
client-side library. For platforms other than MacOS, we still use Swiftc
to get syntax trees. This client library also allows us to add 
SourceKitd tests in Swift.

This patch also re-enables several flaky tests.
2018-02-06 19:40:16 -08:00
Thomas Roughton
7c2230bc56 Fix cross-compilation for the Windows stdlib
Disable SwiftPrivate, remove -Wl,-z,defs, and use the VFS overlay for compiling the runtime.
2018-02-01 22:08:18 +13:00
swift-ci
3c3d809e5a Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-31 12:38:13 -08:00
David Zarzycki
9529a7d572 [build system] Speculative Apple lld fix 2018-01-31 13:32:08 -05:00
swift-ci
8053b943de Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-30 04:25:46 -08:00
David Zarzycki
91823273d2 [build system] Prefer LLD if it exists (#14165)
Other changes:
1) Minimize unified versus build-script build differences.
2) Stop trying to make runtime variables have "protected" visibility.
   This combination is meaningless and lld rightly complains.

Finally, this blog post is worth reading:
http://www.airs.com/blog/archives/307
2018-01-30 07:18:36 -05:00
swift-ci
494b5a9216 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-29 13:11:12 -08:00
Mike Ash
5e2b11d42d Merge pull request #14157 from mikeash/conditionally-disable-runtimefunctioncounters
[Runtime] Remove RuntimeFunctionCounters in no-assert builds.
2018-01-29 15:48:32 -05:00
swift-ci
9f1bd1f628 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-26 18:34:27 -08:00
Saleem Abdulrasool
affbaca50d build: filter out a filtering list, 80-col (NFC)
Rather than check the two names individually use a `IN_LIST` to make it
simpler to reason about.  Wrap another conditional to 80-columns.  NFC.
2018-01-26 16:06:09 -08:00
Saleem Abdulrasool
f8beec1b21 build: tweak whitespace (NFC)
This makes it easier to read and see what is going on.  This made it
easier to see what parameters were being passed when debugging the
windows cross-compilation dependencies.
2018-01-26 16:06:09 -08:00
Mike Ash
f48bd293cb [Runtime] Remove RuntimeFunctionCounters in no-assert builds.
A build option to include or exclude RuntimeFunctionCounters. By default, it's enabled when assertions are enabled.

rdar://problem/35864525
2018-01-25 12:18:25 -05:00
swift-ci
cd13953d31 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-13 02:58:35 -08:00
Michael Gottesman
4a8dc3c4e5 [cmake] Add support for compiling all swift libraries with guaranteed normal arguments.
I was using --extra-swift-args before, but lets do this for real now.

rdar://34222540
2018-01-13 02:56:52 -08:00
swift-ci
324c628e17 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-08 13:27:11 -08:00
swift-ci
cc373f9c30 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-08 12:27:47 -08:00
Ben Langmuir
a6c5b81f15 Revert "build: switch to C++14" 2018-01-08 12:26:06 -08:00
Bob Wilson
b7981aa6ea master-next: Set the deployment version correctly in -target options.
This change leaves in place the use of -m*-version-min options, but
fixes the -target options to match. We can eventually remove the use of
the -m*-version-min options after everyone has moved to build with
versions of Clang that correctly handle the deployment version in the
-target option.
2017-12-20 23:15:44 -08:00
Saleem Abdulrasool
aa0cec68df build: switch to C++14
Switch to C++14 by default as Windows now requires it, and there are a
couple of useful features.
2017-12-18 15:34:18 -08:00
swift-ci
0302515cf0 Merge remote-tracking branch 'origin/master' into master-next 2017-12-18 12:48:55 -08:00
Saleem Abdulrasool
33ada8e801 build: use C++14 for Windows builds
The Windows SDK headers require C++14 or newer features.  Visual Studio
is lax in enabling these features unlike clang.  Explicitly upgrade to
the higher standard for the Windows cross-compilation.
2017-12-12 16:27:26 -08:00
swift-ci
1270d9d356 Merge remote-tracking branch 'origin/master' into master-next 2017-12-09 14:49:49 -08:00
Saleem Abdulrasool
899103cfa8 COFF: restructure metadata registration
Restructure the COFF metadata handling to use the linker section
grouping to emit section start/stop markers in the appropriate location.
This allows us to lookup the sections statically without having to the
walk the entire image structure.

Introduce a constructor for PE/COFF binaries.  This will ensure that the
registration occurs for all modules appropriately.  This should resolve
rdar://problem/19045112.  The registration should occur prior to
`DllMain` being invoked from `DllMainCRTStartup`.
2017-12-08 16:15:07 -08:00
Bob Wilson
390058972a [master-next] Use PRIVATE in target_link_libraries for executables
This is needed to work with LLVM r319840.
2017-12-06 21:55:22 -08:00
Saleem Abdulrasool
bb762f62f3 build: use older means of getting the swiftrt object
This seems to be failing for some reason.  Fallback to the older way to
get the path to the object.  This should repair the build.
2017-11-30 12:25:49 -08:00
Saleem Abdulrasool
0c42b57962 ELF: restructure image metadata registration
Restructure the ELF handling to be completely agnostic to the OS.
Rather than usng the loader to query the section information, use the
linker to construct linker tables and synthetic markers for the
beginning and of the table.  Save off the values of these pointers and
pass them along through the constructor to the runtime for registration.

This removes the need for the begin/end objects.  Remove the special
construction of the begin/end objects through the special assembly
constructs, preferring to do this in C with a bit of inline assembly to
ensure that the section is always allocated.

Remove the special handling for the various targets, the empty object
file can be linked on all the targets.

The new object file has no requirements on the ordering.  It needs to
simply be injected into the link.

Name the replacement file `swiftrt.o` mirroring `crt.o` from libc.  Merge
the constructor and the definition into a single object file.

This approach is generally more portable, overall simpler to implement,
and more robust.

Thanks to Orlando Bassotto for help analyzing some of the odd behaviours
when switching over.
2017-11-28 10:04:04 -08:00
Aaron Dierking
28984778bb build: additional section_magic conditional fix
The variable for the TARGET_LIBRARY option should be
SWIFTLIB_SINGLE_TARGET_LIBRARY.
2017-11-07 12:25:37 -08:00
Saleem Abdulrasool
3c402715e4 build: tweak the conditional for section_magic
This adjusts the conditional to ensure that the section_magic dependency
is only added on target libraries not host libraries (e.g.
SwiftDemangle).
2017-11-07 12:19:38 -08:00
Saleem Abdulrasool
5e4cd22e41 build: use VFS overlay for Windows SDK
The Windows SDK provides headers which have incorrect cases.  The
incorrect cases are in the SDK headers as well.  On case sensitive file
systems this causes build issues due to the incorrect name.  Use the
clang VFS overlay to avoid the need for providing copies to the expected
cases.  This improves the cross-compilation on Linux to Windows.
2017-11-03 12:50:47 -07:00
Saleem Abdulrasool
7e888d43cd SwiftDemangle: build on non-Darwin targets
This can be useful as a consumer for demangling swift symbols.  Build
the shared library on non-Darwin targets as well.
2017-11-01 13:39:37 -07:00
Anton
18da29d8ca [FreeBSD] Fix undefined references to __atomic* 2017-10-26 18:26:09 -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
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
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
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
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
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
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
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