Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 455126 - Failed to emerge app-arch/bzip2-1.0.6-r3: invalid reference to libbz2.1.dylib
Summary: Failed to emerge app-arch/bzip2-1.0.6-r3: invalid reference to libbz2.1.dylib
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: PPC OS X
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-02 14:13 UTC by Konstantin Tokarev
Modified: 2013-07-12 20:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
small change in the ebuild to get the correct install name. (fix-bzip2-installname.patch,382 bytes, patch)
2013-02-04 21:17 UTC, François Bissey
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Tokarev 2013-02-02 14:13:27 UTC
Compiles fine, after installation error messages appears:

 * QA Notice: invalid reference to /Users/konstantintokarev/Gentoo/usr/lib/libbz2.1.dylib in /Users/konstantintokarev/Gentoo/bin/bzip2
 * ERROR: app-arch/bzip2-1.0.6-r3 failed:
 *   invalid install_name found, your application or library will crash at runtime
Comment 1 François Bissey 2013-02-04 02:09:59 UTC
Installation fails with that message for me, 1.0.6-r1 fails the same way. I believe the final linking of libbzip2 has the "wrong" name:

i686-apple-darwin9-gcc -Wl,-dead_strip_dylibs -dynamiclib -install_name /Users/frb15/Desktop/Gentoo/usr/lib/libbz2.1.dylib -compatibility_version 1.0.0 -current_version 1.0.6 -o libbz2.1.0.6.dylib blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o

install name should be usr/lib/libbz2.1.0.6.dylib not usr/lib/libbz2.1.dylib.

I am looking at the ebuild.
Comment 2 François Bissey 2013-02-04 02:25:12 UTC
Hum, if I change bzip2-1.0.6-Makefile-bzip2_dylib to make the correction above, I get:

 * QA Notice: invalid reference to /Users/frb15/Desktop/Gentoo/usr/lib/libbz2.1.0.6.dylib in /Users/frb15/Desktop/Gentoo/bin/bzip2
 * ERROR: app-arch/bzip2-1.0.6-r3 failed:
 *   invalid install_name found, your application or library will crash at runtime

Which I guess is referring to the fact that on my system I currently only have:

ls -la usr/lib/libbz2*
lrwxrwxrwx 1 frb15 UOCNT\domain users 24 Mar  9  2012 usr/lib/libbz2.dylib -> ../../lib/libbz2.1.dylib

the real library living in lib not usr/lib, may be that's the real trouble. Testing further.
Comment 3 François Bissey 2013-02-04 02:31:35 UTC
I got it to install with two changes. One to the ebuild in src_compile
		*-darwin*)
			bemake PREFIX="${EPREFIX}"/lib -f Makefile-libbz2_dylib || die


and one in bzip2-1.0.6-Makefile-bzip2_dylib:
SOLDFLAGS=-dynamiclib -install_name $(PREFIX)/libbz2.1.dylib -compatibility_version 1.0.0 -current_version 1.0.6

I removed LIBDIR from that line.
It probably could be made more elegant but it works.
Comment 4 François Bissey 2013-02-04 21:06:19 UTC
Not the right place to mention this but readline has exactly the same problem. install_name in /usr/lib while the real library is in /lib.
Comment 5 François Bissey 2013-02-04 21:17:02 UTC
Created attachment 337940 [details, diff]
small change in the ebuild to get the correct install name.

The attached patch for the ebuild solve the problem completely. The main issue is that install_name was assume to be $PREFIX/usr/lib/lib*.dylib when it should be $PREFIX/lib/lib*.dylib.
Comment 6 Fabian Groffen gentoo-dev 2013-02-04 21:31:58 UTC
I found out what the problem was last sunday at FOSDEM.  We run gen_usr_ldscript -a before bzip is moved to /bin, therefore it isn't fixed.  So we should basically turn that around and then it will work as expected.
Comment 7 François Bissey 2013-02-26 23:37:21 UTC
Fabian made a different change that fixes the problem. This bug should be closed.
Comment 8 Fabian Groffen gentoo-dev 2013-07-12 20:03:45 UTC
fixed the other day, thanks!