Commit Graph

1619 Commits

Author SHA1 Message Date
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
swift-ci
aae06b0943 Merge remote-tracking branch 'origin/main' into rebranch 2023-08-31 22:54:14 -07:00
Saleem Abdulrasool
fe42740f3e build: clean up dependency tracking for portability
`:` is not a valid file system character but is used to namespace the
imported targets.  This is then used to create the stamp file.  Sanitize
the name prior to use as a stamp file name.
2023-08-31 18:08:08 -07:00
Finagolfin
010759da20 [CMake] Tweak path separators in new Swift runpaths 2023-08-31 19:26:32 +05:30
swift-ci
97970caeac Merge remote-tracking branch 'origin/main' into rebranch 2023-08-30 20:55:33 -07:00
Rintaro Ishizaki
8049922861 [CMake] Update host platform check for macro support
"Support Macros in Linux" patches was inconsistent with checking
platforms. Some only checked 'LINUX' but some matches
'LINUX|ANDROID|OPENBSD|FREEBSD'. Although I don't have tested other
platoforms than Linux at all, there's no reason to limit it to Linux.
So use the consistent check to match 'LINUX|ANDROID|OPENBSD|FREEBSD'
2023-08-30 13:52:37 -07:00
swift-ci
484684f0dd Merge remote-tracking branch 'origin/main' into rebranch 2023-08-29 17:55:14 -07:00
Rintaro Ishizaki
f64506976a [CMake] Use RPATH_CHANGE instead RPATH_SET
RPATH_SET is not available until cmake 3.21.0. Use RPATH_CHANGE instead.
2023-08-29 01:12:02 +00:00
Rintaro Ishizaki
dc6877334f [CMake] Stop some exectuable link with swiftCore
swift-compatibility-symbols, swift-def-to-strings-converter,
and swift-serialize-diagnostics don't use any Swift modules. But when
SWIFT_SWIFT_PARSER was enabled, they are linked with swiftCore. But
these binaries can be executed before the runtime is being built.
We need to stop them linking with swiftCore.
2023-08-28 19:10:01 +00:00
Rintaro Ishizaki
757aaa347d [CMake] Set LD_LIBRARY_PATH to builder's runtime when building stdlib
In Linux. Instead of setting temporary "fallback" RUNPATH, Set
LD_LIBRARY_PATH to builder's runtime when building standard library.
So we don't need to strip the temporary RUNPATH when installing.
2023-08-28 01:16:18 +00:00
Rintaro Ishizaki
9017ef51ce [CMake] Update for review comments 2023-08-25 21:58:38 +00:00
Rintaro Ishizaki
2a2787b2d0 Avoid adding redundant temporary RUNPATH to builder's stdlib
Many shared libs and executables are only run after stdlib/runtime are
built. They don't need to link with builders stdlib at all.
2023-08-24 23:10:20 +00:00
Rintaro Ishizaki
9c9010e5b7 [CMake] Support Macros in Linux
For compiling codes required for macro support, we now need swiftc
compiler in the build machine.

Unlike Darwin OSes, where swiftCore runtime is guaranteed to be present
in /usr/lib, Linux doesn't have ABI stability and the stdlib of the
build machine is not at the specific location. So the built compiler
cannot relies on the shared object in the toolchain.
2023-08-24 17:04:15 +00:00