Opened 14 years ago

Closed 14 years ago

#27090 closed defect (fixed)

llvm: libLLVM-2.8.dylib wrong install_name

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: erickt@…
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: Cc: mfeiri
Port: llvm

Description

In troubleshooting a pure 0.45 build issue, its developer 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.

Attachments (1)

llvm-2.8_2.diff (932 bytes) - added by ryandesign (Ryan Carsten Schmidt) 14 years ago.
proposed patch

Download all attachments as: .zip

Change History (2)

Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: llvm-2.8_2.diff added

proposed patch

comment:1 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

Committed in r73125 (maintainer timeout) because I am anxious to update pure to 0.45.

Note: See TracTickets for help on using tickets.