Commit Graph

433 Commits

Author SHA1 Message Date
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
360c5d8465 Merge remote-tracking branch 'origin/main' into 20231019-merge-main
Conflicts:
  - `lib/AST/TypeCheckRequests.cpp` renamed `isMoveOnly` which requires
    a static_cast on rebranch because `Optional` is now a `std::optional`.
2023-10-19 16:16:23 -07:00
Eric Miotto
03c490cc11 [CMake] add option to generate API descriptors for the standard library (#69228)
This would be needed to stop using `swift-api-extract` in some
internal configurations.

Given the limited scope, only add this as a CMake flag.

Addresses rdar://117019309
2023-10-18 07:23:27 -07:00
swift-ci
36242019b3 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-12 03:55:00 -07:00
Alastair Houghton
801b970012 [Build] Fix dependency problems when bootstrapping.
If we're bootstrapping *and* skip-early-swiftsyntax is enabled, the
build can fail while trying to build target executables because we
haven't built a copy of libswiftCore yet but *the compiler* refers
to it.

This is "fixed" in other places by setting LD_LIBRARY_PATH, but we
don't want or need to do that here; we just want to delay building
these executables until after libswiftCore is available.

rdar://116485713
2023-10-10 11:22:21 +01:00
swift-ci
e6eb30a186 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-06 00:41:18 -07:00
Alastair Houghton
7b7f77eeaa [Linux] Enable frame pointers when building Swift libraries.
Turn on frame pointers for the Swift runtime libraries.  This makes
backtraces that go through the runtimes more reliable without having
to parse DWARF data.

rdar://116112040
2023-10-05 16:11:20 +01:00
swift-ci
75ce2f5734 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-03 07:13:54 -07:00
Kuba (Brecka) Mracek
75838507d8 Merge pull request #68929 from kubamracek/embedded-sdk3
[embedded] Resolve empty -sdk path warning in embedded stdlib build, take 3
2023-10-03 07:02:19 -07:00
swift-ci
47af09c487 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-02 19:34:47 -07:00
Kuba (Brecka) Mracek
61be59948f Merge pull request #68786 from kubamracek/embedded-no-swiftinterface
[embedded] Do not emit .swiftinterface files for fragile modules (embedded stdlib, Cxx.swiftmodule)
2023-10-02 19:34:16 -07:00
Kuba Mracek
d579c62fee [embedded] Resolve empty -sdk path warning in embedded stdlib build, take 3 2023-10-02 17:55:02 -07:00
swift-ci
a230c675b6 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-02 13:55:10 -07:00
Kuba Mracek
268a1e3556 Revert "[embedded] Resolve empty -sdk path warning in embedded stdlib build, take 2"
This reverts commit a1a48b5c83.
2023-10-02 09:35:21 -07:00
swift-ci
bc6aa1f8d5 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-02 09:14:11 -07:00
Alastair Houghton
8ca43141c7 Merge pull request #68826 from al45tair/eng/PR-115278959
[Linux] Provide a statically linked swift-backtrace binary.
2023-10-02 16:57:19 +01:00
swift-ci
e565849dd4 Merge remote-tracking branch 'origin/main' into rebranch 2023-09-29 12:58:02 -07:00
Alastair Houghton
9d5ce542bc [Linux] Make sure we link with swiftrt on ELF/COFF platforms.
This was causing `swift-backtrace` to crash when linked with the static
version of the runtime, because the runtime then couldn't locate any of
the necessary metadata.

rdar://115278959
2023-09-29 16:18:53 +01:00
Alastair Houghton
2efd1beabe [Linux] Provide a statically linked swift-backtrace binary.
This adds a new binary, `swift-backtrace-static`, to the build.  The runtime
will not by default use this binary as the backtracer, but if you want to
statically link your own binaries against the standard library you can copy
`swift-backtrace-static` rather than `swift-backtrace` alongside your binary,
naming it `swift-backtrace`, and the runtime should find and use it, which
will mean you don't need to have `libswiftCore.so` et al installed.

rdar://115278959
2023-09-28 18:18:39 +01:00
Kuba Mracek
a1a48b5c83 [embedded] Resolve empty -sdk path warning in embedded stdlib build, take 2 2023-09-28 09:17:32 -07:00
swift-ci
81e60b06da Merge remote-tracking branch 'origin/main' into rebranch 2023-09-28 04:14:09 -07:00
Kuba Mracek
0962d826b3 Revert "[embedded] Resolve empty -sdk path warning in embedded stdlib build"
This reverts commit 1b1db053d5.
2023-09-27 23:10:31 -07:00
swift-ci
584efa63bb Merge remote-tracking branch 'origin/main' into rebranch 2023-09-27 21:15:09 -07:00
Kuba Mracek
1b1db053d5 [embedded] Resolve empty -sdk path warning in embedded stdlib build 2023-09-27 14:50:25 -07:00
Kuba Mracek
3cacb3659d [embedded] Do not emit .swiftinterface files for fragile modules (embedded stdlib, Cxx.swiftmodule) 2023-09-26 17:59:19 -07:00
swift-ci
5a9893a62a Merge remote-tracking branch 'origin/main' into rebranch 2023-09-20 14:34:28 -07:00
Rintaro Ishizaki
b5f44debfc Merge pull request #68646 from rintaro/cmakestdlib-filelist 2023-09-20 05:48:14 -07:00
swift-ci
555c15594b Merge remote-tracking branch 'origin/main' into rebranch 2023-09-20 00:55:11 -07:00
Matt Jacobson
fc7d590a15 build: on FreeBSD, set the rpath of built stdlib dylibs to $ORIGIN (#62334) 2023-09-20 08:41:25 +01:00
Rintaro Ishizaki
18d791ccfd [CMake] Avoid add_custom_command output being used from multiple target
without a target. Because Xcode generator  doesn't like it.
Use add_custom_command_target instead.
2023-09-19 16:58:12 -07:00
swift-ci
7d8091fe2e Merge remote-tracking branch 'origin/main' into rebranch 2023-09-18 12:14:41 -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
swift-ci
37368c2b49 Merge remote-tracking branch 'origin/main' into rebranch 2023-09-15 16:58:37 -07:00
Rintaro Ishizaki
a182bdf584 [CMake] Update source file list only if different
Use 'copy_if_different' instead of 'file(GENERATE'. Somehow
'file(GENERATE' failed with

  CMake Error: Files to be generated by multiple different commands:
2023-09-15 13:46:49 -07:00
Rintaro Ishizaki
b888abfd38 [CMake] Update source file list only if different
Write source file list using 'file(GENERATE' so that they are updated
only if thier content is changed. Otherwise stdlib modules are rebuild
everytime cmake configuration happens.
2023-09-15 10:37:40 -07:00
Rintaro Ishizaki
ca41171be5 [CMake] Copy '.private.swiftinteface' to swift_static.
'.private.swiftinterface' should be a part of the module. And it's
declared as `OUTPUT` file list, but they were never created. Because of
that the target was always rebuilt.
2023-09-15 10:35:16 -07:00
Sophia Poirier
86d368f364 Merge remote-tracking branch 'upstream/main' into fix-rebranch-automerger 2023-08-31 14:10:52 -07:00
Ben Barham
afd3f172cb [stdlib] Set PYTHONIOENCODING when building the stdlib
Ubuntu 18.04 seems to be defaulting to 'ascii', causing an error when
using line-directive combined with the utf-8 diagnostic output used when
early swift syntax is enabled.
2023-08-30 11:41:11 -07:00
swift-ci
484684f0dd Merge remote-tracking branch 'origin/main' into rebranch 2023-08-29 17:55:14 -07:00
Rintaro Ishizaki
0aa0aac72e [CMake] Always use builder's runtime for building Swift code in Linux
Some non-stdlib thing e.g. swift-backtrace still might be built before
the runtime is built. For building Swift code in Linux "hosttools",
always set 'LD_LIBRARY_PATH' to the runtime in the builder.
2023-08-29 16:36:24 +00:00
swift-ci
18a5500852 Merge remote-tracking branch 'origin/main' into rebranch 2023-08-23 14:53:02 -07:00
Volodymyr Sapsai
4c480d5fa7 Add and install a parent module map for Swift shims. NFC intended.
Header search path for Swift shims is "usr/lib/swift". Don't rely on
clang looking for module maps in immediate subdirectories like "shims"
but add a module map to "usr/lib/swift" sourcing "shims" modules.

rdar://106677321
2023-08-22 12:16:46 -07:00
Ben Barham
a78daa68b8 [rebranch] Make sure to include remote inspection headers first
These headers need to be ahead of all the LLVM headers, which are added
before the flags are. Add a new parameter to pass through headers to add
as a prefix.

Resolves rdar://113647684.
2023-08-09 16:01:14 -07:00
Saleem Abdulrasool
3f828e915a build: ensure that we push -static into the flags
The CxxStdlib module is built statically only.  We would previously
build the static library but indicate dynamic linking.  This would
incorrectly code generate in the client on Windows making it impossible
to use the module.
2023-08-07 08:51:55 -07:00
Saleem Abdulrasool
aa5436d130 Merge pull request #67743 from compnerd/hacks-r-us
Enable CxxStdlib on Windows
2023-08-05 15:03:00 -07:00
Alastair Houghton
208fce1237 Merge pull request #67711 from al45tair/eng/PR-113337854
[Linux] Set rpath in add_swift_executable.
2023-08-05 12:21:58 +01:00
Saleem Abdulrasool
ef037a418b stdlib: adjust the name for static libraries on Windows
Windows names static libraries with a `lib` prefix and a `lib` suffix.
This differentiates them from the import libraries which have no prefix
and a `lib` suffix.  This adjustment enables the parallel installation
of import libraries and static library variants for a given module.
This is required to support static and dynamic library co-existence in
Swift.
2023-08-04 21:19:35 -07:00
Saleem Abdulrasool
3aec82da29 Platform: make stdint module implicit on Windows
This makes the `stdint` module implicit which repairs the ability to
build some components.  In order to accomplish this, we need to
potentially break the fragile Swift build system.  Due to the incorrect
handling of compilers we need some workarounds to support
cross-compilation.  This removes the injected system header paths when
building on Windows to ensure that the clang resource headers are not
following the system headers which breaks the modules as the clang
resources are dependent on the system headers when running in hosted
mode.
2023-08-04 15:37:59 -07:00
Alastair Houghton
c8bdc25508 [Linux] Set rpath in add_swift_executable.
Because the rpath isn't set, the dynamic linker can't find the Swift
libraries when we try to run `swift-backtrace` on Linux (when we
actually install everything).

rdar://113337854
2023-08-03 16:49:43 +01:00
Alastair Houghton
6430cede12 Merge pull request #67505 from al45tair/eng/PR-112662487-part2
[Linux][Backtracing] Fix CMake scripts to install correctly.
2023-07-25 15:31:36 +01:00