Skip to content

Disable RPath usage on macOS - #7076

Closed
angerman wants to merge 1 commit into
masterfrom
angerman/drop-rpath
Closed

angerman wants to merge 1 commit into
masterfrom
angerman/drop-rpath

Conversation

@angerman

@angerman angerman commented Sep 17, 2020 •

Copy link
Copy Markdown
Collaborator

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)

@phadej phadej left a comment •

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 done
@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.

2 participants