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

tutorial binaries lacking LC_RPATH loader command in macOS #32

Open
dreness opened this issue Jun 14, 2021 · 1 comment
Open

tutorial binaries lacking LC_RPATH loader command in macOS #32

dreness opened this issue Jun 14, 2021 · 1 comment

Comments

@dreness
Copy link

dreness commented Jun 14, 2021

Hello!

Maybe I'm the only person to try the samples under macOS, because it seems like they can't possibly work as written. In a nutshell, the built binaries try to load libRadeonProRender64.dylib at the path @rpath/libRadeonProRender64.dylib, however no LC_RPATH loader command is present, so at runtime the dylib is not found and the process exits.

andre@boop RadeonProRenderSDK % ./tutorials/Bin/03_instance64                                            
dyld: Library not loaded: @rpath/libRadeonProRender64.dylib
  Referenced from: /Users/andre/work/RadeonProRenderSDK/./tutorials/Bin/03_instance64
  Reason: image not found
zsh: abort      ./tutorials/Bin/03_instance64

andre@boop RadeonProRenderSDK % otool -l tutorials/Bin/03_instance64 | egrep -A 2 -i 'lc_load_dylib|lc_rpath' 
          cmd LC_LOAD_DYLIB
      cmdsize 64
         name @rpath/libRadeonProRender64.dylib (offset 24)
--
          cmd LC_LOAD_DYLIB
      cmdsize 48
         name /usr/lib/libc++.1.dylib (offset 24)
--
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libSystem.B.dylib (offset 24)

Adding a load command to set LC_RPATH solves the problem. In my case:

andre@boop RadeonProRenderSDK % install_name_tool -add_rpath /Users/andre/work/RadeonProRenderSDK/RadeonProRender/binMacOS tutorials/Bin/03_instance64 

andre@boop RadeonProRenderSDK % otool -l tutorials/Bin/03_instance64 | egrep -A 2 -i 'lc_load_dylib|lc_rpath'
          cmd LC_LOAD_DYLIB
      cmdsize 64
         name @rpath/libRadeonProRender64.dylib (offset 24)
--
          cmd LC_LOAD_DYLIB
      cmdsize 48
         name /usr/lib/libc++.1.dylib (offset 24)
--
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libSystem.B.dylib (offset 24)
--
          cmd LC_RPATH
      cmdsize 80
         path /Users/andre/work/RadeonProRenderSDK/RadeonProRender/binMacOS (offset 12)

andre@boop RadeonProRenderSDK % ./tutorials/Bin/03_instance64 
Radeon ProRender SDK simple rendering tutorial.
Context successfully created.
Rendering finished.
@dreness dreness changed the title tutorial binaries lacking LC_RPATH load command in macOS tutorial binaries lacking LC_RPATH loader command in macOS Jun 14, 2021
@bsavery
Copy link

bsavery commented Jun 15, 2021

Hey @dreness Correct, but to be fair, I think is more just a lack of documentation rather than a bug. But we should note it somewhere.

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

No branches or pull requests

2 participants