Commit Graph

309 Commits

Author SHA1 Message Date
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
Saleem Abdulrasool
5863b1a65f Runtimes: split up C++ and Swift specific flags (NFC)
This splits up the flags and re-orders some of the condition for the
application. Because the flags are now categorised by the language
promote the other half of the condition to the front.
2025-01-08 15:35:22 -08:00
Saleem Abdulrasool
168aa833f6 Runtimes: simplify target_compile_definitions call
The swiftRuntime library is a C++/ObjC++ library. There is no need to
check the compile language for the additional flags allowing us to
simplify the call.
2025-01-08 15:19:21 -08:00
Saleem Abdulrasool
358be09832 stdlib,Runtimes: begin preparing for a static stdlib on Windows
When building the standard library statically on Windows, we should not
use any __declspec(dllimport) or __declspec(dllexport) on the runtime
functions or data. Furthermore, we should internalise all of the
standard library functions so that they are not re-exported if used to
build a shared library. The code generation changes required for this
are easier to identify once a static SDK is available for Windows.
2025-01-08 15:08:14 -08:00
Saleem Abdulrasool
654577bb36 Runtimes: correct generator expression language spelling
This corrects the compile language check in the generator expression to
add the missing `X`.
2025-01-08 15:04:30 -08:00
Eric Miotto
b2225b2625 Merge pull request #78490 from edymtt/edymtt/set-swift-inline-namespace-for-core
[CMake] Use separate namespace for demangling symbols used by runtime
2025-01-08 13:45:59 -08:00
Eric Miotto
550ac9ff32 Merge pull request #78478 from edymtt/edymtt/sense-type-printing-for-runtime-as-well
[CMake] Sense `SwiftCore_ENABLE_TYPE_PRINTING` in `swiftRuntime` build
2025-01-08 12:55:27 -08:00
Evan Wilde
979599d33c Merge pull request #78483 from etcwilde/ewilde/stdlib-rebuild-has-locale
CMake: SwiftCore: Add Locale macro
2025-01-08 11:34:14 -08:00
Eric Miotto
d546222f57 [CMake] Use separate namespace for demangling symbols used by runtime
This matches the behavior introduced with #30733 -- quoting the
explanation here for the sake of convenience:

> Since libDemangling is included in the Swift standard library,
> ODR violations can occur on platforms that allow statically
> linking stdlib if Swift code is linked with other compiler
> libraries that also transitively pull in libDemangling, and if
> the stdlib version and compiler version do not match exactly
> (even down to commit drift between releases). This lets the
> runtime conditionally segregate its copies of the libDemangling
> symbols from those in the compiler using an inline namespace
> without affecting usage throughout source.

Addresses rdar://142550635
2025-01-08 09:28:46 -08:00
Evan Wilde
51b3ffdab1 Merge pull request #78453 from etcwilde/ewilde/stdlib-rebuild-has-filesystem
[cmake] Hook up `SWIFT_STDLIB_HAS_FILESYSTEM` macro
2025-01-08 09:17:20 -08:00
Eric Miotto
9ae13cdf7e [CMake] Sense SwiftCore_ENABLE_TYPE_PRINTING in swiftRuntime build
This is needed to build appropriately `Casting.cpp` and `Demangle.cpp`.

Addresses rdar://142499037
2025-01-08 07:31:19 -08:00
Evan Wilde
d7d85bb4b4 Merge pull request #78455 from etcwilde/ewilde/stdlib-rebuild-has-asl
CMake: SwiftCore: `SWIFT_STDLIB_HAS_ASL`
2025-01-07 15:49:59 -08:00
Evan Wilde
37223c8562 CMake: SwiftCore: Add Locale macro
Add locale support to new build system. The locale support depends on
finding the `clocale` C++ header.
2025-01-07 15:44:51 -08:00
Evan Wilde
aed70b37cd SwiftCore: CMake: Update Apple caches
Updating the Apple cmake caches to enable the filesystem support,
setting the appropriate architecture and platform subdirectories.
2025-01-07 09:24:15 -08:00
Evan Wilde
47abc583ab SwiftCore: CMake: Hook up filesystem flag
This hooks up the SWIFT_STDLIB_HAS_FILESYSTEM, which then requires
setting SWIFT_ARCH and SWIFT_LIB_SUBDIR macros for the backtracer.

Note: `FILESYSTEM` in this case does not refer to the C++ filesystem
header, but whether the platform you're building for has a filesystem.
2025-01-07 09:24:15 -08:00
Saleem Abdulrasool
131e504c16 Merge pull request #78448 from compnerd/library
Runtimes: merge `target_link_libraries` (NFC)
2025-01-07 08:11:13 -08:00
Evan Wilde
db5ed99b8a CMake: SwiftCore: SWIFT_STDLIB_HAS_ASL
Hooking up the `SWIFT_STDLIB_HAS_ASL` build macro.

