Skip to content

Fix macOS rpath: emit one -rpath per path instead of colon-joining - #358

Merged
ndgrigorian merged 3 commits into
masterfrom
use-proper-rpath-set-for-macos
Aug 4, 2026
Merged

Fix macOS rpath: emit one -rpath per path instead of colon-joining#358
ndgrigorian merged 3 commits into
masterfrom
use-proper-rpath-set-for-macos

Conversation

@vlad-perevezentsev

Copy link
Copy Markdown
Collaborator

In #351 the extensions' runtime search path by colon-joining two paths into a single -Wl,-rpath, argument:

-Wl,-rpath,$ORIGIN/../..:$ORIGIN/../../..

Colon-as-separator is an ELF/Linux convention. On macOS (Mach-O) each -rpath produces exactly one LC_RPATH load command and the string is taken verbatim — the colon is not a separator. As a result, macOS extensions shipped a single unusable rpath entry:

LC_RPATH: @loader_path/../..:@loader_path/../../..   ← no such directory

This PR emits one -Wl,-rpath, argument per path, restoring the exact per-entry behavior of the legacy setup.py (runtime_library_dirs=["$ORIGIN/../..", "$ORIGIN/../../.."]). This is correct on both Mach-O and ELF.

@vlad-perevezentsev vlad-perevezentsev self-assigned this Aug 3, 2026
@vlad-perevezentsev vlad-perevezentsev changed the title Fix macOS rpath: emit one -rpath per path instead of colon-joining- #222 Fix macOS rpath: emit one -rpath per path instead of colon-joining Aug 3, 2026
@antonwolfy antonwolfy added this to the 2.4.0 release milestone Aug 3, 2026
Comment thread meson.build
@ndgrigorian
ndgrigorian merged commit 28fe526 into master Aug 4, 2026
121 of 122 checks passed
@ndgrigorian
ndgrigorian deleted the use-proper-rpath-set-for-macos branch August 4, 2026 06:10
vlad-perevezentsev added a commit that referenced this pull request Aug 4, 2026
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.

3 participants