Skip to content

[5.9][lldb][Swift][CMake] Correct RUNPATH in Linux builds #7345

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

Merged
merged 2 commits into from
Aug 31, 2023

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Aug 29, 2023

Cherry-pick #7331 and #7359 into swift/release/5.9

  • Explanation: Fix RUNPATH when building for Linux. In linux, liblldb is built/installed in lib/. Previously it was assumed to be installed in a .framework directory like in macOS. Also RUNPATH was set with @loader_path but in Linux, equivalent is $ORIGIN. This is required for enabling Macros in Linux
  • Risk: Low. This doesn't affect other platforms. For Linux, the RUNPATH didn't work at all.
  • Testing: Passes current test suite
  • Issues: rdar://104346187
  • Reviewers: Ben Barham (@bnbarham), Jonas Devlieghere (@JDevlieghere)

* When LLDB_BUILD_FRAMEWORK is not enabled, liblldb is built/installed
  in 'lib/'. Pass the correct path to 'add_properties_for_swift_modules
* '$ORIGIN' instead of '@loader_path' in Linux-like platforms

(cherry picked from commit 680e5ba)
@rintaro
Copy link
Member Author

rintaro commented Aug 29, 2023

@swift-ci Please test

I had this looking directly in `./swift/<os>/` before, but now that an installed
lldb executable also links against Swift libraries, this needs to be the more
general `../lib/swift/<os>/`.

(cherry picked from commit 5444a68)
@rintaro
Copy link
Member Author

rintaro commented Aug 30, 2023

@swift-ci Please test

1 similar comment
@rintaro
Copy link
Member Author

rintaro commented Aug 31, 2023

@swift-ci Please test

@finagolfin
Copy link
Member

Just a reminder that swiftlang/swift-integration-tests#121 will need to be merged into 5.9 and 5.9.0 also, as that test checks these runpaths on linux.

@bnbarham
Copy link

bnbarham commented Aug 31, 2023

5.9 and 5.9.0 don't have that check in (that's why all the toolchain builds passed)

@finagolfin
Copy link
Member

Ah, you're right, I forgot that I added that test after the 5.9 branch. Ignore what I said. 🙄

@shahmishal shahmishal merged commit 26bcbd4 into swiftlang:swift/release/5.9 Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants