Commit Graph

1330 Commits

Author SHA1 Message Date
Alastair Houghton
3627507eb1 [Build] Further static Linux SDK support changes.
Fix some indentation issues.

Change `build-script-impl` to make `build-linux-static` a positive argument.

Fix documentation for `--linux-archs` and `--linux-static-archs` (the options
are comma separated for `build-script`, but semicolon separated for
`build-script-impl`).

Set the default for `linux-static-archs` to `x86_64, aarch64` so that we
install the expected content in the toolchain.

Add missing default for `test_linux_static`.

Make sure to pass down `--skip-build-linux` and `--build-linux-static`.

Factor out config file generation and call it from the install step in `llvm.py`
as well as from the build step.

rdar://123503470
2024-05-03 09:12:49 +01:00
Alastair Houghton
fdc8ffd36f [Build] Updated following initial comments from Eric.
Change the `--linux[-static]-arch` option to `--linux[-static]-archs`, on the
basis that it supports multiple values.

Other tidying.

rdar://123503470
2024-05-02 14:56:18 +01:00
Alastair Houghton
ae1c0455f3 [Build] Add the new fully-static Linux SDK.
Declare a new `LINUX_STATIC` SDK and configure it.

Add options to set the build architectures for the `LINUX` and
`LINUX_STATIC` SDKs, similar to what we have for Darwin, because
we'll be cross-compiling.

Also add an option to point the build system at the sources for
the musl C library, which we're using for `LINUX_STATIC`.

rdar://123503470
2024-05-02 14:56:18 +01:00
Nate Chandler
c43f87101f Merge branch 'main' into rebranch
Conflicts:
      lib/Basic/Platform.cpp

```
diff --git a/lib/Basic/Platform.cpp b/lib/Basic/Platform.cpp
index 240edfa144a..1797c87635f 100644
--- a/lib/Basic/Platform.cpp
+++ b/lib/Basic/Platform.cpp
@@ -200,10 +200,7 @@ StringRef swift::getPlatformNameForTriple(const llvm::Triple &triple) {
   case llvm::Triple::CUDA:
   case llvm::Triple::DragonFly:
   case llvm::Triple::DriverKit:
-<<<<<<< HEAD
   case llvm::Triple::ELFIAMCU:
-=======
->>>>>>> main
   case llvm::Triple::Emscripten:
   case llvm::Triple::Fuchsia:
   case llvm::Triple::HermitCore:
```
2024-04-17 13:32:48 -07:00
Artem Chikin
1f14158a1d Introduce VisionOS Platform
This change introduces a new compilation target platform to the Swift compiler - visionOS.

- Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target.
- Addition of the new platform kind definition.
- Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries.
- Utilities to read out Darwin platform SDK info containing platform mapping data.
- Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. 'updateIntroducedPlatformForFallback', 'updateDeprecatedPlatformForFallback', 'updateObsoletedPlatformForFallback').
- Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path.
- Changes to existing test suite to accomodate the new platform.
2024-04-10 09:38:02 -07:00
swift_jenkins
efab2fb26c Merge remote-tracking branch 'origin/main' into next 2024-03-27 17:13:53 -07:00
Rintaro Ishizaki
05d3ff7fab Merge pull request #72629 from rintaro/macros-no-xcodeplugin
[Macros] Remove plugin related flags from toolchain Info.plist
2024-03-28 08:54:16 +09:00
Rintaro Ishizaki
5d48a5a122 [Macros] Remove plugin related flags from toolchain Info.plist
`-external-plugin-path` flags pointing XcodeDefault.xctoolchain were
needed to use macro plugins in Apple SDK. But since Apple macro plugins
are not in `.xctoolchain` anymore, these flags are useless.

rdar://125498074
2024-03-27 10:42:58 -07:00
swift_jenkins
2063e76a27 Merge remote-tracking branch 'origin/main' into next 2024-03-25 07:45:08 -07:00
Eric Miotto
0edd96e311 Merge pull request #72486 from edymtt/emiotto/add-flag-to-pass-arguments-to-dsymutil
build-script: add flag to pass arguments to dsymutil
2024-03-25 07:28:35 -07:00
swift_jenkins
1d0d769d4b Merge remote-tracking branch 'origin/main' into next 2024-03-22 13:06:35 -07:00
Eric Miotto
efdd4954d3 build-script: add flag to pass arguments to dsymutil
This is currently needed to disable DWARF verification in
some Apple internal configurations.

Addresses rdar://125092216
2024-03-22 08:04:31 -07:00
Mike Ash
0491192337 [Runtime] Remove ExternalGenericMetadataBuilder. 2024-03-21 17:56:17 -04:00
swift_jenkins
15dbb1091b Merge remote-tracking branch 'origin/main' into next 2024-03-13 08:41:42 -07:00
Arnold Schwaighofer
ea70aea43c IRGen: Add code to support building fragile resilient protocol witnesses
We don't currently support building resilient relative protocol witness tables.
One might want to build with relative witness tables but not need
resilient protocols. Allow for that scenario.

