197 Commits
Author SHA1 Message Date
Karoy Lorentey cd142fd2f6 Merge pull request #106 from lorentey/release-cleanup
Not so minor prerelease fixups/changes
1.2.0
2023-09-27 18:26:29 -07:00
Karoy Lorentey 3431b8543f Fix CMake configuration 2023-09-27 16:12:25 -07:00
Karoy Lorentey 02d0d97948 [Xcode] Formally update .xcodeproj to Xcode 15
Also, remove an orphaned package manifest link.
2023-09-27 15:26:46 -07:00
Karoy Lorentey 084814f56f [Xcode] Move code sign config to shared xcconfig
This makes these settings automatically apply to the test target, too.
2023-09-27 15:01:41 -07:00
Karoy Lorentey f26da16e6e On 5.9, hide the _AtomicsShims import from the public interface
This appears to resolve a build failure when library evolution is enabled. (This isn’t a fully supported configuration (this package is not ABI stable), but it should still be possible to build the package in that configuration.)

@_implementationOnly has bad failure modes when library evolution isn’t enabled, but I hope we’ll be avoiding those here, as on 5.9+, we’re only using it to import a couple of functions — we aren’t relying on imported things to set struct layouts or anything like that. 🤞
2023-09-27 14:46:50 -07:00
Karoy Lorentey fe0fc8b76c Avoid confusing Swift 5.7 with _pointerBitWidth conditionals
#if conditional parsing is evidently broken in 5.7, and it gets confused unless things are arranged just right. Things seem to work as long as the `compiler(>=5.9)` conditional is put on its own `#if` construct on the topmost level — so let’s do that for now.
2023-09-27 14:19:36 -07:00
Karoy Lorentey 48fad5a291 Let builtins & shims expose different primitive signatures
For builtins, we want to emulate the stdlib’s solution where all atomic primitive operations take and return a (sort of) opaque atomic representation value.

For C shims, we do not want to atomic primitives to take and return _Atomic(T) values, so let’s revert to the original 1.1.x solution.
2023-09-25 21:05:53 -07:00
Karoy Lorentey d976dd29ad Protect _pointerBitWidth conditionals from misparsing on older Swifts 2023-09-25 19:42:22 -07:00
Karoy Lorentey 8189a83f1c [DocC] Fix some missing items 2023-09-22 17:04:54 -07:00
Karoy Lorentey 1abcb9584a [test] Don’t report failures when weakCompareExchange to spuriously fails 2023-09-22 16:51:43 -07:00
Karoy Lorentey 5b1941e84e Update README 2023-09-22 16:48:37 -07:00
Karoy Lorentey 4a34c7a38f [Xcode] Add “iOS Developer” as code sign identity for iOS/watchOS/tvOS 2023-09-22 16:11:20 -07:00
Karoy Lorentey de979cde5c [Utilities/run-full-tests.sh] Fix label of tvOS Xcodeproj build 2023-09-22 16:10:46 -07:00
Karoy Lorentey d8a523950d Merge pull request #103 from lorentey/drop-swift-5.6
Drop support for Swift 5.6
2023-09-22 11:27:02 -07:00
Karoy Lorentey 8650506425 Merge pull request #105 from lorentey/update-cmake
[CMake] Do not list .gyb files as sources
2023-09-22 11:26:32 -07:00
Karoy Lorentey 6ed54fa0d3 [CMake] Do not list .gyb files as sources 2023-09-22 11:24:11 -07:00
Karoy Lorentey 8be2ba9c43 Drop support for Swift 5.6
Clients who cannot upgrade their toolchain yet will continue to work with Swift Atomics 1.1.

List of currently supported Swift releases:

- Swift 5.9 release series
- Swift 5.8 release series
- Swift 5.7 release series

We also aim to support building and using swift-atomics on developer snapshots of Swift’s active branches (release/5.10 and main).
2023-09-22 11:17:05 -07:00
Karoy Lorentey 8e18576d70 Merge pull request #102 from lorentey/fix-alignment-issues
Fix alignment issues with double-wide atomics on i386
2023-09-22 11:16:16 -07:00
Karoy Lorentey f10f0313d2 Add back-compat manifests to Xcode/Atomics.xcodeproj 2023-09-22 00:46:04 -07:00
Karoy Lorentey a9219a8df8 Avoid accidentally enabling C shims within the test target 2023-09-22 00:46:02 -07:00
Karoy Lorentey 8dd81aef5c Update exclusion lists in package manifests 2023-09-22 00:42:25 -07:00
Karoy Lorentey 8b703fe93c [native atomics] Fix alignment issues by reintroducing custom storage types
The SysV ABI defined uint64_t with 4 byte alignment on i386 — so we can’t just assume that the integer types will have the right alignment by default for atomics.

