-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[5.9.0][CMake] Support Macros in Linux #68197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.9.0][CMake] Support Macros in Linux #68197
Conversation
When building Swift code into the compiler (e.g, the new Swift parser along with macros support), make sure we always add the appropriate paths to (1) link against the host Swift toolchain, and (2) find the host Swift libraries (such as SwiftSyntax) at runtime. The CMake code for doing this was only running for Darwin builds, so generalize it to also work on Linux. (cherry picked from commit 277619a)
This enables running macro tests on Linux. (cherry picked from commit c573a7a)
(cherry picked from commit defe9eb)
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. (cherry picked from commit 9c9010e) (cherry picked from commit 040d15d)
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. (cherry picked from commit dc68773) (cherry picked from commit 1e7c84a)
swiftlang/llvm-project#7354 |
1 similar comment
swiftlang/llvm-project#7354 |
swiftlang/llvm-project#7354 |
swiftlang/llvm-project#7354 |
swiftlang/llvm-project#7354 |
swiftlang/llvm-project#7354 |
swiftlang/llvm-project#7354 |
Ubuntu 18.04 failure |
"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' (cherry picked from commit 8049922) (cherry picked from commit 714589e)
c653d2d
to
5ba02ab
Compare
swiftlang/llvm-project#7354 |
swiftlang/llvm-project#7354 |
swiftlang/llvm-project#7354 |
swiftlang/llvm-project#7354 |
swiftlang/llvm-project#7354 |
swiftlang/llvm-project#7354 |
5ba02ab
to
82ab9b7
Compare
(cherry picked from commit 71f5b47)
82ab9b7
to
d34a60d
Compare
swiftlang/llvm-project#7354 |
swiftlang/llvm-project#7354 |
swiftlang/llvm-project#7354 |
swiftlang/llvm-project#7354 |
swiftlang/llvm-project#7354 |
swiftlang/llvm-project#7354 |
Cherry-pick #68190 into
release/5.9.0
swiftCore
in/usr/lib
or any other stable location, executables and shared libraries that contains Swift module need to haveRUNPATH
to the runtime in its own toolchain. This PR forces "hosttools" bootstrapping mode, but set theRUNPATH
to the currently-being-built toolchain.