Add a test configuration to test library-evolution + fragile resilient
protocols + relative protocol witness tables.
2024-03-10 09:14:08 -07:00
swift_jenkins
dc151b0f04 Merge remote-tracking branch 'origin/main' into next 2024-03-01 06:46:48 -08:00
Kuba Mracek
0c9c9918ae [build-script] Avoid stripping clang builtin .a libraries when extracting dSYMs on Darwin 2024-02-29 10:55:11 -08:00
swift_jenkins
fd121f5788 Merge remote-tracking branch 'origin/main' into next 2024-02-23 23:44:52 -08:00
Michael Buch
dd42476381 [build-script] Fix the LLDB redecl completion filter that we pass to llvm-lit
In the presence of multiple `--filter` options, `llvm-lit` will only
pick the last one. Which means we only ever ran the tests under
`commands/`.

This patch turns the multiple filters into a regex.
2024-02-23 13:41:23 +00:00
swift_jenkins
44eaed56be Merge remote-tracking branch 'origin/main' into next 2024-02-22 12:27:59 -08:00
Ian Anderson
5acd961347 Merge pull request #71474 from ian-twilightcoder/builtin-float-overlay
[overlay] Make an overlay for the clang _Builtin_float module
2024-02-22 12:25:54 -08:00
swift_jenkins
8ce5dfac8b Merge remote-tracking branch 'origin/main' into next 2024-02-22 11:18:39 -08:00
Michael Buch
03194eb4b1 Merge pull request #71724 from Michael137/lldb/type-completion-rework/swift-build-script/to-20230725
[build-script] Run LLDB tests with new redecl-completion setting
2024-02-22 19:09:13 +00:00
swift_jenkins
7d8148ac93 Merge remote-tracking branch 'origin/main' into next 2024-02-21 00:08:09 -08:00
swift_jenkins
03c53080e3 Merge remote-tracking branch 'origin/main' into next 2024-02-20 10:51:06 -08:00
Michael Buch
8858585677 [build-script] Run LLDB tests with new redecl-completion setting 2024-02-20 13:41:08 +00:00
Kuba Mracek
38bcffa6ff [embedded] When copying clang builtins from host toolchain, include macho_embedded libraries 2024-02-19 14:36:19 -08:00
Ian Anderson
1ce3935eb7 [overlay] Make an overlay for the clang _Builtin_float module
Clang's builtin float.h is no longer included in OS/SDK modules, and so it needs its own overlay.

rdar://122351557
2024-02-16 12:31:47 -08:00
Shubham Sandeep Rastogi
3107a92bb9 Add libunwind to LLVM_ENABLE_RUNTIMES
We are seeing the following issue

rdar://123102211 (Fix internal/next smooshbase bot's cmake error)

CMake Error at
/Users/buildslave/jenkins/workspace/lldb-internal-next-ios-disclosed-x86_64/llvm-project/libcxxabi/CMakeLists.txt:51 (message):
  LIBCXXABI_USE_LLVM_UNWINDER is set to ON, but libunwind is not specified in
  LLVM_ENABLE_RUNTIMES.

To fix it, we need to add libunwind to the LLVM_ENABLE_RUNTIMES.
2024-02-16 10:13:58 -08:00
Adrian Prantl
acc9100798 Explicitly pass LLDB test config, so it can be picked up by the filter decorators 2024-02-12 08:50:28 -08:00
Alastair Houghton
e48b05f12c [SwiftCompilerSources] Enable use of the -min-runtime-version option.
Turn on the use of `-min-runtime-version` when building the compiler.

rdar://121522431
2024-02-02 16:19:06 +00:00
Mike Ash
4bc7726d43 Merge pull request #70900 from mikeash/swift-generic-metadata-builder-out-of-process
[Tools] Add a library to build specialized generic metadata out of process.
2024-01-26 10:50:34 -05:00
Mike Ash
4341102c92 [Tools] Add a library to build specialized generic metadata out of process.
This library uses GenericMetadataBuilder with a ReaderWriter that can read data and resolve pointers from MachO files, and emit a JSON representation of a dylib containing the built metadata.

We use LLVM's binary file readers to parse the MachO files and resolve fixups so we can follow pointers. This code is somewhat MachO specific, but could be generalized to other formats that LLVM supports.

rdar://116592577
2024-01-24 20:45:50 -05:00
Kavon Farvardin
b92fe5f2e9 [build-script] fix NoncopyableGenerics option
This patch introduces `--enable-experimental-noncopyable-generics` for
the build script. It replaces
`--swift-stdlib-experimental-noncopyable-generics`

The old build option only enables the feature when building the
stdlib, but if we've built the stdlib with NoncopyableGenerics, the
compiler should be hardwired to have that feature enabled, too.

