Commit Graph

1741 Commits

Author SHA1 Message Date
Stefan Gränitz
53d0781937 fixup! Enable builtins for all runtime targets in CMake cache file 2024-12-03 17:19:15 +01:00
Saleem Abdulrasool
020d67330c build: enable libxml2 in the toolchain, use llvm-mt
Enable support for libxml2 on Windows to allow `llvm-mt` to be usable.
This then allows us to use `llvm-mt` as the manifest tool when building
for Windows. Remove the then obsoleted workaround of `-D CMAKE_MT=mt`.
This reduces the dependency on the MSVC toolchain and paves the path to
enabling the use of the manifest tool in SPM.
2024-12-02 17:05:20 -08:00
Mishal Shah
e1c5216c61 Merge pull request #77799 from swiftlang/bump-swift-version-6.2
Bump the Swift version to 6.2
2024-12-02 13:14:06 -08:00
3405691582
301a0c49fc Swift on OpenBSD supports arm64.
However, to do this, we end up changing how amd64 is supported too.
Previously, I had tried to keep some meaningful separation between
platform spelling and LLVM spelling, but this is becoming more difficult
to meaningfully maintain.

Target specifications are trivially converted LLVM triples, and the
module files are looked up by LLVM triples. We can make sure that the
targets align, but then the Glibc to SwiftGlibc import breaks. That could
also be addressed, but then we get to a point where the targets set up
by build-script and referenced by cmake begin to misalign. There are
references in build-script-impl for a potential renaming site, but it's
not quite enough.

