pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/45510: OS X bootstrap broken due to liblzma from /usr/local leaking into libarchive



>Number:         45510
>Category:       pkg
>Synopsis:       OS X bootstrap broken due to liblzma from /usr/local leaking 
>into libarchive
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 22 15:30:00 +0000 2011
>Originator:     Matthias Rampke
>Release:        Mac OS X Lion
>Organization:
>Environment:
Darwin mb.local 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug  9 20:54:00 PDT 
2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64
>Description:
If xz from Homebrew is installed in /usr/local, bootstrapping with the default 
options is broken because libarchive finds a "usable" lzma.h, but since 
Homebrew is 64-bit by default, pkgsrc 32-bit, the corresponding symbols are not 
there for i386. Therefore linking pkg_create fails due to unresolved symbols in 
libarchive.a:


gcc -isystem /usr/include -DHAVE_CONFIG_H -D_LARGEFILE_SOURCE -D_LARGE_FILES 
-D_FILE_OFFSET_BITS=64 -DDEF_UMASK=0022 -I/Users/m
atthias/src/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libarchive/libarchive
 -I/Users/matthias/src/pkgsrc/bootstrap/wo
rk/wrk/pkgtools/pkg_install/work/libfetch -DHAVE_NBCOMPAT_H=1 
-I/Users/matthias/src/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_inst
all/work/libnbcompat -no-cpp-precomp -isystem /usr/include -I/usr/include -I. 
-I. -I../lib -pipe -O2 -I/usr/include -c build.c
gcc -isystem /usr/include 
-L/Users/matthias/src/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libarchive/.libs
 -Wl,-searc
h_paths_first 
-L/Users/matthias/src/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libfetch
 -L/Users/matthias/src/pkgsrc/b
ootstrap/work/wrk/pkgtools/pkg_install/work/libnbcompat -L/usr/lib 
-L/usr/pkg/lib -L../lib -o pkg_create main.o perform.o pl.o 
util.o build.o -linstall -lfetch -larchive -lbz2 -lz -lnbcompat -lcrypto 
-lcrypto -lcrypto -lcrypto -lnbcompat
Undefined symbols for architecture i386:
  "_lzma_end", referenced from:
      _archive_compressor_xz_finish in 
libarchive.a(archive_write_set_compression_xz.o)
  "_lzma_lzma_preset", referenced from:
      _archive_compressor_xz_init in 
libarchive.a(archive_write_set_compression_xz.o)
  "_lzma_stream_encoder", referenced from:
      _archive_compressor_xz_init in 
libarchive.a(archive_write_set_compression_xz.o)
  "_lzma_alone_encoder", referenced from:
      _archive_compressor_xz_init in 
libarchive.a(archive_write_set_compression_xz.o)
  "_lzma_code", referenced from:
      _drive_compressor in libarchive.a(archive_write_set_compression_xz.o)
  "_lzma_memusage", referenced from:
      _drive_compressor in libarchive.a(archive_write_set_compression_xz.o)
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status



This would probably also happen on other operating systems, but becomes obvious 
on OS X especially because of multi-arch and multiple package managers.

>How-To-Repeat:
bootstrap on Mac OS X with 64-bit-only xz (e.g. from Homebrew) in /usr/local


>Fix:
Workaround: brew unlink xz && bootstrap && brew link xz

non-general fix:

diff --git a/pkgtools/pkg_install/Makefile b/pkgtools/pkg_install/Makefile
index 5436787..527373a 100644
--- a/pkgtools/pkg_install/Makefile
+++ b/pkgtools/pkg_install/Makefile
@@ -170,7 +170,7 @@ pre-configure:
                ${CONFIG_SHELL} ${CONFIG_SHELL_FLAGS}                   \
                ./configure --disable-shared --disable-bsdtar           \
                --disable-bsdcpio --without-expat --without-xml2        \
-               --disable-dependency-tracking
+               --disable-dependency-tracking --without-lzma
        cd ${WRKDIR}/libarchive && ${BUILD_MAKE_CMD}
 .endif
        cd ${WRKDIR}/libfetch && ${SETENV} ${MAKE_ENV} ${BSD_MAKE_ENV}  \


but the problem will keep popping up in other places. Not sure how to fix that.



Home | Main Index | Thread Index | Old Index