Conflicts:
- `lib/AST/TypeCheckRequests.cpp` renamed `isMoveOnly` which requires
a static_cast on rebranch because `Optional` is now a `std::optional`.
This would be needed to stop using `swift-api-extract` in some
internal configurations.
Given the limited scope, only add this as a CMake flag.
Addresses rdar://117019309
If we're bootstrapping *and* skip-early-swiftsyntax is enabled, the
build can fail while trying to build target executables because we
haven't built a copy of libswiftCore yet but *the compiler* refers
to it.
This is "fixed" in other places by setting LD_LIBRARY_PATH, but we
don't want or need to do that here; we just want to delay building
these executables until after libswiftCore is available.
rdar://116485713
Turn on frame pointers for the Swift runtime libraries. This makes
backtraces that go through the runtimes more reliable without having
to parse DWARF data.
rdar://116112040
This was causing `swift-backtrace` to crash when linked with the static
version of the runtime, because the runtime then couldn't locate any of
the necessary metadata.
rdar://115278959
This adds a new binary, `swift-backtrace-static`, to the build. The runtime
will not by default use this binary as the backtracer, but if you want to
statically link your own binaries against the standard library you can copy
`swift-backtrace-static` rather than `swift-backtrace` alongside your binary,
naming it `swift-backtrace`, and the runtime should find and use it, which
will mean you don't need to have `libswiftCore.so` et al installed.
rdar://115278959
This isn't a "complete" port of the standard library for embedded Swift, but
something that should serve as a starting point for further iterations on the
stdlib.
- General CMake logic for building a library as ".swiftmodule only" (ONLY_SWIFTMODULE).
- CMake logic in stdlib/public/core/CMakeLists.txt to start building the embedded stdlib for a handful of hardcoded target triples.
- Lots of annotations throughout the standard library to make types, functions, protocols unavailable in embedded Swift (@_unavailableInEmbedded).
- Mainly this is about stdlib functionality that relies on existentials, type erasure, metatypes, reflection, string interpolations.
- We rely on function body removal of unavailable functions to eliminate the actual problematic SIL code (existentials).
- Many .swift files are not included in the compilation of embedded stdlib at all, to simplify the scope of the annotations.
- EmbeddedStubs.swift is used to stub out (as unavailable and fatalError'd) the missing functionality.
Use 'copy_if_different' instead of 'file(GENERATE'. Somehow
'file(GENERATE' failed with
CMake Error: Files to be generated by multiple different commands:
Write source file list using 'file(GENERATE' so that they are updated
only if thier content is changed. Otherwise stdlib modules are rebuild
everytime cmake configuration happens.
'.private.swiftinterface' should be a part of the module. And it's
declared as `OUTPUT` file list, but they were never created. Because of
that the target was always rebuilt.
Ubuntu 18.04 seems to be defaulting to 'ascii', causing an error when
using line-directive combined with the utf-8 diagnostic output used when
early swift syntax is enabled.
Some non-stdlib thing e.g. swift-backtrace still might be built before
the runtime is built. For building Swift code in Linux "hosttools",
always set 'LD_LIBRARY_PATH' to the runtime in the builder.
Header search path for Swift shims is "usr/lib/swift". Don't rely on
clang looking for module maps in immediate subdirectories like "shims"
but add a module map to "usr/lib/swift" sourcing "shims" modules.
rdar://106677321
These headers need to be ahead of all the LLVM headers, which are added
before the flags are. Add a new parameter to pass through headers to add
as a prefix.
Resolves rdar://113647684.
The CxxStdlib module is built statically only. We would previously
build the static library but indicate dynamic linking. This would
incorrectly code generate in the client on Windows making it impossible
to use the module.
Windows names static libraries with a `lib` prefix and a `lib` suffix.
This differentiates them from the import libraries which have no prefix
and a `lib` suffix. This adjustment enables the parallel installation
of import libraries and static library variants for a given module.
This is required to support static and dynamic library co-existence in
Swift.
This makes the `stdint` module implicit which repairs the ability to
build some components. In order to accomplish this, we need to
potentially break the fragile Swift build system. Due to the incorrect
handling of compilers we need some workarounds to support
cross-compilation. This removes the injected system header paths when
building on Windows to ensure that the clang resource headers are not
following the system headers which breaks the modules as the clang
resources are dependent on the system headers when running in hosted
mode.
Because the rpath isn't set, the dynamic linker can't find the Swift
libraries when we try to run `swift-backtrace` on Linux (when we
actually install everything).
rdar://113337854