Skip to content

make: improve make (install) on macOS#404

Merged
jow- merged 1 commit into
jow-:masterfrom
systemcrash:cmake
Jun 3, 2026
Merged

make: improve make (install) on macOS#404
jow- merged 1 commit into
jow-:masterfrom
systemcrash:cmake

Conversation

@systemcrash

Copy link
Copy Markdown
Contributor

This helps on Darwin when Rosetta is installed.

Rosetta does arm64/x86_64 translation, and can cause architecture detection problems in homebrew environments.

First, check brew --prefix to see where the homebrew environment is.

Then set rpath for the built libs. This prevents problems like:

dyld[27435]: Library not loaded: @rpath/libucode.0.dylib
  Referenced from: <B09194B4-6903-30AE-B2A8-153C0241E6B2> /opt/homebrew/bin/ucode
  Reason: no LC_RPATH's found

where make install does:

-- Installing: /opt/homebrew/bin/ucode
-- Installing: /opt/homebrew/lib/libucode.0.dylib
-- Installing: /opt/homebrew/lib/libucode.dylib
...

This change prevents manual interventions (for arm64) like:

LDFLAGS += -Wl,-rpath,/opt/homebrew/lib

or

install_name_tool -add_rpath /opt/homebrew/lib /opt/homebrew/bin/ucode

This helps on Darwin when Rosetta is installed.

Rosetta does arm64/x86_64 translation, and can cause
architecture detection problems in homebrew environments.

First, check `brew --prefix` to see where the homebrew
environment is.

Then set rpath for the built libs. This prevents problems like:

dyld[27435]: Library not loaded: @rpath/libucode.0.dylib
  Referenced from: <B09194B4-6903-30AE-B2A8-153C0241E6B2> /opt/homebrew/bin/ucode
  Reason: no LC_RPATH's found

where `make install` does:
```
-- Installing: /opt/homebrew/bin/ucode
-- Installing: /opt/homebrew/lib/libucode.0.dylib
-- Installing: /opt/homebrew/lib/libucode.dylib
...
```

This change prevents manual interventions (for arm64) like:

LDFLAGS += -Wl,-rpath,/opt/homebrew/lib

or

install_name_tool -add_rpath /opt/homebrew/lib /opt/homebrew/bin/ucode

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
@systemcrash

Copy link
Copy Markdown
Contributor Author

@jow- good if you could take this for a spin

@jow- jow- merged commit 3ec4e5c into jow-:master Jun 3, 2026
2 checks passed
@jow-

jow- commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Merged, thanks!

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