Commit Graph

1731 Commits

Author SHA1 Message Date
Saleem Abdulrasool
2990e8bc07 build: repair the build with VS2019 16.10.0
The newest VS2019 release updates CMake to 3.20, which picks up
`llvm-mt` as a preferred manifest tool.  However, we do not build
`llvm-mt` with libxml2 support currently, which prevents the use of the
just built manifest tool for building libdispatch.  Explicitly opt into
using the MSVC manifest-tool.
2021-05-28 11:20:25 -07:00
Michael Gottesman
467b23ad9b Merge pull request #37577 from gottesmm/pr-1105250c37357c900a8232c2106cbb9fd68896f8
[cmake] Some more small changes to enable host side tools that use swift using standard cmake.
2021-05-23 11:43:04 -07:00
Argyrios Kyrtzidis
a3095e71aa [AddSwift.cmake] Unbreak non-assertions build
Fails to build with "error: macro name must be an identifier" due to trying to pass `-D-DNDEBUG` as compiler argument.
2021-05-21 21:57:48 -07:00
Michael Gottesman
53a7ccafba [cmake] Allow for add_swift_host_libraries to set that they shouldn't use llvm update flags.
This is specifically important for host libraries that include swift
content. llvm_update_compile_flags currently doesn't conditionalize the flags it
adds since it needs to be updated like I updated Swift's cmake in
558c9d4086.

In the short amount of time that I am dealing with upstream to patch those
flags, this patch will unblock eeckstein and let him continue with his libswift
work.
2021-05-21 15:20:30 -07:00
Michael Gottesman
245905d161 [cmake] Allow for host libraries to be object libraries by letting add_swift_host_library take an OBJECT parameter. 2021-05-21 15:20:30 -07:00
Michael Gottesman
0c1d8a6c6f [cmake] Enable cross-module-optimization when compiling swift libraries in release/relwithdebinfo. 2021-05-20 13:57:04 -07:00
Michael Gottesman
bc6dbd4a09 [cmake] Force the linker_language of host executables to be CXX.
In certain cases our executables are going to have a mix of cxx,swift. There are
current issues when linking cxx,swift code with swiftc itself, so this lets us
avoid that problem.
2021-05-20 13:57:04 -07:00
Michael Gottesman
7e439eed09 [cmake] For now when compiling host swift code into a library, put -gnone to prevent the driver from running dsymutil on static libraries.
Work around for this problem until rdar://78271443 (which tracks the underlying
issue) lands so this no longer happens.
2021-05-20 13:57:04 -07:00
Michael Gottesman
95aeaf7b64 Merge pull request #37510 from gottesmm/pr-af6b60d3b83155f33bb1d91e497422748ddcc917
[cmake] Use generator expressions to change conditionalize target_compile_definition that are for c/c++ only be used for c/c++
2021-05-19 19:01:57 -07:00
Michael Gottesman
558c9d4086 [cmake] Use generator expressions to change conditionalize target_compile_definition that are for c/c++ only be used for c/c++
I am in the process now of preparing the tree for the addition of Swift code in
the optimizer as a normal source of source file. The goal is to make it so that
one can just include a random swift library anywhere in the swift project host
build and the cmake will use the swift compiler from the host
toolchain/compile-link the code just as if it was a normal host side thing (1).

In order to do this though, we need to deal with the legacy of our cmake
creating compile flags without constraining the flags to only being used if
cmake is compiling c/c++ code. To fix this, I just inserted generator
expressions into the host side swift build's cmake that uses generator
expressions to perform such conditionalization. The result is that the parts of
a target that are c/c++ will get these flags, but these flags will not propagate
to any Swift files that we add.

(1) With time this implies that we will need to be able to bootstrap the swift
compiler. We are not crossing that bridge now since the only places that we are
going to use this today is in the SILOptimizer optimier passes. These can always
be disabled while cross compiling, meaning that we can make progress here
without having the bootstrapping completely ironed out.
2021-05-19 14:46:36 -07:00
Michael Gottesman
9412f19802 [cmake] Change set_swift_llvm_is_available to set definitions on a specific target.
Otherwise we set it on all targets/languages in a subdirectory (I forgot if it
propagates up). Regardless, this type of viral stuff is something we want to
move away from since it creates a code that is a "forall" piece of code rather
than a piece of code that only effects a single target.

