Commit Graph

240 Commits

Author SHA1 Message Date
Saleem Abdulrasool
a759ead034 Merge pull request #79336 from compnerd/build-number
Runtimes: attempt to wire in the build number into the version
2025-02-13 16:19:17 -08:00
Eric Miotto
f8bba964cf Merge pull request #78726 from edymtt/edymtt/add-ononesupport-to-runtimes
Runtimes: introduce `SwiftOnoneSupport`
2025-02-13 13:53:39 -08:00
Saleem Abdulrasool
509c385458 Runtimes: attempt to embed a SxS manifest for swiftCore
This will allow us to have multiple parallel installations of swiftCore
with the same DLL name allowing us to side-step the ABI instability
without resorting to SOVERSIONing.
2025-02-12 21:59:47 -08:00
Saleem Abdulrasool
6e87083107 Runtimes: attempt to wire in the build number into the version
This is in preparation for using Win32 SxS assembly manifests to permit
co-installation of the runtimes on Windows without an ABI consideration
and allow users to select between the revision.
2025-02-12 14:24:41 -08:00
Guillaume Lessard
c7af9a701b Merge pull request #79294 from Azoy/bye-bye-slab
[stdlib] Rename Slab to InlineArray
2025-02-12 12:03:25 -08:00
Eric Miotto
734c115509 Remove bleeding whitespace from Runtimes/Core/SwiftOnoneSupport/CMakeLists.txt
Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
2025-02-12 08:54:20 -08:00
Eric Miotto
eb7706ded9 Merge pull request #79266 from edymtt/edymtt/rearrange-core-flags
Runtimes: rearrange flags to match the current stdlib
2025-02-11 13:02:58 -08:00
Alejandro Alonso
e4fb1f6761 Rename Slab to InlineArray 2025-02-11 10:26:44 -08:00
Saleem Abdulrasool
8733205cd5 Merge pull request #79269 from compnerd/closed
Runtimes: use the static module constructor in swiftCore
2025-02-10 14:23:25 -08:00
Saleem Abdulrasool
41b043ecfe Merge pull request #79227 from compnerd/implicit-explicit
Runtimes: remove the explicit linking in the build system
2025-02-10 13:09:55 -08:00
Eric Miotto
66d4665801 Runtimes: hoist more flags from swiftCore to all Core libraries
Addresses rdar://143152066
2025-02-10 13:06:44 -08:00
Eric Miotto
7924cc1a77 Runtimes: use -enable-experimental-concise-pound-file only for Core.
As per #32700, this is only meant for `Swift.swiftinterface`.

Addresses rdar://143152066
2025-02-10 13:06:44 -08:00
Eric Miotto
ba5ccc4516 Runtimes: generate optimization record on Darwin
Addresses rdar://143152066
2025-02-10 13:06:33 -08:00
Saleem Abdulrasool
db4fd6dbee Runtimes: use the static module constructor in swiftCore
Use the static module constructor for swiftCore on Windows as the
runtime functions are internal to the module. This fixes the last linker
warning that we see with the standard library build when building
dynamically. More importantly, this allows building swiftCore as a DLL
with the new build system on Windows as we now treat any linker warnings
as errors.
2025-02-10 09:28:00 -08:00
Saleem Abdulrasool
1098951cea Merge pull request #79231 from compnerd/swifrtT
runtime: add `swiftrtT.obj` build
2025-02-10 09:21:20 -08:00
Eric Miotto
a3fac71446 Merge pull request #79188 from edymtt/edymtt/apply-prespecialize-generic-metadata-to-all-of-core
Runtimes: support generic metadata prespecialization for all of Core
2025-02-10 07:11:26 -08:00
Saleem Abdulrasool
5bb4978b1a runtime: add swiftrtT.obj build
This introduces the new variant of the `swiftrt.obj` - `swiftrtT.obj`
for Windows. This follows the C standard library naming convention as
set forth by GCC.

`crtbegin.o` => used to find constructors
`crtbeginS.o` => used to find constructors in DSOs/PIEs
`crtbeginT.o` => used to find constructors in static executables

The newly minted `swiftrtT.obj` is meant for static linking. The one
exception to this is building the swift runtime itself which locally
defines the symbols and thus should always use the static variant.
2025-02-07 15:29:28 -08:00
Saleem Abdulrasool
c18d6bb7d1 Runtimes: remove the explicit linking in the build system
These libraries are now implicitly explicitly linked. The source files
include `#pragma comment(lib, ...)` to include the autolink directives
to properly handle the dependency propagation to ensure static linking
is sufficiently closed.
2025-02-07 14:14:39 -08:00
Eric Miotto
2a367234be Runtimes: support generic metadata prespecialization for all of Core
Also provide a flag to enabled/disable it.

Addresses rdar://144255917
2025-02-07 07:39:21 -08:00
Saleem Abdulrasool
dca10cf31b Runtimes: adjust the specified version number
Use a full 3-component version specifier as that is required for some
support on Windows. The version number components will be used to
generate the Win32 SxS manifest for embedding within the DLL.
2025-02-06 12:10:29 -08:00
Eric Miotto
c1257eb4ef Runtimes: introduce SwiftOnoneSupport
The main goal for now is to have this building, with little
concern about matching the build flags used currently.

Keep it disabled by default on Apple platforms.

Addresses rdar://143151393
2025-02-03 11:34:51 -08:00
Evan Wilde
e17df88cc1 Merge pull request #78963 from etcwilde/ewilde/stdlib-rebuild-extra-malloc-type
CMake: Define DARWIN_LIBMALLOC
2025-01-28 09:17:31 -08:00
Alastair Houghton
96f23e34b0 [Build] Update SWIFT_TARGET_LIBRARY_NAME for swiftRuntime in new build. (#78977)
We need to change `SWIFT_TARGET_LIBRARY_NAME` for the `swiftRuntime`
target in the new build because of changes made to the old build system.
2025-01-28 09:12:36 -08:00
Alastair Houghton
ab8e561583 Merge pull request #78516 from al45tair/eng/PR-124913332
[Backtracing] Implement API per SE-0419
2025-01-28 10:48:33 +00:00
Evan Wilde
3b4dee5cb6 CMake: Define DARWIN_LIBMALLOC
`SWIFT_STDLIB_HAS_MALLOC_TYPE` is defined in terms of
`SWIFT_STDLIB_HAS_DARWIN_LIBMALLOC` in `include/swift/Runtime/Config.h`.
Apple platforms generally have the Darwin libmalloc, so it should be a
safe bet to define it this way. Unfortunately, a lot of things include
the Config.h file, transitively or otherwise, so figuring out exactly
which libraries should have this defined vs ones that should not is
rather tricky, so for now, I've defined it globally.
2025-01-27 15:57:21 -08:00
Saleem Abdulrasool
bf00d8d901 Runtimes: treat linker warnings as errors
We were previously silently emitting incorrect code for the standard
libraries and the warnings were being swallowed by the build system.
This was brought to light by the new build system. The code generation
issues have been addressed. In order to prevent a backslide, we would
ideally use `/WX:4217 /WX:4286`. Unfortunately, `clang-cl` does not
support this, so compromise and use `/WX` which treats all linker
warnings as errors.
2025-01-26 12:56:49 -08:00
Evan Wilde
95f4f6ff80 Merge pull request #78497 from etcwilde/ewilde/stdlib-rebuild-backtrace-reporting
CMake: SwiftCore: Add back SWIFT_STDLIB_SUPPORTS_BACKTRACE_REPORTING
2025-01-24 21:59:55 -08:00
Evan Wilde
066dc94786 Merge pull request #78860 from etcwilde/ewilde/stdlib-rebuild-platform-arch-dirs
CMake: Add install platform and architecture subdirs
2025-01-24 20:55:47 -08:00
Evan Wilde
5aadacee41 CMake: SwiftCore: Add back SWIFT_STDLIB_SUPPORTS_BACKTRACE_REPORTING
Add an option to enable emitting a stacktrace on calls to `fatalError`.
This is unrelated to the runtime backtracer for diagnosing normal Swift
crashes.

rdar://142440689
2025-01-23 12:42:28 -08:00
Evan Wilde
f2ddef7601 Merge pull request #78498 from etcwilde/ewilde/stdlib-rebuild-lazy-init-os-trace
CMake: SwiftCore: SWIFT_USE_OS_TRACE_LAZY_INIT
2025-01-23 12:35:18 -08:00
Evan Wilde
a9da4a5c1a CMake: Add install platform and architecture subdirs
In some configurations, libraries are installed under
`<install-prefix>/{libdir}/swift/<platform>/<arch>` and module content
is installed under `<install-prefix>/{libdir}/swift/<platform>`.

This also accounts for the fact that Swift currently looks under
`<install-prefix>/{libdir}/swift_static/**` for the static stdlib
builds.
2025-01-23 12:25:21 -08:00
Saleem Abdulrasool
74a8c588ee Merge pull request #78699 from compnerd/registration-is-closed
Runtimes: adjust installation of swifrt.{o,obj}
2025-01-23 10:06:06 -08:00
Saleem Abdulrasool
17177f8138 Merge pull request #78727 from compnerd/extraction-point
Runtimes: extract platform and arch from the driver
2025-01-23 08:17:26 -08:00
Justice Adams
d1d8cdd170 add SwiftifyImport.swift to source list (#78785) 2025-01-22 13:53:21 -08:00
Justice Adams
95219bb698 Set SwiftCore_ARCH_SUBDIR and SwiftCore_PLATFORM_SUBDIR as CACHE variables properly for Bridge and TVos (#78784) 2025-01-22 13:53:06 -08:00
Saleem Abdulrasool
c7ae8c9377 Apply suggestions from code review
Co-authored-by: Evan Wilde <etceterawilde@gmail.com>
2025-01-22 09:25:24 -08:00
Evan Wilde
d470565e2d CMake: SwiftCore: SWIFT_USE_OS_TRACE_LAZY_INIT
Adding the SWIFT_USE_OS_TRACE_LAZY_INIT macro to the new build system.

rdar://142440689
2025-01-21 13:49:38 -08:00
Saleem Abdulrasool
530378ae79 Runtimes: extract platform and arch from the driver
With swiftlang/swift#78717 we now can extract the platform and
architecture subdirectories required for deploying the files.
Restructure the code when adding this functionality to invoke the
command once and then extract the various fields that we need.
2025-01-17 15:47:13 -08:00
Alastair Houghton
dd84241d36 [Backtracing] CMake fixes.
Remove a `-disable-implicit-backtracing-module-import` that was added
in `Runtimes/Core/CMakeLists.txt`, and also remove the reference to
`swiftCxxStdlib` from `RuntimeModule` as that causes the build to fail
when attempting to build the static version of `swift-backtrace` on
Linux.

rdar://124913332
2025-01-17 14:31:16 +00:00
Saleem Abdulrasool
670da054ce Runtimes: complete SwiftShims module
Add the missing `ObjCShims.h` header to the installed header set.
Without this the module is incomplete. This was detected on Windows when
trying to build the SwiftShims module.
2025-01-16 16:59:38 -08:00
Saleem Abdulrasool
46112a992a Runtimes: adjust installation of swifrt.{o,obj}
Install the Swift registrar into the correct location for the SDK. This
file is to be placed into /usr/lib/swift/<platform>/<arch> with the name
`swiftrt.[o|obj]`.
2025-01-16 15:58:56 -08:00
Eric Miotto
0c33858e74 [CMake] Avoid using a couple flags when building MinSizeRel
This preserves the behaviour introduced in #33444.

Addresses rdar://142820419
2025-01-15 14:41:49 -08:00
Eric Miotto
5d194a925e [CMake] Update MinSizeRel configuration for Apple platforms...
...and use it as a default for one of them.

Addresses rdar://142820419
2025-01-15 14:14:54 -08:00
Evan Wilde
c92e1d7904 CMake: SwiftCore: Get Slabs building
This patch adds slabs to the new stdlib build system.
2025-01-13 13:27:58 -08:00
Eric Miotto
471d179bb5 Merge pull request #78520 from edymtt/edymtt/use-defaults-when-building-stdlib-in-release-with-debug-info-for-apple-platforms
[CMake stdlib] do not override flags for `RelWithDebInfo` when ...
2025-01-10 14:11:34 -08:00
Saleem Abdulrasool
ce3cc37e83 Merge pull request #78504 from compnerd/globals
Runtimes: adjust global flags in preparation for extending the Core project
2025-01-09 19:02:38 -08:00
Saleem Abdulrasool
f1b63b2e10 Merge pull request #78502 from compnerd/language
Runtimes: simplify `target_compile_definitions` call
2025-01-09 15:07:05 -08:00
Saleem Abdulrasool
cf4d825bde Merge pull request #78476 from compnerd/exportation
stdlib,Runtimes: begin preparing for a static stdlib on Windows
2025-01-09 11:22:38 -08:00
Eric Miotto
16205998fd [CMake stdlib] do not override flags for RelWithDebInfo when ...
...building the stdlib for Apple platforms.

For now we want to match the flags the existing configuration (which is
already accounted by the default values provided by CMake) -- in
particular the generation of full symbols and usage of whole module
optimization.

Addresses rdar://142620659
2025-01-09 09:00:02 -08:00
Saleem Abdulrasool
43487a35a9 Runtimes: extract and hoist "global" flags
These set of Swift flags are applied to all runtime libraries that are
built. Hoist them to the top-level to spell them once and to keep all
the libraries in sync.
2025-01-08 15:35:23 -08:00