Commit Graph

14 Commits

Author SHA1 Message Date
Alexis Laferrière
0c27a4c38c SwiftShims: memcmp should accept optional pointers on Darwin
Darwin defines memcmp with optional pointers. Update SwiftShims to
define it to the same type to avoid deserialization failures where we
get one over the other and the types don't match anymore.

rdar://140596571
2024-12-04 14:58:32 -08:00
Ian Anderson
07a639ca9c [Shims] Don't redeclare lgamma_r in macOS 15.0 and associated SDKs
macOS 15.0, iOS 18.0, et al has started unconditionally declaring `lgamma_r` in <math.h>, add a __has_include in SwiftShims to detect that and not redeclare it when building against those SDK versions.

rdar://115192929
2024-08-16 09:00:09 -07:00
Alastair Houghton
5e24abc970 [Shims] Fix nullability for musl.
Apparently I got the merge for this slightly wrong.

rdar://128388845
2024-05-20 12:18:59 +01:00
Alastair Houghton
0fa5e65bb2 [Stdlib][Build] Fix the standard library build for fully static Linux.
Mostly this just means adding `Musl` as a module dependency of various
things and making sure that we build things for `swift_static` even
if `SWIFT_BUILD_STATIC_STDLIB` isn't enabled.

There's also a slight difference in the declaration of `memcmp()`;
musl's declaration is more like the one we have on Darwin.

rdar://123508245
2024-05-07 16:56:20 +01:00
Saleem Abdulrasool
ac4123b7b9 shims: adjust declaration for android NDK
Mark the nullability to repair the build against NDK r26b.
2024-03-14 15:47:00 -07:00
finagolfin
10ad6f35f7 [android] Update memcmp() declaration for nullability annotations added in NDK 26 (#71968) 2024-02-29 15:31:12 -08:00
Joe Groff
ce0a04393c Revert "Switch to malloc_good_size instead of malloc_size (#70532)"
This reverts commit 0843891eb9.
2024-02-21 10:26:37 -08:00
David Smith
0843891eb9 Switch to malloc_good_size instead of malloc_size (#70532)
Switch to malloc_good_size instead of malloc_size
2024-01-27 19:20:33 -08:00
Kuba Mracek
d579c62fee [embedded] Resolve empty -sdk path warning in embedded stdlib build, take 3 2023-10-02 17:55:02 -07:00
Kuba Mracek
268a1e3556 Revert "[embedded] Resolve empty -sdk path warning in embedded stdlib build, take 2"
This reverts commit a1a48b5c83.
2023-10-02 09:35:21 -07:00
Kuba Mracek
a1a48b5c83 [embedded] Resolve empty -sdk path warning in embedded stdlib build, take 2 2023-09-28 09:17:32 -07:00
Kuba Mracek
1d24e0b343 [embedded] Fix a warning in LibcShims.h about missing nullability annotations 2023-09-26 16:23:50 -07:00
Kuba Mracek
0758e7da85 [embedded] Use posix_memalign from shims instead of manual declaration 2023-09-25 19:51:19 -07:00
Egor Zhdan
84a1ffcb33 [Shims] Include SwiftShims headers without ../
This replaces a number of `#include`-s like this:
```
#include "../../../stdlib/public/SwiftShims/Visibility.h"
```
with this:
```
#include "swift/shims/Visibility.h"
```

This is needed to allow SwiftCompilerSources to use C++ headers which include SwiftShims headers. Currently trying to do that results in errors:
```
swift/swift/include/swift/Demangling/../../../stdlib/public/SwiftShims/module.modulemap:1:8: error: redefinition of module 'SwiftShims'
module SwiftShims {
       ^
Builds.noindex/swift/swift/bootstrapping0/lib/swift/shims/module.modulemap:1:8: note: previously defined here
module SwiftShims {
       ^
```
This happens because the headers in both the source dir and the build dir refer to SwiftShims headers by relative path, and both the source root and the build root contain SwiftShims headers (which are equivalent, but since they are located in different dirs, Clang treats them as different modules).
2022-09-14 11:14:50 +01:00