[MacPorts] #54939: osxfuse @3.7.1: Library not loaded: @rpath/libclang.dylib (LoadError)

MacPorts noreply at macports.org
Sat Oct 14 17:46:01 UTC 2017


#54939: osxfuse @3.7.1: Library not loaded: @rpath/libclang.dylib (LoadError)
-----------------------+------------------------
  Reporter:  pmetzger  |      Owner:  drkp
      Type:  defect    |     Status:  assigned
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:
Resolution:            |   Keywords:  highsierra
      Port:  osxfuse   |
-----------------------+------------------------

Comment (by kencu):

 This is a minor macOS bug. The rpath in
 `/System/Library/BridgeSupport/ruby-2.3/bridgesupportparser.bundle` points
 towards a non-existant path in the released version of Xcode 9, and there
 is no copy of libclang.dylib in the default search paths `/usr/lib` and
 `/usr/local/lib`

 {{{
 $ otool -l
 /System/Library/BridgeSupport/ruby-2.3/bridgesupportparser.bundle | grep
 -A2 LC_RPATH
           cmd LC_RPATH
       cmdsize 96
          path
 /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.13.xctoolchain/usr/lib
 (offset 12)
 }}}
 but
 {{{
 $ cd /Applications/Xcode.app/Contents/Developer/Toolchains
 $ ls
 XcodeDefault.xctoolchain
 }}}

 You should be able to fix it by adding or replacing the rpath, like this
 for exampe:
 {{{
 $ sudo install_name_tool -add_rpath
 /Applications/Xcode.app/Contents/Frameworks/
 /System/Library/BridgeSupport/ruby-2.3/bridgesupportparser.bundle
 }}}
 but SIP, presumably, stops you:
 {{{
 error: install_name_tool: can't open input file:
 /System/Library/BridgeSupport/ruby-2.3/bridgesupportparser.bundle for
 writing (Operation not permitted)
 error: install_name_tool: can't lseek to offset: 4096 in file:
 /System/Library/BridgeSupport/ruby-2.3/bridgesupportparser.bundle for
 writing (Bad file descriptor)
 error: install_name_tool: can't write new headers in file:
 /System/Library/BridgeSupport/ruby-2.3/bridgesupportparser.bundle (Bad
 file descriptor)
 error: install_name_tool: can't lseek to offset: 151552 in file:
 /System/Library/BridgeSupport/ruby-2.3/bridgesupportparser.bundle for
 writing (Bad file descriptor)
 error: install_name_tool: can't write new headers in file:
 /System/Library/BridgeSupport/ruby-2.3/bridgesupportparser.bundle (Bad
 file descriptor)
 error: install_name_tool: can't close written on input file:
 /System/Library/BridgeSupport/ruby-2.3/bridgesupportparser.bundle (Bad
 file descriptor)
 }}}

 I thought that setting the fallback path might work:
 {{{
 post-patch {
     system "export
 DYLD_FALLBACK_LIBRARY_PATH=/Applications/Xcode.app/Contents/Frameworks/"
 }
 }}}
 but it doesn't seem to, for some reason. That would be our main hope of
 fixing in the current Portfile.

 Making the symbolic link as noted above fixes the missing path, so it
 works. SIP doesn't stop you from messing in the XCode directory.

 I suspect this will be fixed in some soon-to-be-released macOS update.

 Another method of making the libclang.dylib available without disabling
 SIP is to symlink it into the default rpath search path:
 {{{
 sudo mkdir /usr/local/lib
 sudo ln -s /Applications/Xcode.app/Contents/Frameworks/libclang.dylib
 /usr/local/lib/libclang.dylib
 }}}

 I don't immediately see how to fix this in the Portfile, though.

--
Ticket URL: <https://trac.macports.org/ticket/54939#comment:12>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list