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

Disable RPath usage on macOS #7076

Closed
wants to merge 1 commit into from
Closed

Disable RPath usage on macOS #7076

wants to merge 1 commit into from

Conversation

angerman
Copy link
Collaborator

@angerman angerman commented Sep 17, 2020

This interferes with dead_strip_dylib, and pollutes the load commands,
which have a size limit in recent macOS versions. We now rely on GHC
to construct the correct -rpath entries after the linking phase by
inspecting the produced dynamic product and adding -rpaths for all
non-dead-stripped referenced libraries.

See https://gitlab.haskell.org/ghc/ghc/-/commit/4ff93292243888545da452ea4d4c1987f2343591
or ghc/ghc@4ff9329


Please include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog (add file to changelog.d directory).
  • The documentation has been updated, if necessary.

Please also shortly describe how you tested your change. Bonus points for added tests!

This interferes with dead_strip_dylib, and pollutes the load commands,
which have a size limit in recent macOS versions.  We now rely on GHC
to construct the correct -rpath entries *after* the linking phase by
inspecting the produced dynamic product and adding -rpaths for all
non-dead-stripped referenced libraries.

See https://gitlab.haskell.org/ghc/ghc/-/commit/4ff93292243888545da452ea4d4c1987f2343591
or  ghc/ghc@4ff9329

Commissioned-by: Mercury Technologies, Inc. (mercury.com)
Copy link
Collaborator

@phadej phadej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no tests.

What happens with GHC-8.6 and older?

-- well as being part of GHC 9.2 onwards.
--
-- We know the GHC in question supports this if it knows about
-- `install_name_tool` or `otool`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This suggests that there should some check of install_name_tool?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Need to figure out how.

@angerman
Copy link
Collaborator Author

I see no tests.

Do you have suggestions how to test this properly? Effectively we strip cabal from passing -rpath values to ghc, and ghc will then do some post-link processing to inject the necessary rpaths.

What happens with GHC-8.6 and older?

Won't get this feature. Hence cabal should pass -rpath values for older ghcs, but in general we should try to detect this based on the ghc at hand, in case someone decides to backport this to their favorit ghc.

@angerman angerman closed this Sep 28, 2020
@angerman angerman deleted the angerman/drop-rpath branch September 28, 2020 05:40
@angerman angerman mentioned this pull request Sep 28, 2020
3 tasks
@Mikolaj Mikolaj mentioned this pull request Aug 11, 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.

None yet

2 participants