Commit Graph

433 Commits

Author SHA1 Message Date
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
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-ci
186717f583 Merge pull request #34628 from buttaface/native-clang 2021-01-06 15:54:22 -08:00
Butta
d4797537d3 [build] Remove redundant block applying '-mcx16' flag again for Android x86_64 2020-12-18 08:33:24 +05:30
Ben Langmuir
9422c4b213 [cmake] Avoid passing -mcx16 to non-x86_64 compilations
We were checking the host instead of the target compiler, causing many
warnings about passing -mcx16 while building the runtime for arm.
2020-12-15 13:23:20 -08:00
Butta
c74884ce30 [build] Make it possible to actually build the stdlib with a prebuilt clang 2020-12-13 18:22:33 +05:30
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
Eric Miotto
41dddf4a20 [CMake] Extend copy-legacy-layouts dependency to swiftmodules (#34846)
... and other products as well.

Before this change, the dependency was enforced only for stdlib object
files -- since according to the Ninja dependency graph other libraries
can be scheduled as soon as the swiftmodules are ready, there is a
chance that we attempt to build those before legacy layours are copied.

Addresses rdar://71559791
2020-11-30 08:18:41 -08:00
Butta
8574fe7204 [build] Remove remaining dependencies on libatomic, for Android, BSD and Haiku
Follow suit from linux, #29581, tested on Android.
2020-11-16 10:16:12 +05:30
Mike Ash
e4add559ee [CMake] Pass -no_warn_inits to the linker on Apple platforms to silence warnings about global initializers.
We already get warnings from clang at compile time. For cases where we silence those, with SWIFT_ALLOWED_RUNTIME_GLOBAL_CTOR_BEGIN, these warnings are just noise.

rdar://problem/70445131
2020-11-09 16:25:15 -05:00
Kavon Farvardin
8624643fc4 when building the swift libs, do not automatically import _Concurrency
This fixes issues when building Swift with concurrency enabled by default. See rdar://71045297

If some of our overlays need to use the concurrency API, they can manually import _Concurrency.
2020-11-06 11:58:50 -08:00
Eric Miotto
c813732676 Pass include paths when emitting macOS swiftmodule for zippered libraries (#34547)
This matches the behaviour for emitting macCatalyst swiftmodules and should avoid preferring dependencies from the SDK instead of just built ones.

Addresses rdar://70682224
2020-11-04 11:16:04 -08:00
Kuba (Brecka) Mracek
d7dfa3e942 Bring up tests + validation tests for the 'freestanding' build and the standalone_minimal preset (#34386) 2020-10-26 16:32:36 -07: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
e6da0c2eea Make MinSizeRel builds of stdlib (but not the compiler) produce debug info (#33787) 2020-09-24 09:26:39 -07:00
Kuba (Brecka) Mracek
58f2ae695b Add a SWIFT_STDLIB_STABLE_ABI flag to be able to build the stdlib without -enable-library-evolution (#33443) 2020-09-21 16:33:00 -07:00
Saleem Abdulrasool
b0a13e7e55 build: repair cross-compilation for Windows after #33908
`CMAKE_SYSTEM_NAME` specifies the host, not the build.  Use the correct
executable extension for the host.
2020-09-16 09:56:03 -07:00
Robert Widmann
399b190ea9 Merge pull request #33908 from stevapple/check-windows
[test] Fix line-directive on Windows
2020-09-15 18:56:00 -06:00
Saleem Abdulrasool
af868e5c8f build: migrate towards the unified directory layout for modules
This changes the install layout to be similar across Darwin and
non-Darwin platforms.  This will enable simplifying the user experience,
build infrastructure, and the driver as the SDK layout converges towards
a single layout on all the platforms.
2020-09-13 17:46:54 -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
stevapple
fa6a8eceff [test] Fix line-directive on Windows 2020-09-12 00:55:03 +08:00
Kuba (Brecka) Mracek
aa0f8e670b Add a SWIFT_STDLIB_OS_VERSIONING flag to avoid querying OS version at runtime, use it in the freestanding build (#33791) 2020-09-11 08:09:14 -07:00
Kuba (Brecka) Mracek
b5252eb0e3 Fix incorrect build type regression from ef89b0dc51 (#33894) 2020-09-10 17:25:37 -07:00
Kuba (Brecka) Mracek
7f26d97746 Don't use resilient getter for playgroundPrintHook when resilience is off (#33848) 2020-09-10 14:06:58 -07:00
Kuba (Brecka) Mracek
9de7b59388 Subsume SWIFT_STDLIB_USE_NONATOMIC_RC into SWIFT_STDLIB_SINGLE_THREADED_RUNTIME (#33643) 2020-08-26 21:28:30 -07:00
Kuba (Brecka) Mracek
9ead8d57fa Add a single-threaded stdlib mode, use it for the 'minimal' stdlib (#33437) 2020-08-25 06:03:14 -07:00
Kuba (Brecka) Mracek
db18deaf91 Add a SWIFT_RUNTIME_MACHO_NO_DYLD stdlib mode that doesn't dynamically look up sections in modules, and only assumes a single static module (#33441) 2020-08-18 11:46:42 -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
925835f158 NFC: Use SWIFT_APPLE_PLATFORMS and remove is_darwin_based_sdk 2020-08-14 21:04:02 -07:00
Kuba (Brecka) Mracek
aa924196ff Add a flag to build the stdlib without COMPATIBILITY_OVERRIDE (#33438) 2020-08-14 17:06:38 -07:00
Kuba (Brecka) Mracek
11c9184c6c Use SWIFT_SDK_${sdk}_OBJECT_FORMAT to choose whether to use lipo and multi-arch builds 2020-08-14 17:05:51 -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
e2e69578a6 For the 'minimal' stdlib, disable Objective-C interop (#33427) 2020-08-13 15:26:04 -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
Dario Rexin
7e60a73335 Merge pull request #33168 from drexin/wip-fix-resource-folder
Properly compute resource folder when linking statically
2020-08-04 12:52:38 -07:00
Kuba (Brecka) Mracek
c6ea30c963 Instead of random file name, use a hash as a deterministic name for Swift source file list in _compile_swift_files (#33190) 2020-08-03 10:33:00 -07:00
Dario Rexin
0850436d9f Properly compute resource folder when linking statically
- deduplicate the logic to compute the resource folder
- install headers and module files in shared and static resource folders
- forward -static flag when calling swiftc with -print-target-info
2020-07-30 15:07:03 -07:00
Michael Gottesman
2ea7cd2b87 [cmake] Generate opt-remark bitstream files for the stdlib. 2020-07-18 20:19:27 -07:00
Eric Miotto
e497089d88 [build] don't embed bitcode for target libs built for simulators (#32871)
At the same time rework condition so that it is more amenable to code
searches.

Addresses rdar://65501878
2020-07-14 11:37:46 -07:00
Saleem Abdulrasool
46c4c2bf72 Merge pull request #30733 from allevato/rt-inline-ns
Wrap (de)mangling namespaces in an inline namespace.
2020-06-24 08:34:53 -07:00
Doug Gregor
f71f6207b5 [CMake] Make swift-frontend the primary Swift binary.
Build swift-frontend as the primary Swift binary, and have
swift/swiftc/etc. symlink over to it. This is a step toward allowing
swift-driver to replace the swift and swiftc binaries.
2020-06-23 13:00:26 -07:00
Mishal Shah
272c466e47 Update master to build with Xcode 12 beta 2020-06-22 15:43:20 -07:00
Tony Allevato
5b1daa9055 Conditionally wrap (de)mangling symbols in an inline namespace.
Since libDemangling is included in the Swift standard library,
ODR violations can occur on platforms that allow statically
linking stdlib if Swift code is linked with other compiler
libraries that also transitively pull in libDemangling, and if
the stdlib version and compiler version do not match exactly
(even down to commit drift between releases). This lets the
runtime conditionally segregate its copies of the libDemangling
symbols from those in the compiler using an inline namespace
without affecting usage throughout source.
2020-06-19 11:20:56 -07:00
Michael Gottesman
46432404f3 [ownership] Remove dead option: enable-ownership-stripping-after-serialization.
We always lower ownership now after the diagnostic passes (what this option
actually controlled). So remove it.

NFC.
2020-06-16 10:52:02 -07:00
Saleem Abdulrasool
e9548b019b Merge pull request #32182 from compnerd/uniformity
build: use the same pattern for detecting Darwin platforms
2020-06-04 13:43:58 -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
3405691582
9a93b61f67 [stdlib][cmake] OpenBSD target requires -lpthread.
Like FreeBSD, OpenBSD needs -lpthread for a target link. This is
necessary to get the swift-reflection-test to link and build correctly.
2020-06-03 20:18:19 -04: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
4c115e1484 build: cleanup some unnecessary settings for Windows
Windows had moved to C++14 much earlier than the rest of Swift.  This
was required in order to deal with the Windows SDK headers.  Now that
the project has fully moved to C++14, remove the unnecessary settings
for Windows.
2020-05-23 11:21:10 -07:00