Skip to content
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

ARM: gz-plugin2 CLI executable has broken RPATH #2403

Closed
scpeters opened this issue Sep 13, 2023 · 1 comment · Fixed by #2404
Closed

ARM: gz-plugin2 CLI executable has broken RPATH #2403

scpeters opened this issue Sep 13, 2023 · 1 comment · Fixed by #2404
Labels

Comments

@scpeters
Copy link
Member

Description:

The executable in gz-plugin2's libexec folder is not able to load the libgz-plugin2-loader.2.dylib library when using an ARM processor with homebrew installed in /opt/homebrew:

$(brew --prefix)/opt/gz-plugin2/libexec/gz/plugin2/gz-plugin
dyld[90133]: Library not loaded: '@rpath/libgz-plugin2-loader.2.dylib'
  Referenced from: '/opt/homebrew/Cellar/gz-plugin2/2.0.1/libexec/gz/plugin2/gz-plugin'
  Reason: tried: '/opt/homebrew/Cellar/gz-plugin2/2.0.1/libexec/gz/plugin2/../lib/libgz-plugin2-loader.2.dylib' (no such file), '/opt/homebrew/Cellar/gz-plugin2/2.0.1/libexec/gz/plugin2/../lib/libgz-plugin2-loader.2.dylib' (no such file), '/usr/local/lib/libgz-plugin2-loader.2.dylib' (no such file), '/usr/lib/libgz-plugin2-loader.2.dylib' (no such file)
Abort trap: 6

Please supply your brew configuration:

$ brew config
HOMEBREW_VERSION: 4.1.11-2-geacdf7a
ORIGIN: https://github.com/Homebrew/brew
HEAD: eacdf7aa60a1a8a64acc71853ec5559cfd2329c3
Last commit: 22 hours ago
Core tap origin: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 6ff75ff4ca4500b187f786536ed90867fa1db3d7
Core tap last commit: 7 hours ago
Core tap branch: master
Core tap JSON: 12 Sep 19:39 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 14.0.0 build 1400
Git: 2.37.1 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.1.2 => /usr/bin/curl
macOS: 12.6.8-arm64
CLT: 14.2.0.0.1.1668646533
Xcode: N/A
Rosetta 2: false

A test for this is being added to the gz-plugin2 formula in #2402, but it is not yet fixed.

@scpeters scpeters added the bug label Sep 13, 2023
@scpeters
Copy link
Member Author

Currently RPATH is added to our homebrew formulae by adding -DCMAKE_INSTALL_RPATH=#{rpath} to the cmake arguments (see gz-plugin2.rb for example). The default value of rpath resolves to "@loader_path/../lib", which works when the @loader_path is a sibling of <prefix>/lib, like <prefix>/bin, but it does not work for <prefix/libexec/gz/plugin2/gz-plugin.

Since specifying CMAKE_INSTALL_RPATH when invoking cmake will apply to all targets within a project, it may be necessary to set INSTALL_RPATH as a property for each target depending on their relative path to the lib folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant