[arch-dev-public] libarchive, pacman, and libtool-slaying

Jan de Groot jan at jgc.homeip.net
Wed Jun 20 11:30:53 EDT 2007


On Tue, 2007-06-19 at 20:36 -0400, Dan McGee wrote:

> OK- if I bootstrap build it a bit, I definitely get rid of the weird
> libarchive.so.1 dependency. I think it was do to LD_LIBRARY_PATH and
> some resolving issues in finding the library. However, this brings us
> to part 2. pacman (dynamically linked) builds fine without libtool
> archive files, but pacman.static now fails to build, with the
> following output coming during its linking stage:
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_read_support_compression_bzip2.o):
> In function `init':
> (.text+0x136): undefined reference to `BZ2_bzDecompressInit'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_read_support_compression_bzip2.o):
> In function `init':
> (.text+0x16c): undefined reference to `BZ2_bzDecompressInit'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_read_support_compression_bzip2.o):
> In function `finish':
> (.text+0x2b1): undefined reference to `BZ2_bzDecompressEnd'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_read_support_compression_bzip2.o):
> In function `read_ahead':
> (.text+0x414): undefined reference to `BZ2_bzDecompress'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_read_support_compression_gzip.o):
> In function `init':
> (.text+0xe0): undefined reference to `crc32'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_read_support_compression_gzip.o):
> In function `init':
> (.text+0x161): undefined reference to `inflateInit2_'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_read_support_compression_gzip.o):
> In function `finish':
> (.text+0x2b1): undefined reference to `inflateEnd'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_read_support_compression_gzip.o):
> In function `read_ahead':
> (.text+0x4f4): undefined reference to `inflate'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_read_support_compression_gzip.o):
> In function `read_ahead':
> (.text+0x50f): undefined reference to `crc32'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_read_support_format_zip.o):
> In function `archive_read_format_zip_cleanup':
> (.text+0x293): undefined reference to `inflateEnd'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_read_support_format_zip.o):
> In function `archive_read_format_zip_read_data':
> (.text+0x432): undefined reference to `inflateReset'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_read_support_format_zip.o):
> In function `archive_read_format_zip_read_data':
> (.text+0x4ac): undefined reference to `inflate'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_read_support_format_zip.o):
> In function `archive_read_format_zip_read_data':
> (.text+0x587): undefined reference to `inflateInit2_'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x3e6): undefined reference to `acl_init'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x435): undefined reference to `acl_create_entry'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x45c): undefined reference to `acl_set_tag_type'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x46e): undefined reference to `acl_get_permset'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x479): undefined reference to `acl_clear_perms'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x4aa): undefined reference to `acl_add_perm'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x4c2): undefined reference to `acl_set_tag_type'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x4d7): undefined reference to `acl_set_tag_type'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x503): undefined reference to `acl_set_qualifier'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x51b): undefined reference to `acl_set_tag_type'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x533): undefined reference to `acl_set_tag_type'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x55f): undefined reference to `acl_set_qualifier'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x577): undefined reference to `acl_set_tag_type'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x58f): undefined reference to `acl_add_perm'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x5a7): undefined reference to `acl_add_perm'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x5dc): undefined reference to `acl_set_file'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x5ed): undefined reference to `acl_free'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libarchive.a(libarchive_la-archive_write_disk.o):
> In function `set_acl':
> (.text+0x609): undefined reference to `acl_set_fd'
> collect2: ld returned 1 exit status
> make[3]: *** [pacman.static] Error 1
> make[3]: Leaving directory
> `/home/dmcgee/projects/repos/arch/build/base/pacman/src/pacman-3.0.5/src/pacman'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory
> `/home/dmcgee/projects/repos/arch/build/base/pacman/src/pacman-3.0.5/src/pacman'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory
> `/home/dmcgee/projects/repos/arch/build/base/pacman/src/pacman-3.0.5'
> make: *** [all] Error 2
> ==> ERROR: Build Failed.  Aborting...
> 
> Any suggestions? I'd really like to be able to package libarchive
> without libtool files.
> 

This is a common example of libraries that weren't linked correctly. In
this case, the problem is in libarchive.a, which didn't link to its
dependencies. Libarchive expects your application to use libtool to
find the link dependencies and link them by hand. As you removed the
libtool files, the additional libraries are not linked to libarchive.
There's two ways to fix this:
- build libarchive with libtool files included
- change linker flags for libarchive.a to include the missing ones

As libarchive is not a common lib used by many applications, and as
pacman(.static) actually needs these linked libs, I would choose to
leave the libtool files in the package. You don't know what changes in
this library for the next version, you'll end up patching it everytime.





More information about the arch-dev-public mailing list