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

Bug 610936

Summary: dev-libs/libzip-1.1.3: fails to link on musl libc
Product: Gentoo Linux Reporter: A. Wilcox (awilfox) <awilfox.gentoo>
Component: Current packagesAssignee: Gentoo KDE team <kde>
Status: RESOLVED FIXED    
Severity: normal CC: creffett, musl
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/Galapagos-Linux/main/commit/985c60094e5541c9df48db667005377fddc1614d
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 430702    
Attachments: Use fts-standalone on musl libc

Description A. Wilcox (awilfox) 2017-02-25 23:00:09 UTC
Created attachment 465166 [details, diff]
Use fts-standalone on musl libc

libtool: link: gcc -O2 -ggdb -march=nocona -mtune=core2 -fno-omit-frame-pointer -mfpmath=sse -o .libs/zipcmp zipcmp.o  ../lib/.libs/libzip.so -lz
zipcmp.o: In function `list_directory':
/var/tmp/portage/dev-libs/libzip-1.1.3/work/libzip-1.1.3/src/zipcmp.c:320: undefined reference to `fts_open'
/var/tmp/portage/dev-libs/libzip-1.1.3/work/libzip-1.1.3/src/zipcmp.c:328: undefined reference to `fts_read'
/var/tmp/portage/dev-libs/libzip-1.1.3/work/libzip-1.1.3/src/zipcmp.c:376: undefined reference to `fts_close'
/var/tmp/portage/dev-libs/libzip-1.1.3/work/libzip-1.1.3/src/zipcmp.c:366: undefined reference to `fts_close'
collect2: error: ld returned 1 exit status
Makefile:411: recipe for target 'zipcmp' failed


Attached is a patch that:

- adds sys-libs/fts-standalone to [R]DEPEND when elibc_musl
- adds simple check to configure.ac
- revbump to inherit autotools for 'eautoreconf'


Tested on musl and glibc (changes nothing on glibc, builds correctly on musl).
Comment 1 Michael Palimaka (kensington) gentoo-dev 2017-03-02 10:55:10 UTC
Any chance of sending upstream? They seem semi-alive.
Comment 2 Felix Janda 2017-03-02 14:36:27 UTC
I just tried checked out upstream version 1.2.0 on a musl system and it
built fine out of the box. I think that 1.1.3 should also work fine if
sys-libs/fts-standalone is NOT installed.

The point is that there are configure tests for fts but they only check
for presence of fts.h and not whether it is necessary to link to an
additional library. (This is not surprising since I don't think that
any other system has an external libfts.)

fts is only used in the directory comparison of zipcmp.
Comment 3 Andreas Sturmlechner gentoo-dev 2017-03-17 19:49:13 UTC
Well, there has been a recent release 1.2.0 that kde-apps/ark is now optionally depending on. So I've added your patch for the 1.2.0 version bump in git commit 9a609ec75673220be26e8ca4f8f7164cf3262aa2 and also sent my own ballon d'essai to their mailing list about their half-finished cmake support, we'll see how it goes.