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

os x linker supports -rpath in xcode 3 (os x 10.5) #2127

Open
bdbaddog opened this issue Jan 2, 2018 · 2 comments
Open

os x linker supports -rpath in xcode 3 (os x 10.5) #2127

bdbaddog opened this issue Jan 2, 2018 · 2 comments

Comments

@bdbaddog
Copy link
Contributor

bdbaddog commented Jan 2, 2018

This issue was originally created at: 2008-07-03 17:04:31.
This issue was reported by: lukasnellen.

lukasnellen said at 2008-07-03 17:04:32

One of the changes Apple introduced in Leopard (os x 10.5) is the support for RPATH (see http://developer.apple.com/releasenotes/DeveloperTools/RN-dyld/index.html). This means that issue #1892 and its solution don't hold anymore.

Unfortunately, the implementation of rpath differs from that under linux, so that simply switching back to gnulink might not be the right way to make portable builds easy.

gregnoel said at 2008-07-15 20:27:25

Bug party triage. Gary to look at the OS X versions and see if rpath variations can be categorized. If they can, assign the issue to an actual milestone based on the complexity.

This is part of a larger issue concerning changes by OS X with newer versions; at least one other place is the keywords needed for shared libraries and bundles. Perhaps some secondary identifier should be extracted when it's determined that the platform is OS X; other code could key off the identifier as such changes are identified.

garyo said at 2008-10-29 19:06:35

Here's what I learned.

  • gcc on 10.5 supports -rpath, earlier versions didn't. But it is a little odd, in that it only sets the path for special libs/frameworks linked in a certain way.
  • We can check the Mac OS version with /usr/bin/sw_version:
% /usr/bin/sw_vers
ProductName:    Mac OS X
ProductVersion: 10.4.11
BuildVersion:   8S2167
  • dyld (MacOS X version of ld) supports executables with RPATH, but only searches for libs/frameworks with install names beginning with @rpath. See the tech note above. Not totally relevant to this bug, but will be needed to make a test case.

Simplest way forward is to use gnulink again, but only allow RPATH if the linker supports it, either by parsing sw_vers or doing a test link a la autotools. Otherwise ignore RPATH setting.

Since I've researched this now, I'm resetting it back to unspecified. I don't think it's a huge deal to fix now, so I recommend 2.x/p4 unless someone has a need for it earlier. And of course users can always just add the RPATH setting to LINKCOM anyway, that's why I suggest p4.

garyo said at 2008-10-29 19:07:08

... and changing owner back to nobody.

gregnoel said at 2008-11-21 16:48:34

Bug party triage. Getting OS-specific version info can easily be factored into the toolchain revamp, which will also restructure how platform configuration is done, so include it with that work.

gregnoel said at 2008-12-26 13:20:23

Adjust triage of issues.

@dmoody256
Copy link
Contributor

semi-related Stack Overflow:
https://stackoverflow.com/questions/54591196/py-initialize-throws-modulenotfounderror-no-module-named-encodings/54604729#54604729

Rpath had to passed in the LINKFLAGS instead of RPATH because it's not supported correctly on OSX.

@mwichmann
Copy link
Collaborator

@bdbaddog any thoughts on this old issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants