Commit Graph

3150 Commits

Author SHA1 Message Date
Alejandro Alonso
8a5f728daf Merge pull request #40340 from Azoy/drop-icu
[stdlib] Drop ICU
2021-12-07 01:44:38 -08:00
Alejandro Alonso
6e0cf0e7be Add --enable-rpath to ICU's build
Remove ICU_DATA flags
2021-12-06 13:16:32 -08:00
Kuba (Brecka) Mracek
c705d2030c Merge pull request #40210 from kubamracek/only-include-target-conditionals-when-needed
Only #include <TargetConditionals.h> when present
2021-12-03 14:50:38 -08:00
Kuba (Brecka) Mracek
b20c135ba4 Merge pull request #40209 from kubamracek/ndebug-vs-assert
Add #ifndef NDEBUG around assert() calls that use helper functions/variables that are also under #ifndef NDEBUG
2021-12-03 14:46:29 -08:00
Alejandro Alonso
21ee3a5e0f Drop ICU
update freestanding deps
2021-11-30 13:53:08 -08:00
Kuba (Brecka) Mracek
dd93538e66 Drop an unused #include from ImageInspectionCommon.h (#40203) 2021-11-29 19:30:25 -08:00
Kuba Mracek
080d513c30 Only #include <TargetConditionals.h> when it's present 2021-11-26 18:53:34 -08:00
Mike Ash
cf3c131e7c [Reflection] Add API for inspecting async task allocation slabs.
We remove the existing `swift_reflection_iterateAsyncTaskAllocations` API that attempts to provide all necessary information about a tasks's allocations starting from the task. Instead, we split it into two pieces: `swift_reflection_asyncTaskSlabPointer` to get the first slab for a task, and `+swift_reflection_asyncTaskSlabAllocations` to get the allocations in a slab, and a pointer to the next slab.

We also add a dummy metadata pointer to the beginning of each slab. This allows tools to identify slab allocations on the heap without needing to locate every single async task object. They can then use `swift_reflection_asyncTaskSlabAllocations` on such allocations to find out about the contents.

