Commit Graph

1210 Commits

Author SHA1 Message Date
Butta
1a28a91db9 [android] Switch armv7 vendor to 'unknown' in target triple to match other arches
Recent changes have made 'none' and 'unknown' not interchangeable anymore, so
standardize on 'unknown' for armv7 too.
2020-12-02 11:05:36 +05:30
3405691582
c8e48e6d44 [cmake] Semi-parametrize manpage location.
On OpenBSD, man pages go in $CMAKE_INSTALL_PATH/man. This requires
changing the default to something with a parameter when installing
on this platform.
2020-10-24 19:39:22 -04:00
Varun Gandhi
dd4a9f3bde [CMake] Enable library evolution for Darwin overlay.
Fixes rdar://70156840.
2020-10-20 20:34:49 -07:00
Michael Gottesman
86b7bac395 Merge pull request #34023 from buttaface/rpath
[linux] remove absolute rpath of /usr/lib/swift/linux added to many shared libraries
2020-10-19 12:02:32 -07:00
John McCall
1cc3a57e91 Test the just-built dylibs when building unittests on Darwin 2020-10-15 00:36:36 -04:00
Saleem Abdulrasool
563c99bc7c Merge pull request #34160 from buttaface/arm
[android] Add support for building the toolchain for ARMv7
2020-10-04 14:40:44 -07:00
Butta
f7576a7bef [android] Add support for building the toolchain for ARMv7 2020-10-03 18:55:23 +05:30
John McCall
e1004499c4 [NFC] Split ProtocolDispatchStrategy out of MetadataValues.h.
This allows us to avoid rebuilding most of the compiler
whenever we add a new ABI constant.
2020-10-03 02:26:17 -04:00
Butta
69d04aad08 [linux] remove absolute rpath of /usr/lib/swift/linux added to many shared libraries
This was presumably added as a backup, in case the libraries in a toolchain
couldn't be found, but will not work well, so take it out.
2020-09-25 23:07:14 +05:30
Kuba (Brecka) Mracek
41f91d5365 Add a SWIFT_FREESTANDING_MODULE_NAME CMake option (#34018) 2020-09-22 15:14:44 -07:00
Kuba (Brecka) Mracek
d9d929a594 Revert "Start using optimization (-O0/-O2/-O3/-Os) and debug (-g) flags from CMAKE_CXX_FLAGS_${CFLAGS_BUILD_TYPE} (#33388)" (#33924) 2020-09-11 21:06:05 -07:00
Kuba (Brecka) Mracek
28a2826ef4 Start using optimization (-O0/-O2/-O3/-Os) and debug (-g) flags from CMAKE_CXX_FLAGS_${CFLAGS_BUILD_TYPE} (#33388) 2020-08-17 19:26:24 -07:00
Kuba (Brecka) Mracek
f91fe9c0c1 Use SWIFT_SDK_${prefix}_USE_ISYSROOT to select which SDKs should be building with -isysroot (#33469) 2020-08-14 14:33:28 -07:00
Kuba (Brecka) Mracek
ef89b0dc51 Add a 'standalone_minimal' preset to build a minimal, static, OS independent, self-contained binaries of stdlib. (#33286) 2020-08-12 07:28:34 -07:00
Saleem Abdulrasool
644b700d62 build: remove python fallback in overlay builds
Remove the Python 2 fallback from the standalone overlay build.  This
is part of the migration to Python 3.
2020-07-28 16:55:24 +00:00
Eric Miotto
6fdcfb0ebf [build] remove support for embedding bitcode in host libraries (#32730)
We are more interested in generating bitcode for the standard library.

Addresses rdar://64952135
2020-07-07 13:46:19 -07:00
Davide Italiano
ca3d37f114 [CMake] Remove a redundant and potentially incorrect check.
There's a more robust check for which SDK to support already.
This also misses `arm64` as architecture.
2020-07-06 09:43:20 -07:00
Mishal Shah
a930b51494 [Apple Silicon] Simulator support for arm64 2020-07-02 19:17:29 -07:00
Mishal Shah
83c57f3e58 [Apple Silicon] [Build] Filter out any architectures that are unsupported by the SDKs 2020-07-02 19:05:45 -07:00
Mishal Shah
587ce889e1 [Apple Silicon] Don't set native llvm tools path when cross compiling swift 2020-07-02 18:14:39 -07:00
Mishal Shah
ee1ea6e514 [Apple Silicon] Support building for macOS arm64/arm64e 2020-07-02 18:03:39 -07:00
Eric Miotto
e80b188213 [build] Add LTO flag to link options (#32683)
Following the refactoring in #31612, LTO flag was only added to compile
flags -- we need to pass this only when linking.

Addresses rdar://65037856
2020-07-02 14:44:37 -07:00
Eric Miotto
d285123c0a [build] Pass target to linker for host tools for Apple SDKs (#32618)
As part of this refactor some code touched as part of #31794 to better fit into the work done in #32120 -- in detail

* `_add_host_variant_c_compile_link_flags` is now invoked by both add_swift_host_library and add_swift_host_library
* `_add_host_variant_c_compile_link_flags` now sets the target in linker arguments when building against Apple SDKs

Addresses rdar://64911978
2020-07-01 11:01:14 -07:00
Mishal Shah
bbfcc62221 Merge pull request #32127 from compnerd/python-is-dead-long-live-python
build: switch gyb to Python3
2020-06-25 17:33:07 -07:00
Saleem Abdulrasool
b9476ce72a build: correct handling of argument generation
This adjusts the target specific argument handling to use the same logic
as the toolchain, and in doing so, silences the spurious warnings when
building with a MSVC toolchain.
2020-06-22 11:07:23 -07:00
Saleem Abdulrasool
10d15b8bad build: switch gyb to Python3
Change the build system to invoke gyb with python3 instead of python2.
2020-06-19 11:03:31 -07:00
Saleem Abdulrasool
dc1624dee0 build: style updates (NFC)
Adjust the CMakeLists.txt to match the rest of the usage.
2020-06-06 14:00:50 -07:00
Saleem Abdulrasool
f9128bac81 build: use the same pattern for detecting Darwin platforms
The host platform should be using `CMAKE_SYSTEM_NAME STREQUAL Darwin`.
However, we currently drive the host side of the compilation against
custom variables.  This makes the migration simpler by ensuring that the
entire file uses the same pattern.

Since `is_darwin_based_sdk` is now used only in the standard library
build, sink it to the standard library build.
2020-06-04 08:39:59 -07:00
Saleem Abdulrasool
ec60746b99 Merge pull request #32120 from compnerd/macOS-cl
build: simplify macOS path (NFC)
2020-06-02 07:36:21 -07:00
Michael Gottesman
21ca9d4519 Merge pull request #32111 from gottesmm/pr-846f5396754c136c8adbf30b79b0b1c4b33ff9e5
[cmake] Move ar linking optimization rule into UnixCompileRules.cmake and only run it on Unix-like platforms.
2020-06-01 11:37:00 -07:00
Saleem Abdulrasool
f5a75dcefd build: simplify macOS path (NFC)
It does not make sense to use the `cl` frontend to clang to build for
macOS.  Remove the unnecessary condition and always perform the
operation.
2020-06-01 08:40:03 -07:00
Michael Gottesman
72d8d9be6b [cmake] Move ar linking optimization rule into UnixCompileRules.cmake and only run it on Unix-like platforms.
This doesn't make sense on Windows and from what compnerd has said it doesnt
even appear in the ninja rules file. This also moves this rule out of the main
flow of the top level CMakeLists.txt file so I can reuse it when compiling the
stdlib using a sub-cmake invocation.
2020-05-30 21:29:04 -07:00
Saleem Abdulrasool
1cc6698ae6 build: remove unnecessary CXX_STANDARD for Windows
The entire project is now at C++14.  Windows had to adopt C++14 earlier
to support processing the Windows SDK headers.  This is no longer
necessary, adopt the global settings instead.
2020-05-30 15:26:02 -07:00
David Zarzycki
3767ece85c [CMake] Simplify two binary variables into one tri-state variable
Also remove some ancient logic to detect and ignore requests to use LLD.
If people want to explicitly use LLD, they probably have a reason and we
shouldn't second guess them.
2020-05-28 06:08:03 -04:00
Saleem Abdulrasool
756bc505f7 build: correct variable in SDK configuration
The variable was supported to be set to the triple, except it was set to
the variable itself, effectively setting the variable to nothing.  This
is needed to clear the path to directory style installation for
non-Apple targets.
2020-05-23 16:45:10 -07:00
Saleem Abdulrasool
79bed6c4a7 Merge pull request #31481 from compnerd/not-everything-that-glitters-is-gold
build: default the lld/gold enabling as per reality
2020-05-23 19:42:24 -04:00
Dmitri Gribenko
b6d0ef5c81 Remove support for a broken std::regex in libstdc++ 4.8
Out of all operating systems ever supported by Swift, only Ubuntu 14.04
had libstdc++ 4.8, and Swift has sunset support for Ubuntu 14.04 for a
while now.
2020-05-19 17:20:55 +02:00
Eric Miotto
0c403fe766 [build] Pass target argument to the linker if needed (#31794)
Following #31125 and #31612, `-target` is not added automatically to
linker flags when that's needed (e.g. when building for Apple SDKs) --
mimic the logic used to add it for compiler flags.

Addresses rdar://63138761
2020-05-18 08:14:59 -07:00
Dario Rexin
32a189c281 Merge pull request #31329 from compnerd/host-library-handling
`add_swift_host_library` cleanup
2020-05-12 12:23:38 -07:00
Dario Rexin
a554f088d6 Merge pull request #31612 from compnerd/out-in
build: convert out parameter to target
2020-05-11 21:50:12 -07:00
Saleem Abdulrasool
f3da784843 Merge pull request #31672 from swiftwasm/maxd/wasi-sdk
build: Add support for WASI in CMake files
2020-05-11 09:32:12 -07:00
Michael Gottesman
2b2b5b8f08 [benchmarks] Remove cmake based external perf testsuite build.
If we do an external benchmark build, we will do it via the toolchain benchmark
build-script job. This will be simpler by allowing us to build against a just
built toolchain and separate us from the rest of swift's main CMakeLists.txt.
2020-05-10 14:16:14 -07:00
Max Desiatov
762079665e Add support for WebAssembly/WASI in CMake files 2020-05-10 11:32:04 +01:00
Saleem Abdulrasool
84a7882419 build: add file dependencies for gyb
Add dependencies on the files for gyb to ensure that updates gyb are
treated as triggers to regenerate the files.  This is suspected to have
caused issues for incremental builds.
2020-05-07 12:33:04 -07:00
Saleem Abdulrasool
f03cd0e9a8 build: convert out parameter to target
Rework `_add_host_variant_c_compile_link_flags` to apply the flags
directly rather than to compute the value and have the caller apply.
2020-05-06 22:03:13 -07:00
Saleem Abdulrasool
d1f798bedb Merge pull request #31548 from compnerd/analytical-methods
build: remove `ANALYZE_CODE_COVERAGE` from `_add_host_variant_c_compi…
2020-05-06 17:18:20 -07:00
Saleem Abdulrasool
58fc3c5920 build: remove explicit link against atomic
This is no longer required after the fix for the over-aligned type for
the atomic type.
2020-05-05 08:50:34 -07:00
Saleem Abdulrasool
d5c2bc20db build: remove ANALYZE_CODE_COVERAGE from _add_host_variant_c_compile_link_flags
This flag does not make sense here as this function is called from
`_add_host_variant_link_flags` and `_add_host_variant_c_compile_flags`.
The latter will add the flags appropriately.  The former is always
invoked *after* `_add_host_variant_c_compile_flags`.  This effectively
was duplicating the flags.
2020-05-04 16:06:29 -07:00
Saleem Abdulrasool
c6cc769a64 build: default the lld/gold enabling as per reality
Rather than defaulting both of these to true, enable gold by default
only on ELFish targets, and enable LLD by default for Windows on
non-Windows hosts.
2020-05-01 13:56:57 -07:00
Saleem Abdulrasool
d6b43e4b6f build: clean up the mac catalyst flag handling in the host
The toolchain does not actually use any catalyst flavor, which resulted
in these paths actually being dead.  Cull them except for the one path
which simply computes the target triple.
2020-05-01 13:19:59 -07:00