Emulate the original `_Atomic<Width>Storage` types in the C shims even in native atomics configuration, so that they can carry a custom `@_alignment` attribute.
2023-09-22 00:41:51 -07:00
Karoy Lorentey bb83f8487b Merge pull request #101 from lorentey/reorg
Reorganize sources for future work
2023-09-21 17:35:09 -07:00
Karoy Lorentey 9351ce080d DoubleWord.AtomicRepresentation: Use DoubleWord storage on all platforms
We used to use Int64 on 32-bit architectures, but the inconsistency is bothering me. (Even ignoring alignment issues on SysV-derived ABIs on i386.)
2023-09-20 19:27:45 -07:00
Karoy Lorentey 9db6c56d8d Update CMake and Xcode build configs 2023-09-20 19:08:41 -07:00
Karoy Lorentey 4166cff711 Move definition of DoubleWord into DoubleWord.swift 2023-09-20 18:49:02 -07:00
Karoy Lorentey b1b74cb512 Reorganize source folder 2023-09-20 18:39:37 -07:00
Karoy Lorentey c39a7eff8d De-gyb HighLevelTypes.swift and AtomicLazyReference.swift 2023-09-20 18:34:02 -07:00
Karoy Lorentey 1f6a86f726 Start using _pointerBitWidth in 5.9+ 2023-09-18 16:08:16 -07:00
Karoy Lorentey d75ef1b060 [NFC] Move protocol AtomicStorage into its own source file 2023-09-18 16:05:17 -07:00
Konrad `ktoso` Malawski b47c8b1a6d Merge pull request #100 from apple/wip-avoid-symlinks 2023-09-14 14:29:53 +09:00
Konrad `ktoso` Malawski b6c32c13cd Avoid using symlinks for package files
Resolves https://github.com/apple/swift-atomics/issues/98
2023-09-14 13:24:56 +09:00
Karoy Lorentey 38a8ccdf78 Merge pull request #97 from lorentey/autolink-libswiftCore
[_AtomicShims] On Darwin, ensure we link against libswiftCore using assembly shenanigans
2023-08-14 17:00:39 -07:00
Karoy Lorentey 5603f612d2 [_AtomicShims] Don’t try to extend the library path using .linker_option
This emits a warning and it seems to be unnecessary.
2023-08-14 15:58:00 -07:00
Karoy Lorentey 673864b809 [_AtomicShims] On Darwin, ensure we link against libswiftCore using assembly shenanigans
This avoids a linker failure when the build system decides to build this module as a standalone library.

Hopefully this will all go away soon, when swift_retain_n/swift_release_n will become primitives exposed by the stdlib.
2023-08-11 15:39:22 -07:00
Karoy Lorentey 2ff28f8732 Merge pull request #93 from lorentey/fix-old-manifests
Fix version-specific manifest for 5.6..<5.9
2023-07-18 17:43:22 -07:00
Karoy Lorentey 5f7709d5d0 Fix version-specific manifest for 5.6..<5.9 2023-07-18 14:57:15 -07:00
Karoy Lorentey b37e0a6e7b Merge pull request #91 from lorentey/regenerate-sources
Regenerate sources
2023-07-10 12:42:39 -07:00
Karoy Lorentey 41382923ad Regenerate sources 2023-07-10 12:34:34 -07:00
Karoy Lorentey 1c2c004dd0 Merge pull request #90 from lorentey/fix-c++-interop
Avoid C atomic operations in Swift 5.9+
2023-07-10 12:33:23 -07:00
Karoy Lorentey 6d3d340c96 Merge pull request #89 from rolson/patch-1
Fix reference doc variable references
2023-07-10 12:32:57 -07:00
Karoy Lorentey 1698b26243 Don’t import Builtin unless we actually need it 2023-07-07 19:35:10 -07:00
Karoy Lorentey 9b97b055b6 Update Xcode project configuration
Switch from the classic `-parse-stdlib` option to the new `BuiltinModule` experimental feature.
2023-07-07 18:57:24 -07:00
Karoy Lorentey ca9d5816a6 Adjust ATOMICS_NATIVE_BUILTINS imports to adapt to the BuiltinModule mechanism 2023-07-07 18:52:13 -07:00
Karoy Lorentey ae2e46a01b In Swift 5.9 and later, unconditionally switch to using native builtins 2023-07-07 18:26:16 -07:00
Karoy Lorentey 15824c718b [_AtomicsShims] Don’t define atomic operations when this header is compiled as C++
`_Atomic(_sa_dword)` trips up C++. This is likely due to real issues, but it seems pointless to try to fix it — rather than heroically trying to keep this header working, we can simply force the use of native builtins on Swift 5.9 and later. (I planned to do that anyway, as a major step towards deleting `_AtomicsShims` altogether.)
2023-07-07 18:21:46 -07:00
R Olson cbd73b1967 Update AtomicLazyReference.swift.gyb
Fix reference doc variable references
2023-07-06 16:16:42 -06:00
Karoy Lorentey 8bdc853bea Merge pull request #87 from lorentey/fix-header-in-xcodeproj
[Xcode] Don’t use a bridging header in a framework target
2023-06-20 10:54:07 -07:00
Karoy Lorentey 55a158b620 [Xcode] Don’t use a bridging header in a framework target
Oops, that was not intended to work, and in fact it produces warnings in clients.

Instead, change _sa_retain_n and _sa_release_n to Swift calling convention and call them using _silgen_name trickery when in single-module configuration.

Resolves rdar://110860922
2023-06-20 10:52:41 -07:00
Karoy Lorentey b32aa0576d Merge pull request #85 from lorentey/fix-code-signing
[Xcode] Set a code sign identity
2023-05-18 18:59:31 -07:00