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-5755] AddSwift.cmake hardcodes "/usr/lib/swift/linux" into the RPATH of its shared libraries #48325

Closed
kevints mannequin opened this issue Aug 23, 2017 · 7 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. cmake Linux Platform: Linux

Comments

@kevints
Copy link
Mannequin

kevints mannequin commented Aug 23, 2017

Previous ID SR-5755
Radar None
Original Reporter @kevints
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Project Infrastructure
Labels Bug, CMake, Linux
Assignee None
Priority Medium

md5: 6050e1240c6e06e66401384bc1368587

is duplicated by:

  • SR-9315 Linux shared libraries contain unnecessary RUNPATH entries

relates to:

  • SR-1967 Need way to disable inclusion of hard-coded RPATH to stdlib dir
  • SR-9315 Linux shared libraries contain unnecessary RUNPATH entries

Issue Description:

This mean that CMAKE_INSTALL_PREFIX (the --install-destdir flag to build-script) is not fully respected on Linux and it is difficult to build a relocatable swift binary.

@belkadan
Copy link
Contributor

Rostepher (JIRA User), @aciidb0mb3r, @compnerd, can you think of any reason why we'd need this entry on non-Darwin systems? SR-1967 is a bigger problem, but this one seems like we should be able to just take it out.

@ankitspd
Copy link
Member

I don't see such an entry in executables created by SwiftPM:

```
$ readelf -d ./.build/x86_64-unknown-linux/debug/foo

...
Library runpath: [/toolchain/usr/lib/swift/linux:$ORIGIN]
```

@kevints
Copy link
Mannequin Author

kevints mannequin commented Nov 27, 2018

@aciidb0mb3r SwiftPM has saner behavior here on the binaries it produces, but the swift-package binary itself looks like this:

root@85771f21ebdb:/code# readelf -d /tmp/swift-4.2.1-RELEASE-ubuntu14.04/usr/bin/swift-package 
 0x000000000000001d (RUNPATH)            Library runpath: [/home/buildnode/jenkins/workspace/oss-swift-4.2-package-linux-ubuntu-14_04/build/buildbot_linux/swift-linux-x86_64/lib/swift/linux:$ORIGIN:$ORIGIN/../lib/swift/linux:/home/buildnode/jenkins/workspace/oss-swift-4.2-package-linux-ubuntu-14_04/build/buildbot_linux/foundation-linux-x86_64/Foundation:/home/buildnode/jenkins/workspace/oss-swift-4.2-package-linux-ubuntu-14_04/build/buildbot_linux/xctest-linux-x86_64]

@ankitspd
Copy link
Member

That's SwiftPM's own fault. It has nothing to do with Swift's CMake configuration. Maybe I am misunderstanding what this bug is about?

@kevints
Copy link
Mannequin Author

kevints mannequin commented Nov 27, 2018

@aciidb0mb3r you're right, this bug is specifically about the value hardcoded into Swift's CMake (which I believe is used downstream by s-c-f and s-c-d as well).

Filed https://bugs.swift.org/browse/SR-9357 for the swiftPM side of this.

@finagolfin
Copy link
Contributor

Can this be closed because of my pull that was merged a couple months ago?

#34023

@finagolfin
Copy link
Contributor

This has been fixed.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
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. cmake Linux Platform: Linux
Projects
None yet
Development

No branches or pull requests

3 participants