Commit Graph

5 Commits

Author SHA1 Message Date
Kuba Mracek
971ad79f37 [embedded] Start building embedded support on Linux/ELF, expand archs of the embedded stdlib to cover common embedded targets 2023-11-17 21:30:12 -08:00
Kuba Mracek
f1aba675ef [embedded] Mark all embedded tests as REQUIRES: swift_in_compiler 2023-11-07 10:01:03 -08:00
Kuba Mracek
a56a4875c2 [embedded] Make StaticString versions assert/precondition/fatalError available in embedded Swift 2023-09-20 09:35:34 -07:00
Kuba Mracek
a850aa1364 [embedded] Fix conditionals.swift/stdlib-basic.swift test failures on Linux 2023-09-17 08:27:25 -07:00
Kuba Mracek
ae2e903574 [embedded] Build an initial embedded Swift standard library
This isn't a "complete" port of the standard library for embedded Swift, but
something that should serve as a starting point for further iterations on the
stdlib.

- General CMake logic for building a library as ".swiftmodule only" (ONLY_SWIFTMODULE).
- CMake logic in stdlib/public/core/CMakeLists.txt to start building the embedded stdlib for a handful of hardcoded target triples.
- Lots of annotations throughout the standard library to make types, functions, protocols unavailable in embedded Swift (@_unavailableInEmbedded).
- Mainly this is about stdlib functionality that relies on existentials, type erasure, metatypes, reflection, string interpolations.
- We rely on function body removal of unavailable functions to eliminate the actual problematic SIL code (existentials).
- Many .swift files are not included in the compilation of embedded stdlib at all, to simplify the scope of the annotations.
- EmbeddedStubs.swift is used to stub out (as unavailable and fatalError'd) the missing functionality.
2023-09-16 12:38:46 -07:00