It's far simpler to give up and rename to LLVM spellings right at the
beginning. This does mean that this commit is less constrained to just
adding the necessary parts to enable arm64, but it should mean less
headaches overall from differing architecture spellings.
2024-11-30 16:33:46 -05:00
Stefan Gränitz
cf748a9dd0 Exclude Anroid targets for the moment 2024-11-28 17:06:33 +01:00
Stefan Gränitz
5bd3ed3577 Fix CMAKE_ANDROID_ARCH_ABI=x86 for i686-unknown-linux-android 2024-11-28 13:00:53 +01:00
Stefan Gränitz
e391a11a2c Align settings for builtins and runtimes in CMake cache for aarch64 hosts 2024-11-27 17:07:25 +01:00
Stefan Gränitz
76be949750 Align default targets for builtins and runtimes on x86_64 hosts 2024-11-26 16:56:56 +01:00
Mishal Shah
9a48056f15 Bump the Swift version to 6.2 2024-11-22 01:04:37 -08:00
Stefan Gränitz
c7da7185ab Enable builtins for all runtime targets in CMake cache file 2024-11-21 15:23:07 +01:00
Stefan Gränitz
1857d1c2af Initial patch for early feedback 2024-11-21 14:50:19 +01:00
Cyndy Ishida
1ab968d2b6 [BuildSystem] Stop building for i386-watch-simulator (#77692)
* [BuildSystem] Stop building for i386-watch-simulator

In Xcode16 it is not supported.
2024-11-20 08:57:19 -08:00
Saleem Abdulrasool
cc27c83fc8 build: adjust the early swift-driver handling
Windows has a strict limit on the file path, and use of extended names
for the build is not possible. Rather than hardcoding the location of
the early swift-driver build, allow the user to specify the path. If the
path is specified, we will attempt to copy `swift-driver` and
`swift-help` from that location. Adjust the code to account for the
build executable suffix. This should allow Windows to experiment with an
early swift-driver build.
2024-11-13 10:14:22 -08:00
Fabrice de Gans
79af6da13b [caches] Add cache files for Darwin builds 2024-11-07 11:00:40 -08:00
Egor Zhdan
5b2fd17d4a [build] Keep building Cxx binary for 32-bit watchOS
This reverts a part of ae3e4a1a.

The Cxx and CxxStdlib binaries should be built for all the targets that Swift can back-deploy to.

rdar://138230091
2024-10-22 16:06:40 +01:00
Rintaro Ishizaki
fdacd9dabb [CMake] Add 'CXX_INTEROP' option to add_pure_swift_host_library 2024-10-02 19:34:59 -07:00
Rintaro Ishizaki
e916e9e459 [CMake] Give a dedicated component to compiler swift-syntax libraries (#76497)
* [CMake] Give a dedicated component to compiler swift-syntax libraries

'compiler-swift-syntax-lib' so projects statically link to compiler
libraries (libAST etc) can use the required shared libraries.

rdar://135923606

* Update cmake caches

* Add back implicit `swift-syntax-lib` to `compiler` component for now

Some clients doesn't specify `swift-syntax-lib`.
2024-09-16 21:34:32 -07:00
Ian Anderson
5bf2c937ab [CMake] [Darwin] Don't build the SDK overlays by default on Apple platforms
The Apple SDKs have been providing the Darwin overlay since macOS 10.14.4, iOS 12.2, et al. More recently the SDK version has diverged from the Swift version making them incompatible. Stop building the overlay from Swift. Once the SDK overlays aren't being built, the clang overlays need to be built in testing.

rdar://115192929
2024-09-11 22:26:37 -07:00
Artem Chikin
1baff87879 Revert "[CMake] [Darwin] Don't build the SDK overlays by default on Apple platforms" 2024-09-09 09:57:14 -07:00
Ian Anderson
8959dd97fe [CMake] [Darwin] Don't build the SDK overlays by default on Apple platforms
The Apple SDKs have been providing the Darwin overlay since macOS 10.14.4, iOS 12.2, et al. More recently the SDK version has diverged from the Swift version making them incompatible. Stop building the overlay from Swift. Once the SDK overlays aren't being built, the clang overlays need to be built in testing.

%target-swift-emit-pcm doesn't use the sdk, but %target-swift-frontend does, which will cause them to have a mismatch with "builtin headers belong to system modules, and _Builtin_ modules are ignored for cstdlib headers" aka LANGOPT(BuiltinHeadersInSystemModules) aka -fbuiltin-headers-in-system-modules.

rdar://115192929
2024-09-06 13:28:14 -07:00
Ben Langmuir
44b68cb5dc Merge pull request #75914 from benlangmuir/turn-it-up-to-11
Bump the deployment target for the compiler to macOS 13.0
2024-09-06 13:23:47 -07:00
Rintaro Ishizaki
2eade1e3cc Merge pull request #76253 from rintaro/cmake-package-cmo-rdar135110846
[CMake] Enable library evolution unconditionally for package CMO
2024-09-04 13:54:32 -07:00
Rintaro Ishizaki
7a002b29b9 [CMake] Enable library evolution unconditionally for package CMO
'-package-cmo' requires consistent resilient settings among package
modules at this point. Even if a module (e.g. execuables) don't provide
any public interfaces, specify '-enable-library-evolution'

rdar://135110846
2024-09-04 09:25:29 -07:00
Ben Langmuir
ae3e4a1a10 [watchos] Stop building watchos-armv7k and watchsimulator-i386
When the deployment target is above 9.0 (7.0 for simulator), only
building the module content such as the swiftinterface is supported.
2024-09-03 09:32:01 -07:00
Egor Zhdan
ec09fa773f Merge pull request #76124 from swiftlang/egorzhdan/maccatalyst-deployment-target
[build] Do not override macOS deployment target when macCatalyst is enabled
2024-08-30 17:02:35 +01:00
Ben Langmuir
ad82d86041 Bump the deployment target for the compiler to macOS 13.0
Bump the deployment target from macOS 10.13-aligned versions to macOS
13.0-aligned versions. This allows us to stop linking CoreFoundation
in the swift runtime, which was previously required for availability
checking. It also lets us align the deployment target on x86_64 with
arm64, which was 11.0. Finally, it is a prerequisite to being able to
build swift using the macOS 15 beta SDKs.
2024-08-29 14:30:09 -07:00
Rintaro Ishizaki
3bf75e7130 [CMake] Typo target -> target_name 2024-08-28 20:55:52 -07:00
Rintaro Ishizaki
371dfe860e [CMake] Build macro plugin and plugin servers as a package
Build 'lib/swift/host' libraries and linking binaries as a single
"package" instead of buillding the linking binaries with
"prefer-interface" hack.
This enables CMO between them.
2024-08-28 15:03:05 -07:00
Egor Zhdan
e1bff808d7 [build] Do not override macOS deployment target when macCatalyst is enabled
Cxx.swiftmodule should built with a macOS deployment target set to 10.9, the minimum possible version. Since we enabled macCatalyst for this target, it inadvertently started being built with a deployment target set to 13.0, which is too new and is causing build errors in certain projects.

This change makes sure that for Swift targets within the Swift project that explicitly specify `DEPLOYMENT_VERSION_OSX`, the macCatalyst build logic doesn't silently discard this flag.

rdar://133008827
2024-08-28 15:37:00 +01:00
Daniel Rodríguez Troitiño
4921eaf92f [CMake] Avoid stomping cache variables when cross-compiling (#76054)
If one is building unified and also cross-compiling (for example
building from Linux x86_64 to Linux aarch64), these variables which are
normally set in the cache pointing to a native toolchain are overwritten
unconditionally pointing to the `CMAKE_BINARY_DIR`, which can be
incompatible with the build machine.

The value of `SWIFT_NATIVE_CLANG_TOOLS_PATH` is eventually passed to the Swift
compiler as `-tools-directory`, which the new `swift-driver` actually
seems to use to find `swiftc`. When the `swift-driver` tries to use the
incompatible `swiftc`, it returns with a very unhelpful "error: failed to
retrieve frontend target info".

Avoiding overwriting the variables when cross-compiling lets the build
system use the variables provided in the cache, which point to correct
binaries for the build machine.
2024-08-23 06:59:41 -07:00
Mishal Shah
3ac0dff27d Bump the Swift version to 6.1 2024-08-19 23:09:31 -07:00
Saleem Abdulrasool
50aa3155f1 cmake: add llvm-ml to the windows toolchain build
`llvm-ml` is a replacement for `ml` which is the MSVC assembler. This is
useful on Windows and should be part of the distribution to ensure that
we have a complete toolchain.
2024-08-16 14:47:06 -07:00
Rintaro Ishizaki
39af14198d [CMake] Enable package CMO only in newer compilers 2024-07-29 17:10:39 -07:00
Rintaro Ishizaki
2c63bf2b48 Merge pull request #75304 from rintaro/swiftsyntax-package-cmo
[SwiftSyntax] Enable Package CMO if possible
2024-07-19 17:34:09 -07:00
Doug Gregor
ac0f574fdb Merge pull request #75127 from carlos4242/embedded-avr-cross-compile-stdlib
[AVR] standard library support for AVR
2024-07-17 22:17:42 -07:00
Rintaro Ishizaki
f0808e5335 [SwiftSyntax] Workaround a crash
The compiler crashes when compiling swift files importing package-cmo
enabled '.swiftmodule'. Avoid that by not-using '.swiftmodule'.
2024-07-17 14:29:28 -07:00
Alex Lorenz
6a7be95027 Merge pull request #74754 from hyp/eng/android-compiler-rt-buildps1
[windows][toolchain] build  android compiler-rt builtins when buildin…
2024-07-16 12:35:42 -07:00
Carl Peto
3689427834 [AVR] standard library support for AVR
- when compiling embedded cross compile target standard libraries, include AVR
- add 16-bit pointer as a conditional compilation condition and get the void pointer size right for gyb sources
- attempt to fix clang importer not importing __swift_intptr_t correctly on 16 bit platforms
- changed the unit test target to avr-none-none-elf to match the cmake build

[AVR] got the standard library compiling in a somewhat restricted form:

General
- updated the Embedded Runtime
- tweaked CTypes.swift to fix clang import on 16 bit platforms

Strings
- as discussed in https://forums.swift.org/t/stringguts-stringobject-internals-how-to-layout-on-16-bit-platforms/73130, I went for just using the same basic layout in 16 bit as 32 bit but with 16 bit pointers/ints... the conversation is ongoing, I think something more efficient is possible but at least this compiles and will probably work (inefficiently)

Unicode
- the huge arrays of unicode stuff in UnicodeStubs would not compile, so I skipped it for AVR for now.

Synchronization
- disabled building the Synchronization library on AVR for now. It's arguable if it adds value on this platform anyway.
2024-07-16 12:28:27 +01:00
Alex Lorenz
063a41c308 fix formatting 2024-07-15 13:03:13 -07:00
Alex Lorenz
c6c62e1763 Drop the arm64 changes
build ps1 is currently not able to compile the arm64 builtins correctly
2024-07-15 13:01:21 -07:00
Alex Lorenz
bd2c3ea53b [windows][toolchain] build android compiler-rt builtins when building Android SDK with build.ps1 2024-07-12 17:22:13 -07:00
Alexander Cyon
4a2942bb4e Fix typos in: cmake, tools, utils, unittests, validation-test
Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
2024-07-12 02:34:00 +03:00
Alastair Houghton
7268640b60 Merge pull request #74731 from al45tair/eng/PR-116525111
[Build][Linux] Set `--build-id=sha1` for the linker.
2024-06-28 11:31:36 +01:00
Alastair Houghton
35f123bbbf [Build][Linux] Set --build-id=sha1 for the linker.
This means we will get build IDs in the tools and standard library,
which is useful for debugging (it lets us associate debug symbols with
the binaries later on, as well as allowing us to reliably identify
exactly which binary we are looking at).

rdar://116525111
2024-06-27 12:21:50 +01:00
Rintaro Ishizaki
5ebd715a2a Merge pull request #73725 from rintaro/macros-inproc-plugin
[Macros] In-process plugin server
2024-06-26 06:33:38 -07:00
Saleem Abdulrasool
c048449694 caches: add clang-features-file to the install components
This ensures that we distribute the features.json for clang in the
toolchain distribution image which is used for building the image.
2024-06-25 14:02:01 -07:00
Rintaro Ishizaki
2f7aa428db [Macros] In-process plugin server
Separate swift-syntax libs for the compiler and for the library plugins.
Compiler communicates with library plugins using serialized messages
just like executable plugins.

* `lib/swift/host/compiler/lib_Compiler*.dylib`(`lib/CompilerSwiftSyntax`):
  swift-syntax libraries for compiler. Library evolution is disabled.
* Compiler (`ASTGen` and `swiftIDEUtilsBridging`) only depends on
  `lib/swift/host/compiler` libraries.
* `SwiftInProcPluginServer`: In-process plugin server shared library.
  This has one `swift_inproc_plugins_handle_message` entry point that
  receives a message and return the response.
* In the compiler
  * Add `-in-process-plugin-server-path` front-end option, which specifies
    the `SwiftInProcPluginServer` shared library path.
  * Remove `LoadedLibraryPlugin`, because all library plugins are managed
    by `SwiftInProcPluginServer`
  * Introduce abstract `CompilerPlugin` class that has 2 subclasses:
    * `LoadedExecutablePlugin` existing class that represents an
      executable plugin
    * `InProcessPlugins` wraps `dlopen`ed `SwiftInProcPluginServer`
  * Unified the code path in `TypeCheckMacros.cpp` and `ASTGen`, the
    difference between executable plugins and library plugins are now
    abstracted by `CompilerPlugin`
2024-06-17 11:36:52 -07:00
Alex Lorenz
c8b5344d3e Merge pull request #72014 from compnerd/android
utils: support building android SDKs on Windows
2024-06-07 12:37:00 -07:00
Egor Zhdan
cb2f23f3de Merge pull request #74006 from apple/egorzhdan/remove-ios-32bit
[build] Remove unused `SWIFT_ENABLE_IOS32` CMake flag
2024-05-30 22:11:38 +01:00
Egor Zhdan
7d754db19a [build] Remove unused SWIFT_ENABLE_IOS32 CMake flag
This removes the unused legacy CMake flag: `SWIFT_ENABLE_IOS32`.

Support for targeting 32-bit iOS was removed in 2022 in https://github.com/apple/swift/pull/60363.
2024-05-30 15:19:59 +01:00