I also conditionalized the actual definitions being added on the compiled file's
language being C,CXX,OBJC,OBJCXX since as we add Swift sources to the host side
of the compiler, we will not want these flags to propagate to Swift sources.
2021-05-19 13:22:02 -07:00
rollmind
87e3453f03 remove unnecessary scripts
gtest, gtest_main LINK_LIBRARIES dependencies changed by that removed scripts to absolute library file path. as a result losing necessary include path dirs.
2021-05-01 00:39:39 +09:00
Artem Chikin
ae2e856f9b Revert "Merge pull request #37114 from apple/revert-36377-NewDriverDefault"
This reverts commit 937e1a365c, reversing
changes made to a5440a8abd.
2021-04-28 15:11:36 -07:00
Artem Chikin
1e44ed00eb Revert "Always build SwiftDriver and use it as default compiler driver" 2021-04-28 11:20:21 -07:00
Artem Chikin
23452d5bad Merge pull request #36377 from artemcm/NewDriverDefault
Always build SwiftDriver and use it as default compiler driver
2021-04-27 09:53:06 -07:00
Artem Chikin
c2dc8e3d07 Always build (and use) the new SwiftDriver as the default compiler driver.
This will make sure that compiler developers are using the new driver when they build the compiler locally and use it.

- Adds a new build-script product category: before_build_script_impl for products we wish to build before the impl products.
- Adds a new EarlySwiftDriver product to that category, which gets built with the host toolchain.
- Adds an escape hatch: --skip-early-swift-driver
- Adjusts the swift CMake configuration with an additional step: swift_create_early_driver_symlinks which (if one was built) creates symlinks in the swift build bin directory to the EarlySwiftDriver swift-driver and swift-help executables.
- Adds a new test subset : only_early_swiftdriver, which will get built into a corresponding CMake test target: check-swift-only_early_swiftdriver-* which runs a small subset of driver-related tests against the Early SwiftDriver.
  - This subset is run always when the compiler itself is tested (--test is specified)
  - With an escape disable-switch: --skip-test-early-swift-driver
  - All tests outside of only_early_swiftdriver are forced to run using the legacy C++ driver (to ensure it gets tested, still).

NOTE: SwiftDriver product (no 'Early') is still the main product used to build the driver for toolchain installation into and for executing the product's own tests. This change does not affect that.
2021-04-26 12:17:32 -07:00
Mishal Shah
b5a01ba5e0 Support for x86_64 watchOS simulator
* Start testing watchOS simulator x86_64 and i386 by default

Users will require to install watchOS 6.2 or older simulator to support i386.

1. Install watchOS 6.2 or older simulator (Xcode -> Preferences -> Components -> Simulators).
2. Create a 32-bit watchOS device.
3. Run:
`xcrun simctl create 'Apple Watch Series 2 - 42mm' com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm com.apple.CoreSimulator.SimRuntime.watchOS-6-2`
2021-04-22 20:06:17 -07:00
Robert Widmann
0149ccd0ca Add arm64_32 support for Swift
Commit the platform definition and build script work necessary to
cross-compile for arm64_32.

