Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 542026

Summary: dev-libs/gobject-introspection-1.40.0-r2 compile error exec: ldd: not found on hardened/musl
Product: Gentoo Linux Reporter: Cato Auestad <cato>
Component: HardenedAssignee: Anthony Basile <blueness>
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 430702    
Attachments: Patch for the ebuild to create symlink
emerge --info
Build log

Description Cato Auestad 2015-03-03 17:25:03 UTC
Created attachment 397958 [details, diff]
Patch for the ebuild to create symlink

This bug should be assigned to who maintains the musl overlay.

dev-libs/gobject-introspection-1.40.0-r2 fails to install because "ldd" is not found. By looking at musl FAQ[0] they recommend creating a symlink between /lib/ld-musl-$ and /bin/ldd.

I tried this on a musl stage 3 installation (/lib/ -> /bin/ldd) and gobject-introspection compiled successfully. I suppose the symlink should be included in the stage3 tarball in the future. As a temporary solution, I have attached a small patch to the ebuild file which does the symlinking for me. I have tested it on hardened/musl x86_64.


Summary of the compile error:
libtool: link: x86_64-gentoo-linux-musl-gcc -o /var/tmp/portage/dev-libs/gobject-introspection-1.40.0-r2/work/gobject-introspection-1.40.0/tmp-introspectGntyyM/GLib-2.0 -fno-strict-aliasing -Wsign-compare -Wcast-align -Wpointer-arith -Wnested-externs -Wmissing-prototypes -Wmissing-declarations -Wchar-subscripts -Wall -O2 -pipe -fomit-frame-pointer -Wl,-O1 /var/tmp/portage/dev-libs/gobject-introspection-1.40.0-r2/work/gobject-introspection-1.40.0/tmp-introspectGntyyM/GLib-2.0.o -Wl,--export-dynamic -pthread -Wl,--export-dynamic  -Wl,--as-needed -lgio-2.0 -lgmodule-2.0 -lglib-2.0 -lgobject-2.0 -pthread
./libtool: line 10066: exec: ldd: not found
ERROR: can't resolve libraries to shared libraries: gobject-2.0, glib-2.0
Makefile:3386: recipe for target 'GLib-2.0.gir' failed
Comment 1 Cato Auestad 2015-03-03 17:25:37 UTC
Created attachment 397960 [details]
emerge --info
Comment 2 Cato Auestad 2015-03-03 17:25:54 UTC
Created attachment 397962 [details]
Build log
Comment 3 Anthony Basile gentoo-dev 2015-03-07 21:13:16 UTC
(In reply to Cato Auestad from comment #0)
> Created attachment 397958 [details, diff] [details, diff]
> Patch for the ebuild to create symlink

Unfortunately `uname -m` won't work.  musl's idea of an arch is whatever is under $(musl source)/arch directory.  So for $(uname -m) == i686 you need i386 :(

I've opted to proceed as follows:

@@ -84,6 +84,10 @@
 	if is_crosscompile ; then
 		dosym usr/include /usr/${CTARGET}/sys-include
+	# musl provides ldd via a sym link to its
+	local ldso=$(basename ${D}/lib/ld-musl-*)
+	dosym /lib/${ldso} /usr/bin/ldd
 pkg_postinst() {

I've added this to musl-9999.ebuild and will push it out with the 1.1.7 releases.  The real test will be to see if to works on the mipsel3 and armv7a stage3's.  (There's also felix's mips32r2 and ppc which have some issues I have yet to track down.)

Pleaes reopen if this is still a problem for you, or it doesn't work for some reason.