Commit Graph

1631 Commits

Author SHA1 Message Date
Evan Wilde
2752414d78 Merge pull request #70680 from etcwilde/ewilde/emit-private-interface
Emit private interfaces on all swift libraries
2024-01-03 13:13:50 -08:00
Saleem Abdulrasool
43c5cf910c Merge pull request #70673 from compnerd/user
build: do not modify user variables
2024-01-03 09:44:28 -08:00
Saleem Abdulrasool
ddca28e51e Merge pull request #70669 from compnerd/simplify
build: simplify the unified build configuration
2024-01-03 07:59:58 -08:00
Evan Wilde
83a4a0be23 Emit private interfaces on all swift libraries
Swift-driver PR [1043](https://github.com/apple/swift-driver/pull/1043)
updated the new driver to always emit private swiftinterface files.
This was not carried back to the old driver, so attempting to bootstrap
the toolchain on a system that does not have the new driver fails to
install because we try to install the private swiftinterface on all
Swift targets.
2024-01-02 16:54:42 -08:00
Max Desiatov
672386c39f Merge pull request #70629 from apple/maxd/embedded-wasm
stdlib/public/CMakeLists.txt: Enable embedded Wasm
2024-01-02 23:42:44 +00:00
Saleem Abdulrasool
f75619fc4a build: do not touch the user specified flags
`CMAKE_CXX_FLAGS` are user controlled and should not be touched by the
build system [1]. Use global `add_compile_options` and
`add_compile_definitions` to control the flags for the targets.

[1] https://cmake.org/cmake/help/book/mastering-cmake/
2024-01-02 14:22:36 -08:00
Saleem Abdulrasool
d21c339a5d build: sink flag handling into global handling
This shuffles the warning from the unified build only to the global
build configuration.
2024-01-02 14:05:02 -08:00
Max Desiatov
c0673f9168 Add m68k to SwiftSetIfArchBitness.cmake (#70668)
`m68k` is a 32-bit architecture and should be defined as such in that file.
2024-01-02 13:16:24 -08:00
Saleem Abdulrasool
8b47616d6d build: simplify the unified build configuration
Conditionalise the inclusion of directory paths. If the include
directory is empty, CMake will raise an error. This allows us to disable
larger portions of the Swift build to speed up some of the build tool
configuration phase and prepares for consuming CMark GFM as a CMake
project.
2024-01-02 12:58:50 -08:00
Max Desiatov
22c42e1d3e Add wasm64 to SwiftSetIfArchBitness.cmake 2024-01-02 18:07:45 +00:00
Ben Barham
406d5337dc Merge pull request #69538 from finagolfin/android
[android] Add more changes to build the compiler
2023-12-15 10:57:21 -08:00
Rintaro Ishizaki
67af6a0e46 [CMake] Color diagnostics for swift sources
Color is nice.
2023-12-06 10:30:38 -08:00
Hamish Knight
73c6dcb551 [cmake] Fix LLDB for ASTGen
Add the swiftmodule paths for ASTGen via
`-add_ast_path` to the public linker flags such
that downstream linking picks them up, allowing
LLDB to load them when debugging. Also switch
SwiftCompilerModules to using public linker
flags instead of adding the linker flags in
`_add_swift_runtime_link_flags`.
2023-12-05 12:43:25 +00:00
Kuba Mracek
a0ec73ef42 [embedded] Start building embedded support on Linux/ELF, expand archs of the embedded stdlib to cover common embedded targets, take 2 2023-11-28 10:31:39 -08:00
Doug Gregor
130adac5c5 Revert "[embedded] Start building embedded support on Linux/ELF, expand archs of the embedded stdlib to cover common embedded targets" 2023-11-27 22:20:54 -08:00
Kuba (Brecka) Mracek
f7c5831830 Merge pull request #69973 from kubamracek/embedded-linux
[embedded] Start building embedded support on Linux/ELF, expand archs of the embedded stdlib to cover common embedded targets
2023-11-27 13:22:27 -08:00
Kuba Mracek
971ad79f37 [embedded] Start building embedded support on Linux/ELF, expand archs of the embedded stdlib to cover common embedded targets 2023-11-17 21:30:12 -08:00
Rintaro Ishizaki
abd416480f [Windows] Link host tools with 'swiftrt.obj'
swiftrt.obj is required for making things work
2023-11-16 11:01:32 -08:00
Finagolfin
bf137cb30d [android] Add more changes to build the compiler 2023-11-06 21:53:56 +05:30
Hamish Knight
e5442fea50 [ASTGen] Enable C++ interop 2023-10-30 23:49:52 +00:00
Hamish Knight
b81e352cfb [cmake] Fix SWIFT_ANALYZE_CODE_COVERAGE
Pass the necessary linker flags as well as the
compile flags to generate coverage.
2023-10-29 14:07:17 +00:00
Saleem Abdulrasool
2bab362663 build: make SWIFT_CLANG_LOCATION take precedence
If this is defined, prefer this compiler over the just built compiler.
2023-10-16 13:41:06 -07:00
Evan Wilde
24d0db249b Merge remote-tracking branch 'main' into 'rebranch'
Conflicts:
  CMakeLists.txt
    Take new BRIDGING_MODE

  SwiftCompilerSources/Sources/SIL/GlobalVariable.swift
    Take new
2023-10-09 17:21:23 -07:00
Erik Eckstein
2dbd6cc56b SwiftCompilerSources: rework bridging
Introduce two modes of bridging:
* inline mode: this is basically how it worked so far. Using full C++ interop which allows bridging functions to be inlined.
* pure mode: bridging functions are not inlined but compiled in a cpp file. This allows to reduce the C++ interop requirements to a minimum. No std/llvm/swift headers are imported.

This change requires a major refactoring of bridging sources. The implementation of bridging functions go to two separate files: SILBridgingImpl.h and OptimizerBridgingImpl.h.
Depending on the mode, those files are either included in the corresponding header files (inline mode), or included in the c++ file (pure mode).

The mode can be selected with the BRIDGING_MODE cmake variable. By default it is set to the inline mode (= existing behavior). The pure mode is only selected in certain configurations to work around C++ interop issues:
* In debug builds, to workaround a problem with LLDB's `po` command (rdar://115770255).
* On windows to workaround a build problem.
2023-10-09 09:52:52 +02:00
swift-ci
c746bf7e51 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-08 10:54:42 -07:00
Saleem Abdulrasool
a2cc0d0468 Merge pull request #68780 from hjyamauchi/sourcekitclangdep
Fix the clang dependency of sourcekit libraries.
2023-10-08 10:41:57 -07:00
Ben Barham
119d08c6d1 Merge remote-tracking branch 'origin/main' into 20230929-merge-rebranch
Conflicts:
  - `CMakeLists.txt` caused by the extra `-D` added in rebranch to
    reduce the number of deprecation warnings.
  - `lib/Frontend/PrintingDiagnosticConsumer.cpp` caused by the removal
    of one of the `#if SWIFT_SWIFT_PARSER` on rebranch (probably should
    have been done on main).
2023-09-29 09:50:50 -07:00
Rintaro Ishizaki
8dbde04c61 Merge pull request #68408 from rintaro/fetch-content
[CMake] Replace early swift-syntax with FetchContent
2023-09-28 11:22:10 -07:00
Hiroshi Yamauchi
71d8118af9 Fix the clang dependency of sourcekit libraries.
Because swift_swap_compiler_if_needed updates the compiler ID to
Clang, we need to account for it when deciding to add a dependency on
clang. Otherwise, the sourcekit build could fail due to the clang
executable not having been built there yet.
2023-09-27 14:15:12 -07:00
swift-ci
7fc36edb98 Merge remote-tracking branch 'origin/main' into rebranch 2023-09-27 09:34:12 -07:00
Alastair Houghton
e1827448e5 [Linux][Build] Use host swiftrt.o when in HOSTTOOLS mode.
When we're building with host tools, we should use the host's swiftrt.o
and not the one we've just built when we're trying to build tools that we
will run on the host system.

rdar://115774613
2023-09-22 15:45:54 +01:00
Rintaro Ishizaki
0165f0979f [CMake] Improve argument list handling of force_target_link_libraries
The argument list handling was a hack and confusing.
2023-09-21 10:35:31 -07:00
Rintaro Ishizaki
f8f7109f7e [CMake] Use global SWIFT_HOST_TRIPLE consistently
Instead of calling 'get_swift_host_triple()' repeatedly, because it
always return the same value.
2023-09-21 09:59:17 -07:00
Rintaro Ishizaki
8cb651bb69 [CMake] Introduce 'swift-syntax-lib' install component
So that swift-syntax host libraries can be installed independently.
2023-09-18 14:44:13 -07:00
Rintaro Ishizaki
b61538ec61 [CMake] Remove SetRPATH.cmake
This used to overwrite the RUNPATH when copying libraries from
earlyswiftsyntax directory. Since earlyswiftsyntax is now replaced with
FetchContent, we don't need this anymore
2023-09-18 14:44:12 -07:00
Rintaro Ishizaki
8909c8a56e [CMake] Centralize the logic to get host '-target' tripple
And pass the value to 'swift-syntax', so they gets correct deployment
target.
2023-09-18 14:44:12 -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
swift-ci
fd6bccadac Merge remote-tracking branch 'origin/main' into rebranch 2023-09-16 17:14:07 -07:00
Evan Wilde
94c2be87da Merge pull request #68561 from etcwilde/ewilde/add-missing-clang-dep-edge
Add dependency edge between dispatch and clang
2023-09-16 16:59:59 -07:00
Evan Wilde
5ac32e7a3f Add dependency edge between dispatch and clang
The dispatch that's built into concurrency on Linux and Windows is built
with clang, but there's no dependency edge. Usually this isn't noticed
because concurrency and most the things it depends on also depend on
clang directly, but occasionally ninja will choose the dispatch build
before building other dependencies, which then fails because there's no
clang.
2023-09-15 14:37:41 -07:00
swift-ci
7f9c90fb48 Merge remote-tracking branch 'origin/main' into rebranch 2023-09-12 23:38:32 -07:00
Eric Miotto
5b69b93858 Ensure module tracing is off when checking disable-implicit* flags (#68453)
In some internal configurations we set the
`SWIFT_LOADED_MODULE_TRACE_FILE` environment variable when running the
build of the compiler -- as a result, this causes `-parse` to always
fails, preventing to detect properly if we can use `disable-implicit*`
flags.

Addresses rdar://115338219
2023-09-12 23:20:08 -07:00
swift-ci
95f9244aaf Merge remote-tracking branch 'origin/main' into rebranch 2023-09-08 12:33:48 -07:00
Rintaro Ishizaki
891d7b728b [CMake] Use explicit RPATHs for unit test executables
Instead of letting CMake set RPATH of the test executables, use
INSTALL_RPATH and BUILD_WITH_INSTALL_RPATH just like other executable
and shared libraries.

Previously when a swift module link with exported swift-syntax targets e.g.
'SwiftSyntax::SwiftParser', the libraries in earlyswiftsyntax were used
instead of the copied libraries in the swift build directory. That
wasn't ideal.
2023-09-08 16:43:26 +00:00
swift-ci
7fed4ac81f Merge remote-tracking branch 'origin/main' into rebranch 2023-09-07 12:38:47 -07:00
Saleem Abdulrasool
881d6f988c Merge pull request #68366 from compnerd/cut-the-wire
build: fix the build of the toolchain
2023-09-07 12:38:31 -07:00
swift-ci
d1abca98df Merge remote-tracking branch 'origin/main' into rebranch 2023-09-07 08:14:37 -07:00
Saleem Abdulrasool
c8e36f66f5 build: fix the build of the toolchain
This wires up the new macro properly into the build machinery to ensure
that the `distribution` target properly builds and installs the
dependencies.  This fixes the missing `swift-plugin-server` on Windows.
2023-09-06 19:40:45 -07:00
Saleem Abdulrasool
00d4879c84 build: adjust the build to support non-Apple environments
Account for import libraries and the associated layout difference on
platforms (e.g. DLLs are placed in `bin`).  This is required to enable
building the macro path on Windows.
2023-09-06 12:45:58 -07:00
swift-ci
c1c764a756 Merge remote-tracking branch 'origin/main' into rebranch 2023-09-01 08:14:48 -07:00