Skip to content
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

[SR-1650] Fix DT_RUNPATH directives for installable toolchains #44259

Open
ddunbar opened this issue May 31, 2016 · 1 comment
Open

[SR-1650] Fix DT_RUNPATH directives for installable toolchains #44259

ddunbar opened this issue May 31, 2016 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@ddunbar
Copy link
Member

ddunbar commented May 31, 2016

Previous ID SR-1650
Radar None
Original Reporter @ddunbar
Type Bug
Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee None
Priority Medium

md5: 1c6e0e84e05c880cf5dc67010fab2124

relates to:

  • SR-1631 swift-integration-tests failing, unable to find libFoundation.so

Issue Description:

We need to audit and clean up our handling of dynamic library search paths in installable toolchains. This showed up while investigated SR-1631.

Some of the current problems/questions:

1. The swift compiler unconditionally embeds a DT_RUNPATH/DT_RPATH (depending on the linker in use) into libraries pointing at the current runtime library directory. I am not sure this is the right default behavior, and it is particularly wrong when the swift compiler is being run from a CI build location, not the install path.

2. Given #1, the installed libXCTest.so has a DT_RUNPATH to the buildbot directory embedded in it within the current toolchains we distribute.

3. We are using $ORIGIN in some places to allow for relocatable libraries, but we also have /usr/lib/swift/linux embedded in the Swift standard libraries. I am not sure this is really right to have both.

4. Some libraries (e.g., libFoundation.so) have no run path at all, and wouldn't be loadable (I think?) if they weren't pulled in by a process which had already loaded the necessary dependencies. It might be possible for this to cause problems in practice if libFoundation.so pulled in a libswift library that the main application didn't use, but I don't know if that can currently happen.

It would be good for someone who thoroughly understands the Linux dynamic linking landscape to audit what is currently being done and figure out the right answer for Swift with an eye towards supporting official distributions of the Swift 3.0 compiler and applications.

@ddunbar
Copy link
Member Author

ddunbar commented May 31, 2016

/cc @gribozavr

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

1 participant