rdar://142440689
2025-01-06 18:36:34 -08:00
Evan Wilde
76fb3c5316 Merge pull request #78430 from etcwilde/ewilde/stdlib-rebuild-dlsym-dladdr
CMake: Set SWIFT_STDLIB_HAS_DLADDR/DLSYM
2025-01-06 15:13:21 -08:00
Saleem Abdulrasool
cec890dcdc Runtimes: merge target_link_libraries (NFC)
This simply merges two calls to `target_link_libraries` into a single
call as both are using the same visibility.
2025-01-06 14:23:15 -08:00
Evan Wilde
84a1c12fb8 CMake: Set SWIFT_STDLIB_HAS_DLADDR/DLSYM
Parts of the runtime depend on DLADDR/DLSYM. Use CMake to determine if
these functions are available and then define the
`SWIFT_STDLIB_HAS_DLADDR`/`SWIFT_STDLIB_HAS_DLSYM` when the function is
available.

`SWIFT_STDLIB_HAS_DLADDR` is used in several source files in the runtime
library. `SWIFT_STDLIB_HAS_DLSYM` only appears to be used in
`ThreadSanitizer.cpp`.
2025-01-03 16:45:15 -08:00
Saleem Abdulrasool
be2f931863 Runtimes: disable ObjC interop if not enabled
Disable the objc interop support explicitly if objc interop is disabled
in the toolchain build.
2025-01-02 15:55:45 -08:00
Justice Adams
18d60685d4 remove conflicting default option (#78323) 2024-12-20 14:14:18 -08:00
Henrik G. Olsson
ef9d2b744d Rename pointer bounds (#78210)
* Make pointer bounds non-experimental

* Rename @PointerBounds to @_SwiftifyImport

* Rename filenames containing PointerBounds

* Add _PointerParam exception to stdlib ABI test

* Add _PointerParam to stdlib API changes

* Rename _PointerParam to _SwiftifyInfo
2024-12-20 11:36:01 +01:00
Justice Adams
31b6aee3b8 include Span files (#78295) 2024-12-19 13:05:34 -08:00
Justice Adams
4666a418e0 [CMAKE] Add Plist creation to swiftCore (#77960)
* update Resync to copy plist template

* include Plist in linked library for Darwin platforms

* only embedd plist on apple platforms

* formatting fix
2024-12-17 15:49:54 -08:00
Evan Wilde
0a9ab413a0 Merge pull request #78175 from etcwilde/ewilde/stdlib-rebuild-swiftcore-vendor-extension
[CMake] Add build-system vendor hook for swiftCore
2024-12-16 09:56:07 -08:00
Saleem Abdulrasool
7aed593047 Merge pull request #78159 from compnerd/user
runtime: add missing linked library
2024-12-16 08:10:10 -08:00
Saleem Abdulrasool
f68fed2562 Merge pull request #78179 from compnerd/unregistered
runtime: avoid the toolchain Swift registrar
2024-12-16 08:09:17 -08:00
Saleem Abdulrasool
36288e11d2 Merge pull request #78143 from compnerd/cas
Core: check for `-mcx16` flag
2024-12-15 21:14:31 -08:00
Saleem Abdulrasool
74b235eafd Merge pull request #78158 from compnerd/across-the-aisle
Runtimes: Threading requires "compiler" headers
2024-12-13 15:23:00 -08:00
Justice Adams
c5d47f5d2a add option for enabling short mangling lookups (#78122) 2024-12-13 14:47:35 -08:00
Justice Adams
cf307da872 [cmake] add -headerpad_max_install_names when building dylibs (#78121)
* add -headerpad_max_install_names when building dylibs

* fix formatting of link options
2024-12-13 14:47:22 -08:00
Saleem Abdulrasool
a4d894264c runtime: add missing linked library for Windows
The runtime uses functions from User32 and needs to link against it to
fulfill that dependency.
2024-12-13 14:05:18 -08:00
Saleem Abdulrasool
f4851a9ac6 runtime: adjust the style for target_link_libraries
Using a single library per line model allows for an easier time to
adjust the list as well as reduces the diff between revisions.
2024-12-13 14:05:18 -08:00
Saleem Abdulrasool
cc27fd0c98 Core: check for -mcx16 flag
The Swift runtime requires the CMPXCHG16B ISA extension on x86. This is
controlled by the `-mcx16` flag when targeting the CPU baseline that we
use. Add a check and pass along the flag to repair the build.
2024-12-13 13:59:41 -08:00