arm64_32 is a variant of AARCH64 that supports an ILP32 architecture.
2021-04-20 14:59:04 -07:00
rollmind
909898ed84 [cmake] [unittests] include googletest headers to Xcode project header search paths
add target include directories on AddSwiftUnittests.cmake module.
currently generated Xcode project doesn't include googletest headers after https://reviews.llvm.org/D86616
2021-04-20 20:12:16 +09:00
Dario Rexin
01298df2f5 Enable import of _Concurrency by default on Linux 2021-04-13 23:14:06 -07:00
Dario Rexin
1ae371b470 Re-add dependency on libatomic for 32-bit Linux platforms (#36659) 2021-03-31 13:31:58 -07:00
Saleem Abdulrasool
5f9eba2cb3 build: build parser-lib by default on Windows
Add parser-lib to the default build configuration on Windows.  This is
useful for building additional tooling.
2021-03-19 08:22:28 -07:00
Saleem Abdulrasool
9b1eccc003 Merge pull request #35920 from compnerd/target-libdispatch
build: build target libdispatch as necessary
2021-02-11 17:57:16 -08:00
Daniel Rodríguez Troitiño
87a403e53f [Concurrency] Fix Android ARMv7 C libdispatch build (#35905)
For cross-compiling Android one can simply provide
CMAKE_ANDROID_ARCH_ABI and the right CMAKE_SYSTEM_PROCESSOR will be
chosen by CMake. Since the SDK arch names are not the expected ones by the Android NDK,
it is better not to use them. The change should keep sending the
CMAKE_SYSTEM_PROCESSOR for SDKs that are not ANDROID, while skipping it
for the ANDROID SDKs.
2021-02-11 09:17:02 -08:00
Saleem Abdulrasool
3b1f01d60e build: build target libdispatch as necessary
This should not be predicated on the host libdispatch being built, only
if concurrency is being built in multithreaded mode.
2021-02-11 09:10:10 -08:00
Dario Rexin
00117e8750 [Concurrency] Fix Android C libdispatch build (#35881)
* [Concurrency] Fix Android C libdispatch build

We need to pass CMAKE_ANDROID_NDK and CMAKE_ANDROID_ARCH_ABI to the
build.

* Set proper ANDROID_ARCH_ABI

* Add -DCMAKE_ANDROID_API to C libdispatch build

* Fix compiler config for Android
2021-02-10 17:35:14 -08:00
Dario Rexin
51bdfa1919 [Concurrency] Build C-only libdispatch as part of Swift build (#35837)
* [Concurrency] Build C-only libdispatch as part of Swift build
2021-02-09 14:24:52 -08:00
buttaface
e6f5913772 [android] Move to the NDK's unified sysroot (#34491)
Since the NDK removes the platforms/ and sysroot/ directories in the latest NDK
22, switch to the unified sysroot in toolchains/llvm/ and take advantage of a
bunch of simplification that's now possible.
2021-02-07 09:19:18 -08:00
swift-ci
e417124ea4 Merge remote-tracking branch 'origin/main' into rebranch 2021-01-31 16:33:35 -08:00
Varun Gandhi
36b589d623 Merge pull request #35538 from mininny/disable-dead-stripping-option
[build-script] Add swift-disable-dead-stripping option for disabling dead stripping
2021-01-31 16:31:48 -08:00
Adrian Prantl
a9f05c8c30 Merge remote-tracking branch 'origin/main' into rebranch
Conflicts:
	lib/IRGen/IRGenDebugInfo.cpp
2021-01-29 16:17:10 -08:00
Erik Eckstein
adae4d7dc7 cmake: another fix for include all header files in Xcode projects.
Header files from within the lib directory were missing.
Also: use get_filename_component instead of regex matching.
2021-01-29 20:48:33 +01:00
swift-ci
e0f68c0b84 Merge remote-tracking branch 'origin/main' into rebranch 2021-01-29 10:12:33 -08:00
Erik Eckstein
3c90576db0 cmake: fix Xcode project generation to include all header files.
This was broken by commit cf1f240534.
This commit reverts the 2 lines which broke the inclusion of header files in the generated Xcode project.
2021-01-29 16:29:08 +01:00
Minhyuk Kim
b0426829fe Add swift_disable_dead_stripping option for disabling dead stripping in Swift build 2021-01-22 23:56:02 +09:00
swift-ci
e6a7c056a3 Merge remote-tracking branch 'origin/main' into rebranch 2021-01-13 13:32:29 -08:00
Robert Widmann
b436825948 Trade Usages of -m${platform}-version-min For -target
There's no reason to use -m${platform}-version-min as of clang-11/Xcode 11. Clang is now smart enough to parse -target and provide Apple's ld with the appropriate -platform_version argument string.
2021-01-13 11:00:39 -08:00
swift_jenkins
9f5e4e98f7 Merge remote-tracking branch 'origin/main' into next 2021-01-06 17:12:10 -08:00
Butta
934823a99c [build] Replace SWIFT_CROSS_COMPILING with SWIFT_PREBUILT_CLANG 2020-12-13 18:22:34 +05:30
swift_jenkins
0b20fc3b0b Merge remote-tracking branch 'origin/main' into next 2020-12-08 16:42:26 -08:00
swift_jenkins
19589db780 Merge remote-tracking branch 'origin/main' into next 2020-12-04 10:23:11 -08:00
John McCall
c346d94655 Fix the build and implementation of the 16-byte atomics for MSVC.
Credit for the cmake fix here goes to Saleem Abdulrasool.

The substantive fix is embarrassing; I didn't pay close attention
to the intrinsic's argument order and just assumed that the first
argument for the replacement value was the low half (the part
you'd find at index 0 if it were an array), but in fact it's the
high half (the part you'd find at index 1).

I also change the code to be much more reinterpret_casty, which
isolates the type-punning mostly "within" the intrinsic, and
which seems to match how other code uses it.
2020-12-04 01:51:29 -05:00
swift_jenkins
f1eec97e9d Merge remote-tracking branch 'origin/main' into next 2020-12-02 19:33:30 -08:00
John McCall
ca16548470 Add a swift::atomic<T> which uses a better ABI than MSVC's 128-bit std::atomic. 2020-12-02 18:47:02 -05:00
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
swift_jenkins
9d1a110432 Merge remote-tracking branch 'origin/main' into next 2020-12-01 14:04:19 -08:00
David Smith
0180aca9fc Merge branch 'main' into david/fix-merge-conflict 2020-10-27 13:05:20 -07:00
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