make: improve make (install) on macOS#404
Merged
Merged
Conversation
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>
Contributor
Author
|
@jow- good if you could take this for a spin |
Owner
|
Merged, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 --prefixto see where the homebrew environment is.Then set rpath for the built libs. This prevents problems like:
where
make installdoes:This change prevents manual interventions (for arm64) like:
LDFLAGS += -Wl,-rpath,/opt/homebrew/libor
install_name_tool -add_rpath /opt/homebrew/lib /opt/homebrew/bin/ucode