gentoo-x86 / # emerge -pv1 pbzip2 [ebuild N ~] app-arch/pbzip2-1.1.6 USE="static -symlink" 0 kB gentoo-x86 / # emerge -1 pbzip2 >>> Emerging (1 of 1) app-arch/pbzip2-1.1.6 * pbzip2-1.1.6.tar.gz RMD160 SHA1 SHA256 size ;-) ... [ ok ] >>> Unpacking source... >>> Unpacking pbzip2-1.1.6.tar.gz to /var/tmp/portage/app-arch/pbzip2-1.1.6/work >>> Source unpacked in /var/tmp/portage/app-arch/pbzip2-1.1.6/work >>> Preparing source in /var/tmp/portage/app-arch/pbzip2-1.1.6/work/pbzip2-1.1.6 ... * Applying pbzip2-1.1.6-makefile.patch ... [ ok ] >>> Source prepared. >>> Configuring source in /var/tmp/portage/app-arch/pbzip2-1.1.6/work/pbzip2-1.1.6 ... >>> Source configured. >>> Compiling source in /var/tmp/portage/app-arch/pbzip2-1.1.6/work/pbzip2-1.1.6 ... make -j3 i686-pc-linux-gnu-g++ -O2 -march=i686 -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_POSIX_PTHREAD_SEMANTICS -DUSE_STACKSIZE_CUSTOMIZATION -pthread -Wl,-O1 -Wl,--as-needed -static pbzip2.cpp BZ2StreamScanner.cpp ErrorContext.cpp -lbz2 -lpthread -o pbzip2 pbzip2.cpp: In function 'int directdecompress(const char*, const char*)': pbzip2.cpp:2426:66: warning: ignoring return value of 'size_t fwrite(const void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result pbzip2.cpp:2447:63: warning: ignoring return value of 'size_t fwrite(const void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result /usr/lib/gcc/i686-pc-linux-gnu/4.5.3/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lbz2 collect2: ld returned 1 exit status make: *** [pbzip2] Error 1 * ERROR: app-arch/pbzip2-1.1.6 failed (compile phase): * emake failed * * If you need support, post the output of 'emerge --info =app-arch/pbzip2-1.1.6', * the complete build log and the output of 'emerge -pqv =app-arch/pbzip2-1.1.6'. * The complete build log is located at '/var/tmp/portage/app-arch/pbzip2-1.1.6/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/app-arch/pbzip2-1.1.6/temp/environment'. * S: '/var/tmp/portage/app-arch/pbzip2-1.1.6/work/pbzip2-1.1.6' --- This is from an x86 system, but it fails the same way also on an amd64 system. Without use flag 'static' everything compiles fine, but I would like a static build :-) Also doesn't work for older ebuilds ob pbzip2. Reproducible: Always Steps to Reproduce: 1. USE=static emerge -1 pbzip2 2. watch it fail Expected Results: Compile and built a static version of pbzip2
I found the reason why compiling fails: If you want to be able to emerge pbzip2 with the use flag 'static' you need to already have emerged app-arch/bzip2 with use flag 'static-libs' otherwise it won't work because pbzip2 seems to needs those static libs. Could someone please add this as a requirement to the pbzip2 ebuild so emerge can then complain that the use flag for bzip2 needs to be changed when trying to emerge pbzip2 with USE="static"? That would be much better than failing with a strange compiler error :) Thanks!
Fixed in CVS a few weeks ago.