Commit Graph

1731 Commits

Author SHA1 Message Date
Erik Eckstein
ba364a17ef libswift: rename cmake targets and functions
libswift -> swiftCompilerModules or swiftCompilerSources
2021-12-22 11:31:52 +01:00
Kuba (Brecka) Mracek
f7291f0b21 Add SWIFT_STDLIB_HAS_LOCALE CMake to build stdlib without locale.h and locale based float parsing (#40405) 2021-12-21 11:22:54 -08:00
Eric Miotto
871c6b9b6c [CMake] Begin moving Standard Library options in a separate file (#40610)
This allows the file to be easily included where needed (e.g.
`StandaloneOverlay.cmake`) and reduce the likelihood of miscompilation
due to missing sensible defaults.

As a start, focus on a handful of parameters that got added/modified in
recent PRs.

Addresses rdar://85978195
2021-12-20 07:36:27 -08:00
Michael Ilseman
7bff9da67d Revert "Revert "Merge pull request #40595 from hamishknight/straw-bales"" 2021-12-19 10:08:48 -07:00
Arnold Schwaighofer
9511994e52 Revert "Merge pull request #40595 from hamishknight/straw-bales"
This reverts commit a67a0436f7, reversing
changes made to 9965df76d0.

This commit or the earlier commit this commit is based on (#40531) broke the
incremental bot.
2021-12-18 11:02:37 -08:00
Richard Wei
300cbaba31 Integrate experimental string processing modules and enable end-to-end regex.
- Checkout apple/swift-experimental-string-processing using a tag.
- Build `_MatchingEngine` as part of libswift (`ExperimentalRegex`) using sources from the package.
- Parse regex literals using the parser from `_MatchingEngine`.
- Build both `_MatchingEngine` and `_StringProcessing` as part of core libs using sources from the package.
- Use `Regex<DynamicCaptures>` as the default regex type until we finalize apple/swift-experimental-string-processing#68.
2021-12-17 10:33:07 +00:00
Alexander Smarus
8eaaace5ae cmake: Windows, adjust compiler identification on compiler swap
The latest CMake on Windows doesn't add `_CRT_USE_BUILTIN_OFFSETOF`
flag after we swap the compiler to clang-cl for targets like SourceKit. Also
`_add_host_variant_c_compile_flags` doesn't do so, because compiler
identification still points to MSVC compiler.

`_CRT_USE_BUILTIN_OFFSETOF` flag is necessary for `offsetof` calls to be
accepted as an integral constant expression.

This patch adjusts compiler identification on compiler swap and also
addresses some configuration issues related to clang-cl.
2021-12-14 18:58:41 +02:00
Alejandro Alonso
8a5f728daf Merge pull request #40340 from Azoy/drop-icu
[stdlib] Drop ICU
2021-12-07 01:44:38 -08:00
eeckstein
307251a803 Merge pull request #40421 from eeckstein/remove-host-swiftlib-support
cmake: remove support for non-libswift swift support in host libraries/executables.
2021-12-07 09:32:30 +01:00
eeckstein
1b2ac8cccb Merge pull request #40277 from buttaface/boot
libswift: add support for Android and OpenBSD in the CMake config
2021-12-06 20:10:31 +01:00
Erik Eckstein
6199876be7 cmake: remove support for non-libswift swift support in host libraries/executables.
This is not needed anymore because all swift code will be contained in libswift.
Also, remove the corresponding tests.
2021-12-05 19:06:00 +01:00
Erik Eckstein
1bf49ae9c8 cmake: fix a wrong library search directory order when building swift-frontend with bootstrapping 2021-12-02 19:57:35 +01:00
Eric Miotto
5b8714e0b9 [CMake] Add SWIFT_STDLIB_SHORT_MANGLING_LOOKUPS to StandaloneOverlay (#40311)
This will allow it to have a sensible default in configurations that use it.

Addresses rdar://85815655
2021-12-02 10:34:13 -08:00
Butta
4c493ef5d3 libswift: add support for Android and OpenBSD in the CMake config
Add a new libswift build mode for cross-compilation in the process, that currently
only works for non-Darwin hosts.
2021-12-01 15:27:40 +05:30
Alejandro Alonso
86fec4011d Cleanup more of the build from Saleem's comments 2021-11-30 15:01:20 -08:00
Jonas Devlieghere
fccbaa8dc7 Merge pull request #40320 from apple/asan+ubsan
[CMake] Fix error: invalid value 'address -sanitize=undefined' in '-s…
2021-11-30 08:48:58 -08:00
Jonas Devlieghere
2f0cd218bf [CMake] Fix error: invalid value 'address -sanitize=undefined' in '-sanitize='
Currently, when having both ASan and UBSan enabled, the compiler is
passed "-sanitize=address -sanitize=undefined" which results in error:
invalid value 'address -sanitize=undefined' in '-sanitize='. Pass the
two flags separately to fix the issue.
2021-11-29 17:10:21 -08:00
Doug Gregor
c4ace6af6a Make sure we define availability macros for standalone library builds
Fixes rdar://85639438.
2021-11-29 11:11:11 -08:00
Saleem Abdulrasool
761e3a5cbe Merge pull request #40306 from compnerd/linux-caches
cmake: add some caches for Linux
2021-11-29 08:22:16 -08:00
eeckstein
cbf3c5815b Merge pull request #40285 from eeckstein/libswift-build-fixes
cmake: three fixes for the libswift build
2021-11-29 09:14:02 +01:00
Saleem Abdulrasool
6b42b73df7 cmake: add some caches for Linux
This adds a set of cmake caches to build a toolchain and runtime for
Linux x86_64.  It is derived from the Windows configuration, but works
for Linux.
2021-11-27 14:00:05 -08:00
Saleem Abdulrasool
5bf4da88df SILOptimizer: avoid trawling through the directories for includes
Use the include search path for the header search rather than
constructing the path using relative paths.  This is important for
getting the interop to work properly as well.
2021-11-26 09:11:42 -08:00
Erik Eckstein
dbf74b56d2 cmake: need to link swiftrt.o for libswift-executables on linux
Otherwise dynamic metadata/conformance lookup does not work.
2021-11-26 11:54:31 +01:00
Erik Eckstein
61db072617 cmake: fix libswift build dependencies
Unfortunately using the convenient "bootstrapping0-all", etc. custom targets does not work.
For some reason it does not cause a dependent file (like libswift's SIL.o) being rebuilt when a depenency (like swift-frontend from the previous bootstrapping stage) changes.
Instead we have to list al library- and executable-targets explicitly.
2021-11-23 18:33:43 +01:00
buttaface
30c292ca87 [android] Update to NDK 23b (#39921)
The latest Long Term Support NDK finally removed binutils, including the bfd/gold
linkers and libgcc. This simplifies our Android support, including making lld the
default linker for Android. Disable three reflection tests that now fail, likely
related to issues with swift-reflection-dump and switching to lld.
2021-11-17 20:58:42 -08:00
Erik Eckstein
83bfa1b0f3 cmake: export the libswift target and the LIBSWIFT_BUILD_MODE that the lldb build can see it. 2021-11-15 17:23:21 +01:00
Saleem Abdulrasool
127874edea Merge pull request #40124 from compnerd/root
build: allow building libswift with unified builds
2021-11-11 08:01:05 -08:00
Saleem Abdulrasool
f57c16700b build: allow building libswift with unified builds
When building with unified builds, `CMAKE_SOURCE_DIR` is not the Swift
repository.  Use the locally defined `SWIFT_SOURCE_DIR` variable to
reference the root of the Swift repository.  Because libswift uses
`project` in the CMakeLists, we cannot use `PROJECT_SOURCE_DIR` here.
2021-11-10 11:56:16 -08:00
Erik Eckstein
3c40ea5d77 cmake: allow more than one dependency for libswift targets 2021-11-10 13:03:49 +01:00
Michael Gottesman
ebafda86d3 Merge pull request #40076 from gottesmm/pr-0da05c4cb7f9d69304b5ee83efb24561958a0a14
[cmake] Add a new component llvm-toolchain-dev-tools and make FileCheck installation use it.
2021-11-09 11:20:13 -08:00
Erik Eckstein
581a41c377 cmake: Don’t add -lobjc in linux builds
Fixes a linux build error.
It doesn’t make sense to let add HAS_LIBSWIFT to add_swift_host_library(). This was added to work around a linker bug (d22b348adb). Instead do the workaround in libSwiftScan/CMakeLists.txt.
2021-11-09 09:16:08 +01:00
Robert Widmann
467c81d269 Merge pull request #39970 from Bo98/libdispatch-tests 2021-11-06 08:52:05 -07:00
Michael Gottesman
8b8abd6fa2 [cmake] Add a new component llvm-toolchain-dev-tools and make FileCheck installation use it.
This will let me reuse toolchain-dev-tools for tools useful in a just built
toolchain but that are from Swift rather than copied from LLVM.
2021-11-05 20:37:54 -07:00
Erik Eckstein
e30688da82 libswift: fix dependencies in the bootstrapping build mode
swiftDarwin and swiftOnoneSupport  didn't depend on building the Swift core library.
This was a subtle bug, because the compiler just picked up the module from the SDK instead of the (still building) Swift module.
It only resulted in compiler errors if the SDK swiftinterface was too new to be parsable by the compiler.
2021-11-05 18:33:21 +01:00
Erik Eckstein
09552abc44 libswift: improve the bootstrapping-with-hostlibs build mode
Don't build the swiftCore module files in the bootstrapping phases. Instead use the module files in the SDK.
This reduces the build time overhead from 3min -> 30seconds.
2021-11-05 18:32:25 +01:00
Saleem Abdulrasool
7d112270b5 caches: add a Windows ARM64 cache file
This is useful for restoring the Windows ARM64 port of the runtime.
This currently does not build due to issues in the module.map
definitions causing a build failure.  However, adding the file enables
others to reproduce the build and help.
2021-10-31 11:53:37 -07:00
Erik Eckstein
78c4c3ff6d libswift: fixes for the linux bootstrapping build 2021-10-29 08:56:02 +02:00
Bo Anderson
6be2b40fdd [build] correct libdispatch test flag 2021-10-29 03:42:19 +01:00
Saleem Abdulrasool
cd610b83fa Merge pull request #39952 from apple/compnerd/foreign-cross-compiling
Update SwiftWindowsSupport.cmake
2021-10-28 16:51:36 -07:00
Saleem Abdulrasool
cca131258a Update SwiftWindowsSupport.cmake
Do not attempt to use a cross-compiled compiler for a foreign target.  This is not guaranteed to work (e.g. building for ARM on x64).  This at least surfaces the error properly.
2021-10-28 09:22:09 -07:00
Josh Learn
40da89c89d Undefine IB macros when building libswift 2021-10-27 14:51:38 -07:00
Saleem Abdulrasool
f91f8b804b Merge pull request #39896 from compnerd/arm64-cache
cmake: add a cache for Windows ARM64 toolchains
2021-10-24 14:41:20 -07:00
Saleem Abdulrasool
1e6e71c7dc cmake: add a cache for Windows ARM64 toolchains
This adds a CMake cache for the Windows ARM64 toolchain.  It is possible
to build and run the toolchain on ARM64, though we have not had regular
releases of the toolchain.  This adds the cache used to generate the
toolchain in the hopes that it is useful for others and that we can soon
get more regular ARM64 toolchain builds.
2021-10-24 11:22:59 -07:00
Artem Chikin
ec1ab7128c Merge pull request #39822 from artemcm/TryEarlyDriverCopyNoSymlink
[SR-15135] Copy over early `swift-driver` executable to the build dir instead of creating a symlink
2021-10-22 16:47:18 -07:00
Artem Chikin
f8427829dc [SR-15135] Copy over early swift-driver executable to the build dir instead of creating a symlink
The SwiftDriver searches `swift-frontend` based on `Bundle.main.executablePath` (which internally uses `CFGetProcessPath`). This search dir is resolved differently on macOS and Linux so swift-frontend can't be found on Linux, forcing the driver to fallback to using the host system toolchain instead of the just-built one.
2021-10-22 13:57:19 -07:00
Erik Eckstein
4383610ed3 cmake: some fixes for the libswift bootstrapping build
* fix a typo which prevented linking the right bootstrapping libs
* build swiftDarwin for bootstrapping
* disable COW checks if built with bootstrapping-with-hostlibs
2021-10-19 13:10:59 +02:00
Saleem Abdulrasool
15a5d2c54b Revert "[android] Update to NDK 23" 2021-10-16 11:07:23 -07:00
Butta
7fa1b4b2ac [android] Update to NDK 23
The latest Long Term Support NDK finally removed binutils, including the bfd/gold
linkers and libgcc. This simplifies our Android support, including making lld the
default linker for Android. Disable three reflection tests that now fail, likely
related to issues with swift-reflection-dump and switching to lld.

Also, add the libatomic dependency for Android armv7, just as on linux.
2021-10-12 12:37:01 +05:30
Max Desiatov
3f68ccade3 CMake: add Runtime-WASI-wasm32.cmake cache file (#39651)
This cache file is used when building runtime for WebAssembly/WASI.

Related to SR-9307.
2021-10-11 10:13:22 +01:00
Erik Eckstein
af71088d29 libswift: bootstrapping build
Adding build modes for libswift: off, hosttools, bootstrapping, bootstrapping-with-hostlibs
The two bootstrapping modes are new. For details see libswift/README.md
2021-09-28 18:51:42 +02:00