rdar://82549631
2021-11-18 14:15:25 -05:00
Mike Ash
89d93a000d [Runtime] Replace std::max_align_t with MaximumAlignment from MetadataValues.h.
On Windows, std::max_align_t is only 8-byte aligned, but Swift assumes 16-byte alignment. MaximumAlignment is our notion of the maximum alignment of a type, so use that instead.
2021-11-18 13:56:05 -05:00
Saleem Abdulrasool
d104e12b79 Merge pull request #40236 from apple/revert-40071-remote-mirror-async-slab-inspection 2021-11-18 00:01:41 -08:00
buttaface
30c292ca87 [android] Update to NDK 23b (#39921)
The latest Long Term Support NDK finally removed binutils, including the bfd/gold
linkers and libgcc. This simplifies our Android support, including making lld the
default linker for Android. Disable three reflection tests that now fail, likely
related to issues with swift-reflection-dump and switching to lld.
2021-11-17 20:58:42 -08:00
Saleem Abdulrasool
3c9c564eba Revert "[Reflection] Add API for inspecting async task allocation slabs." 2021-11-17 18:47:13 -08:00
Mike Ash
1344da9d15 Merge pull request #40071 from mikeash/remote-mirror-async-slab-inspection
[Reflection] Add API for inspecting async task allocation slabs.
2021-11-17 17:36:56 -05:00
Kuba Mracek
5bbf15053d Add #ifndef NDEBUG around assert() calls that use helper functions/variables that are also under #ifndef NDEBUG 2021-11-16 15:00:23 -08:00
Kuba (Brecka) Mracek
3d08df9f3c Avoid including unistd.h and replace write(STDERR) with fputs(stderr) (#40177) 2021-11-15 18:41:49 -08:00
Mike Ash
9a2f449c04 Merge pull request #40139 from mikeash/metadataallocator-null-check
[Runtime] Add a NULL check to MetadataAllocator.
2021-11-15 13:39:10 -05:00
Kuba (Brecka) Mracek
7cd5e5b110 Remove a bunch of unused #include's from Metadata.cpp (#40178) 2021-11-14 15:13:32 -08:00
Kuba (Brecka) Mracek
2f7bbe6610 Don't include asl.h when SWIFT_STDLIB_HAS_ASL is not set (#40176) 2021-11-14 14:40:03 -08:00
Mike Ash
7c7dc5d5b3 [Reflection] Add API for inspecting async task allocation slabs.
We remove the existing `swift_reflection_iterateAsyncTaskAllocations` API that attempts to provide all necessary information about a tasks's allocations starting from the task. Instead, we split it into two pieces: `swift_reflection_asyncTaskSlabPointer` to get the first slab for a task, and `+swift_reflection_asyncTaskSlabAllocations` to get the allocations in a slab, and a pointer to the next slab.

We also add a dummy metadata pointer to the beginning of each slab. This allows tools to identify slab allocations on the heap without needing to locate every single async task object. They can then use `swift_reflection_asyncTaskSlabAllocations` on such allocations to find out about the contents.

rdar://82549631
2021-11-11 16:58:14 -05:00
Mike Ash
64f8bca351 [Runtime] Add a NULL check to MetadataAllocator.
MetadataAllocator should never return NULL, but bugs or corruption could potentially make that happen. On the large path, switch from malloc to swift_slowAlloc, which aborts on failure. On the pool path, check for a NULL allocation pointer, and log a bunch of information about the allocation request and the allocator's current state.

rdar://84503396
2021-11-11 12:16:54 -05:00
Alastair Houghton
e339feb2da [Runtime] Add format string attributes.
Added some attributes to mark functions as taking format strings.

rdar://84571859
2021-10-25 13:46:05 +01:00
Saleem Abdulrasool
15a5d2c54b Revert "[android] Update to NDK 23" 2021-10-16 11:07:23 -07:00
swift-ci
46f3cc9dd8 Merge pull request #39045 from buttaface/android-ndk-23 2021-10-15 20:55:19 -07:00
Kuba (Brecka) Mracek
99a24d47be Introduce a CMake flag to disable fast-path context descriptor lookup based on short manglings (#39729) 2021-10-14 08:08:07 -07:00
Kuba (Brecka) Mracek
5ff64f8443 Introduce a CMake option to disable MetadataAllocator and use malloc+free instead, use it for freestandning preset (#39678) 2021-10-12 16:20:08 -07:00
Kuba (Brecka) Mracek
c2c1bfb053 Add SWIFT_STDLIB_HAS_ENVIRON to remove usage of getenv/environ from stdlib (#39599) 2021-10-12 07:16:36 -07:00
Kuba (Brecka) Mracek
653642df75 Add a SWIFT_STDLIB_HAS_DARWIN_ASL config flag to allow removing asl_log() usage in freestanding build (#39584) 2021-10-12 07:14:33 -07:00
Max Desiatov
a94e9611ab runtime, WebAssembly: add ImageInspectionWasm.cpp (#39483)
This change adds a stub for `swift::lookupSymbol` for the WebAssembly platform.

Related to SR-9307.
2021-10-12 14:04:46 +01:00
Butta
7fa1b4b2ac [android] Update to NDK 23
The latest Long Term Support NDK finally removed binutils, including the bfd/gold
linkers and libgcc. This simplifies our Android support, including making lld the
default linker for Android. Disable three reflection tests that now fail, likely
related to issues with swift-reflection-dump and switching to lld.

Also, add the libatomic dependency for Android armv7, just as on linux.
2021-10-12 12:37:01 +05:30
Kuba (Brecka) Mracek
ca0dff803b Turn existing ifdefs around backtrace() API into a CMake SWIFT_SUPPORTS_BACKTRACE_REPORTING flag (#39598) 2021-10-06 14:46:08 -07:00
Kuba (Brecka) Mracek
c2a92722c6 Split the NO_DYLD CMake flag into separate HAS_DLADDR and STATIC_IMAGE_INSPECTION flags (#39339) 2021-09-29 19:57:05 -07:00
Alastair Houghton
8be084f30a Merge pull request #39187 from al45tair/problem/79725187
[Demangler] Improve remangler error handling
2021-09-27 17:03:49 +01:00
Kuba (Brecka) Mracek
de015c6464 Unify asprintf/vasprintf implementations and make them truly portable by using vsnprintf (#39314) 2021-09-15 21:09:03 -07:00
swift-ci
2e916a6678 Merge pull request #39285 from TotallyNotThomas/patch-1 2021-09-14 13:56:45 -07:00
Alejandro Alonso
7e0eaf7b99 Remove metadata section functions from the stdlib (#39236)
add aliases in test suite
2021-09-14 11:55:39 -07:00
Thomas
9ea48da9cc Shouldn't this be labeled as a C++ file? 2021-09-13 20:45:24 +01:00
Doug Gregor
7f2117690c Skip standard substitutions for _Concurrency types when back-deploying.
When back-deploying concurrency support, do not use the standard
substitutions for _Concurrency-defined types (such as `Task`) in type
metadata because older Swift runtimes will not be able to demangle
them. Instead, use the full mangled names so the runtime can still
demangle them appropriately.

Addresses rdar://82931890.
2021-09-09 13:23:19 -07:00
Kuba (Brecka) Mracek
404badb49a Introduce SWIFT_ENABLE_REFLECTION to turn on/off the support for Mirrors and reflection (#33617) 2021-09-08 13:08:13 -07:00
Kuba (Brecka) Mracek
b5b008f9b3 Replace strcpy -> strlcpy in swift_getTupleTypeMetadata (#39181) 2021-09-08 12:56:52 -07:00
Alastair Houghton
fbf082b6cb [Demangling] Make Demangle::getUnspecialized() return errors too.
This lets us completely remove the unreachable() function from Remangler.cpp.

rdar://79725187
2021-09-06 17:49:09 +01:00
Alastair Houghton
3f01f853a6 [Demangling] Add error handling to the remangler.
Mangling can fail, usually because the Node structure has been built
incorrectly or because something isn't supported with the old remangler.
We shouldn't just terminate the program when that happens, particularly
if it happens because someone has passed bad data to the demangler.

rdar://79725187
2021-09-06 17:49:09 +01:00
Argyrios Kyrtzidis
325d8b3c21 [Demangle.h] Remove the swift_demangle declaration from Demangle.h since it's not needed there
Also allows removing the "swift/Runtime/Config.h" include from that header.
2021-09-03 18:19:10 -07:00
Saleem Abdulrasool
cd7d105c6d runtime: remove workaround for Windows ARM64
If anyone else is building Windows ARM64 they should be using a new
enough Visual Studio.  This workaround is more difficult to keep working
properly and the CI hosts should have a new enough Visual Studio
installation hopefully in order to enable the ARM64 builds of the
runtime.  If they do not, we can re-evaluate whether to re-instate the
workaround.  This allows building part of the runtime with Visual Studio
2022 and reduces the maintenance overheads for the runtime.
2021-09-03 11:19:26 -07:00
Doug Gregor
d844d0b82b Merge pull request #39102 from DougGregor/back-deploy-standalone
Make the back-deployed concurrency dylibs depend only on what's available in older runtimes
2021-08-31 09:05:21 -07:00
Doug Gregor
6fd85ac7a3 Clone exclusivity save/restore for tasks into back-deployment library
The code that saves/restores the exclusivity checks for tasks was
newly introduced into the runtime. Clone that code into the back-
deployed version of the runtime.
2021-08-30 16:39:33 -07:00
Saleem Abdulrasool
0a292fdaf9 Differentiation: correct the storage annotation for runtime functions
The runtime support functions are currently vended by
swiftCore.{dll,dylib,so} rather than
swift_Differentiation.{dll,dylib,so}.  This corrects the annotations to
indicate that reality.  This never could have worked as declared in the
first place.  swift_Differentiation never links against swiftRuntime
and swiftCore effectively whole-archives swiftRuntime into itself.  This
change is now reflecting that reality.  If the desire is to move this
(even on Darwin, where this may have already shipped and thus would
break ABI), we could split up the swiftRuntime into swiftRuntime and
swiftDifferentiationRuntime and link that as we do with the runtime into
swiftCore.
2021-08-24 14:24:18 -07:00
Kuba (Brecka) Mracek
aaff37ffb8 Add a SWIFT_STDLIB_HAS_DARWIN_LIBMALLOC flag to allow/disallow uses of Darwin libmalloc APIs (malloc_default_zone, malloc_zone_malloc, etc.) (#33812) 2021-08-23 19:37:43 -07:00
Kuba (Brecka) Mracek
62e7139574 Disable bincompat checks in Bincompat.cpp when SWIFT_RUNTIME_OS_VERSIONING is off. (#39009) 2021-08-23 19:05:26 -07:00
Alastair Houghton
5b6f183d0e Merge pull request #38904 from al45tair/problem/37170485
[Tests] Re-add round-trip type test.
2021-08-17 23:11:42 +01:00
Alastair Houghton
cd99995d84 [Tests] Re-add round-trip type test.
This was reverted in 12fa024 because it broke the iOS simulator build.

rdar://37170485
2021-08-17 09:51:22 +01:00