Skip to content

[macOS] Standardize dynamic library paths using @rpath #1146

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

Merged
merged 5 commits into from
Jun 7, 2025

Conversation

perazz
Copy link
Member

@perazz perazz commented May 20, 2025

On macOS, use @rpath for shared libraries to support relocatable builds.

  • Link shared libs with @rpath/lib<name>.dylib
  • Patch installed executables with:
    • @executable_path
    • @executable_path/../lib
  • Add -headerpad at link time to allow post-install rpath injection

Supports both flat and bin/lib/include install layouts. No effect on non-macOS platforms.

cc: @jacobwilliams

@perazz perazz merged commit 6908108 into fortran-lang:main Jun 7, 2025
27 checks passed
@perazz perazz deleted the macos_library_install branch June 7, 2025 07:02
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.

1 participant