[MacPorts] #27090: llvm: libLLVM-2.8.dylib wrong install_name

MacPorts noreply at macports.org
Sun Oct 31 18:04:53 PDT 2010


#27090: llvm: libLLVM-2.8.dylib wrong install_name
-------------------------------------+--------------------------------------
 Reporter:  ryandesign@…             |       Owner:  erickt@…           
     Type:  defect                   |      Status:  new                
 Priority:  Normal                   |   Milestone:                     
Component:  ports                    |     Version:  1.9.1              
 Keywords:                           |        Port:  llvm               
-------------------------------------+--------------------------------------
 In troubleshooting a pure 0.45 build issue, its developer
 [http://groups.google.com/group/pure-lang/msg/109b9577a084bc08 asked me to
 try] adding "-lLLVM-2.8" to the LDFLAGS. When I did so, I noticed a
 problem with the libLLVM-2.8.dylib that the llvm port installs:

 {{{
 dyld: Library not loaded: @executable_path/../lib/libLLVM-2.8.dylib
  Referenced from:
 /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_pure/work/pure-0.45/./conftest
  Reason: image not found
 }}}

 I see the llvm port already has a post-destroot foreach loop to correct
 the install_name of three libraries -- libBugpointPasses.dylib,
 libLLVMHello.dylib and libprofile_rt.dylib -- but leaves its three other
 libraries -- libEnhancedDisassembly.dylib, libLLVM-2.8.dylib and
 libLTO.dylib -- with what look to be incorrect install_names:

 {{{
 $ port installed llvm
 The following ports are currently installed:
   llvm @2.8_1 (active)
 $ port contents llvm | grep dylib | xargs otool -D
 /opt/local/lib/libBugpointPasses.dylib:
 /opt/local/lib/libBugpointPasses.dylib
 /opt/local/lib/libEnhancedDisassembly.dylib:
 @rpath/libEnhancedDisassembly.dylib
 /opt/local/lib/libLLVM-2.8.dylib:
 @executable_path/../lib/libLLVM-2.8.dylib
 /opt/local/lib/libLLVMHello.dylib:
 /opt/local/lib/libLLVMHello.dylib
 /opt/local/lib/libLTO.dylib:
 @executable_path/../lib/libLTO.dylib
 /opt/local/lib/libprofile_rt.dylib:
 /opt/local/lib/libprofile_rt.dylib
 }}}

 The attached patch adds these other libraries to the foreach loop so all
 of them get their install_names corrected, with the following result:

 {{{
 $ port installed llvm
 The following ports are currently installed:
   llvm @2.8_1
   llvm @2.8_2 (active)
 $ port contents llvm | grep dylib | xargs otool -D
 /opt/local/lib/libBugpointPasses.dylib:
 /opt/local/lib/libBugpointPasses.dylib
 /opt/local/lib/libEnhancedDisassembly.dylib:
 /opt/local/lib/libEnhancedDisassembly.dylib
 /opt/local/lib/libLLVM-2.8.dylib:
 /opt/local/lib/libLLVM-2.8.dylib
 /opt/local/lib/libLLVMHello.dylib:
 /opt/local/lib/libLLVMHello.dylib
 /opt/local/lib/libLTO.dylib:
 /opt/local/lib/libLTO.dylib
 /opt/local/lib/libprofile_rt.dylib:
 /opt/local/lib/libprofile_rt.dylib
 }}}

 And pure 0.45 then builds fine (with -lLLVM-2.8 in LDFLAGS).

 My patch also increases the port revision since users will need to rebuild
 llvm to get this change.

 The reason the patch also modifies the dist_subdir line is because
 otherwise users and mirror servers would be made to download the distfiles
 again, but there is no need to do that since they have not changed since
 revision 1. This line should finally be removed when the port is updated
 to the next version of llvm and hopefully if we're lucky the developers of
 llvm will refrain from inflicting any further stealth updates on us.

-- 
Ticket URL: <https://trac.macports.org/ticket/27090>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list