Commit Graph

75 Commits

Author SHA1 Message Date
Ian Anderson
15345ef2d5 [CMake][Darwin] Remove support for building the SDK overlays on Apple platforms
The SDK overlays have been provided in the Apple SDKs for many years, and the interface and implementation has diverged in more recent years such that trying to build the Swift version no longer works. Remove all of the dead code.

rdar://151889154
2025-05-23 23:38:08 -07:00
Karoy Lorentey
02adf95cfb Merge pull request #78799 from lorentey/note-cas-loops
[doc] Atomic.add, .subtract: Add note on atomic codegen
2025-05-16 19:05:10 -07:00
Eric Miotto
8c7e8550aa CMake: add explicit dependency to _Builtin_float to targets...
... that would import that as a result of importing Darwin from the SDK.

Amend my previous change to Differentiation and Distributed in this
sense.

Addresses rdar://150400049
2025-05-05 10:39:14 -07:00
Eric Miotto
231a9d989d Add _Builtin_float dependency to Distributed and Synchronization
This will avoid errors in CI when the latter ones are scheduled before
the former.

Addresses rdar://149558141
2025-04-28 09:37:07 -07:00
Doug Gregor
fe6856726e [Strict memory safety] Remove now-extraneous "unsafe" from the standard libraries
Now that we aren't propagating "unsafe" to nested types, remove
unnecessary "unsafe" keywords from the standard library.
2025-04-19 08:13:05 -07:00
Alejandro Alonso
c384db5b91 Merge pull request #80658 from Azoy/public-cell
[stdlib] Make _Cell public
2025-04-14 12:07:46 -07:00
Max Desiatov
99a4b887f9 NFC: fix comment in WasmImpl.swift (#80760)
Wasm is not an acronym, thus it's not uppercased [per the spec](https://webassembly.github.io/spec/core/intro/introduction.html#wasm).
2025-04-11 12:30:01 -07:00
Alejandro Alonso
fafdc8663b Make _Cell public 2025-04-08 16:07:54 -07:00
Kuba (Brecka) Mracek
a1cdd336f0 Merge pull request #80420 from kubamracek/embedded-drop-mach-apple
[embedded] Stop using -D__APPLE__ and -D__MACH__
2025-04-01 06:25:44 -07:00
Allan Shortlidge
3a574c0e6f stdlib: Address StrictMemorySafety warnings in Concurrency related code. 2025-03-31 16:45:08 -07:00
Kuba Mracek
6d71f45101 [embedded] Stop using -D__APPLE__ and -D__MACH__ 2025-03-31 15:07:11 -07:00
Doug Gregor
53f14688a6 Update strict memory safety annotations for Synchronization module 2025-03-10 15:42:32 -07:00
Doug Gregor
1efb994375 Enable strict memory safety in the Synchronization module 2025-02-26 14:28:28 -08:00
Ben Rimmington
4bb3cf1496 [stdlib] Update WordPair: Comparable conformance (#79606) 2025-02-25 10:17:05 -08:00
Alejandro Alonso
d2309d264d Fix tests 2025-01-28 12:50:51 -08:00
Alejandro Alonso
9af4a76b52 Use tuple comparison 2025-01-23 15:55:19 -08:00
Alejandro Alonso
8500d0cba1 Less than is a static function.. 2025-01-23 13:09:47 -08:00
Alejandro Alonso
22d5acd207 Fix logic around comparison 2025-01-23 11:55:21 -08:00
Alejandro Alonso
d5b131a436 Add Comparable conformance to WordPair 2025-01-23 10:08:52 -08:00
Karoy Lorentey
d52ed4c602 [doc] Atomic.add, .subtract: Add note on codegen 2025-01-21 15:58:32 -08:00
Meghana Gupta
20eff53585 Revert "Make Atomic.deinit @_transparent"
This reverts commit dd037f896f.

@_transparent on deinit was diagnosed as an error in older compilers

Making Atomic.deinit @_transparent will break compiling newer sdk with older compilers

Fixes rdar://139194948
2024-11-05 14:58:04 -08:00
Meghana Gupta
dd037f896f Make Atomic.deinit @_transparent 2024-10-31 13:42:34 -07:00
Meghana Gupta
02a58738a0 Remove -enable-ossa-module for Synchronization and Distributed
These modules import Darwin which is not in ossa. -enable-ossa-modules
results in a one-time recompilation of dependencies when they are not in ossa.
This is not compatible with Explicit Build Modules when the original invocation
did not have -enable-ossa-modules.
2024-10-31 10:55:35 -07:00
Doug Gregor
8378562e12 Adopt @unsafe throughout the standard library
Annotate all of the `Unsafe*` types and `unsafe` functions in the standard
library (including concurrency, synchronization, etc.) as `@unsafe`. Add a
few tests to ensure that we detect uses of these types in clients that
have disabled unsafe code.
2024-08-19 14:33:09 -07:00
Evan Wilde
cae88d3344 Fix add_swift_target_library for the static SDK
add_swift_target_library was missing pieces for passing sources and
flags to the static SDK build. As a result, the static SDK was missing
pieces (specifically Mutex).

Also adding the Musl import to the Linux Mutex implementation.
2024-08-13 15:59:31 -07:00
Doug Gregor
ac0f574fdb Merge pull request #75127 from carlos4242/embedded-avr-cross-compile-stdlib
[AVR] standard library support for AVR
2024-07-17 22:17:42 -07:00
Alejandro Alonso
24a46c422b Merge pull request #74946 from Azoy/mutex-sending-inout
[stdlib] Adopt inout sending for Mutex
2024-07-17 10:56:57 -07:00
Carl Peto
3689427834 [AVR] standard library support for AVR
- when compiling embedded cross compile target standard libraries, include AVR
- add 16-bit pointer as a conditional compilation condition and get the void pointer size right for gyb sources
- attempt to fix clang importer not importing __swift_intptr_t correctly on 16 bit platforms
- changed the unit test target to avr-none-none-elf to match the cmake build

[AVR] got the standard library compiling in a somewhat restricted form:

General
- updated the Embedded Runtime
- tweaked CTypes.swift to fix clang import on 16 bit platforms

Strings
- as discussed in https://forums.swift.org/t/stringguts-stringobject-internals-how-to-layout-on-16-bit-platforms/73130, I went for just using the same basic layout in 16 bit as 32 bit but with 16 bit pointers/ints... the conversation is ongoing, I think something more efficient is possible but at least this compiles and will probably work (inefficiently)

Unicode
- the huge arrays of unicode stuff in UnicodeStubs would not compile, so I skipped it for AVR for now.

Synchronization
- disabled building the Synchronization library on AVR for now. It's arguable if it adds value on this platform anyway.
2024-07-16 12:28:27 +01:00
Allan Shortlidge
0ba007661a AST: Promote BuiltinAddressOfRawLayout to baseline. 2024-07-09 14:29:30 -07:00
Alexander Cyon
c21b1e68fd [stdlib] Fix typos 2024-07-06 13:09:57 +02:00
Alejandro Alonso
9cbf410220 Adopt inout sending for Mutex 2024-07-03 10:54:20 -07:00
Kuba Mracek
6eeef12849 [embedded] Add a embedded-libraries CMake target to simplify the test dependencies 2024-06-23 13:08:01 -07:00
Alejandro Alonso
49e8a73027 Adjust Synchronization module dependencies for macCatalyst 2024-06-12 23:55:51 -07:00
Alejandro Alonso
e3a53abe13 Don't use aarch64 hint for arm targets 2024-06-10 09:23:21 -07:00
Alejandro Alonso
b1ceb9b947 Update MutexUnavailable.swift (#74182)
Fixes the availability syntax for minimal platforms.
Resolves: rdar://129345303
2024-06-06 12:46:28 -07:00
Alejandro Alonso
4f8181dde6 Merge pull request #74143 from Azoy/mutex-minimal-thing
[stdlib] Condition Mutex.swift on platform
2024-06-06 07:54:36 -07:00
Yuta Saito
da6f015e3c Merge pull request #74171 from kateinoigakukun/yt/fix-mutex-wasm-test
[Synchronization] Fix wasm atomic intrinsic declarations
2024-06-06 16:58:32 +09:00
Alex Lorenz
bffb878476 Merge pull request #74160 from hyp/eng/fix-android-synchro
[android] Fix Synchronization Android build
2024-06-05 23:38:47 -07:00
Yuta Saito
2dbbbcf646 [Synchronization] Skip atomic operations in single-threaded mode on WebAssembly
Use of atomics instructions requires the support of threads proposal and
it's not widely supported yet. So we should enable actual atomic
operations only when targeting wasm32-uknown-wasip1-threads.
2024-06-06 04:18:13 +00:00
Yuta Saito
0536c9ac65 [Synchronization] Fix wasm atomic intrinsic declarations
Otherwise, isel will not be able to select the desired atomic
instructions.
2024-06-06 04:18:13 +00:00
Alex Lorenz
74d2a66a27 [androd] Fix Synchronization Android build
Add Android import for Mutex implementation
2024-06-05 16:58:05 -07:00
Alejandro Alonso
fcfbf068a5 Add a special file for mutex on unavailable platforms 2024-06-05 13:51:55 -07:00
Yuta Saito
3b1791a638 [Synchronization] Fix Wasm mutex build
This change fixes the following build error happening on Wasm:
```
error: referencing instance method '_wait(expected:)' on 'Atomic' requires the types '_MutexHandle.State' and 'UInt32' be equivalent
```
2024-06-05 17:15:43 +00:00
Alejandro Alonso
bc0e6ab392 Conditionalize Mutex.swift 2024-06-05 09:20:59 -07:00
Alejandro Alonso
cb3fc4b451 Adopt sending and movesAsLike 2024-06-04 09:49:21 -07:00
Alejandro Alonso
6b29e779e4 Support visionOS for Mutex 2024-06-04 09:06:37 -07:00
Alejandro Alonso
66ec7abd54 Underscore some things, add explicit internal
Fix some compile issues
2024-06-04 09:06:37 -07:00
Alejandro Alonso
fbfb218d11 Update LinuxImpl.swift 2024-06-04 09:06:37 -07:00
Alejandro Alonso
3a115fc290 Properly handle the syscalls on Linux and do some spins
fix some stuff
2024-06-04 09:06:37 -07:00
Alejandro Alonso
9b389a3df5 Fix tests and toolchain build 2024-06-04 09:06:37 -07:00