This patch also introduces the `noncopyable_generics` lit parameter, so
that tests assuming the system was built with the feature can live
in-tree and be tested, if they specify `REQUIRES: noncopyable_generics`.
2024-01-23 22:41:59 -08:00
Rokhini Prabhu
6dbf4d2e20 Add support for task-to-thread model to be specified on as part of build presets 2023-12-21 16:00:25 -08:00
Adrian Prantl
71bbe17dc2 Merge pull request #69679 from adrian-prantl/precise-compiler-invocation
Extend the LLDB test matrix to support precise compiler invocations.
2023-11-15 08:46:06 -08:00
Mike Ash
967c5c6a75 Merge pull request #69542 from mikeash/retain-release-override-optional
[Runtime] Add option to remove override point for retain/release.
2023-11-08 19:51:29 -05:00
Adrian Prantl
d3f6ca5683 Extend the LLDB test matrix to support precise compiler invocations. 2023-11-08 16:32:17 -08:00
Adrian Prantl
c6cceaf3c7 Only rerun the API tests in dwarfimporter-only mode.
This removes >70 tests from the list of tests that are being rerun.  The REPL
doesn't really benefit from DWARFImporter, since there is no deb ug info in the
victim process, so it makes no sense to test this configuration.
2023-11-08 09:27:25 -08:00
Mike Ash
6606850232 [Runtime] Add option to remove override point for retain/release.
Add a `SWIFT_STDLIB_OVERRIDABLE_RETAIN_RELEASE` CMake option. When set to true, swift_retain/release and the other functions in InstrumentsSupport.h can be overridden by setting the appropriate global function pointer, as is already the case. When set to false, those function pointers are removed and the functions always go into the default implementation.

Set `SWIFT_STDLIB_OVERRIDABLE_RETAIN_RELEASE` to false when building the minimal stdlib, and set it to true otherwise by default.

rdar://115987924
2023-10-31 15:26:01 -04:00
Kavon Farvardin
3da894d704 [NoncopyableGenerics] provide stdlib build option
This helps set the stage for getting the stdlib building
correctly with `NoncopyableGenerics` enabled. Disabled by
default for now so this is an NFC.
2023-10-25 09:27:36 -07:00
Ben Barham
041691184c [CMake] Replace early swift-syntax with FetchContent
Use FetchContent to include swift-syntax directly in swift. This can be
thought of as an `add_subdirectory` for a directory outside the root.

The default build directory will be `_deps/swiftsyntax-subbuild/`, though
the modules and shared libraries will be built in `lib/swift/host` by
passing down `SWIFT_HOST_LIBRARIES_DEST_DIR` to avoid copying them as we
were doing previously.
2023-09-18 14:44:10 -07:00
Alex Langford
1970da96ff [Test] See if removing -Xcc from DOTEST_EXTRA continues to work
(cherry picked from commit 54fed44b80)
2023-09-14 16:11:42 -07:00
Alex Langford
54fed44b80 [Test] See if removing -Xcc from DOTEST_EXTRA continues to work 2023-09-14 12:43:55 -07:00
Kavon Farvardin
b5e0f95a18 eliminate pipes in favor of shlex
This solves deprecation warnings in build-script:

```
DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
```

This change assumes that the minimum version
of Python3 is 3.3, which has `shlex.quote`.

Since our build bots currently use 3.6 as their
Python version, we can't yet use `shlex.join`
to further simplify some of the code using
quote.
2023-07-25 15:24:54 -07:00
Max Desiatov
e82060fbdb build: Add support for wasi-sysroot option in build-script
`wasi-sysroot` allows providing a path to a custom libc that supports this platform.
2023-07-22 13:44:05 +01:00
Mishal Shah
80e4e0465c Merge pull request #66530 from swift-riscv/add-riscv64-as-supported-architecture
Add riscv64 as supported architecture on linux
2023-07-03 12:19:32 -05:00
Alastair Houghton
e197c00e3e Merge pull request #66883 from al45tair/eng/PR-111214571
[Freestanding] Remove uses of stat() and dlsym().
2023-06-23 22:05:45 +01:00
Alastair Houghton
e5ece81cc9 [Freestanding] Remove uses of stat() and dlsym().
We shouldn't be using stat() or dlsym() in the freestanding
runtime.

rdar://111214571
rdar://106555012
2023-06-23 17:05:59 +01:00
Michael Buch
511c344577 [Build] Introduce --lldb-configure-tests option
We recently changed the build-script to stop configuring LLDB
tests if `SKIP_TESTS_LLDB` is set  (see rdar://109774179 and
https://github.com/apple/swift/pull/66171).

A common use-case is to build lldb without `-t` (to avoid running the
tests) and then run the tests separately later. However, if we don't
specify the `-t` flag to the build-script, `SKIP_TESTS_LLDB` is implicitly set.
Meaning this multi-step way of running lldb tests regressed.

This patch addresses this by creating a new `--lldb-configure-tests`
option which when set makes sure we set the CMake variable
`LLDB_INCLUDE_TESTS` (which will be the default behaviour).

The preset for which we originally introduced the `SKIP_TESTS_LLDB` check
now sets this new option to `0` to avoid configuring LLDB tests. The
preset skips running the tests anyway, we're not losing test coverage.
2023-06-23 12:32:32 +01:00