Bug #2076

[snapshots build broken] pkgsrc bootstrap fails with gcc44

Added by herrgard about 6 years ago. Updated about 6 years ago.

Target version:
Start date:
Due date:
% Done:



It fails at this step:
/pkg/lib -L../lib -o pkg_add main.o perform.o -linstall -lfetch -lcrypto -larchive -lnbcompat
../lib/libinstall.a(parse-config.o): In function `pkg_install_config':
parse-config.c:(.text+0x534): undefined reference to `fetchConnectionCacheInit'
../lib/libinstall.a(pkg_io.o): In function `fetch_archive_read':
pkg_io.c:(.text+0x112): undefined reference to `fetchIO_read'
pkg_io.c:(.text+0x1c4): undefined reference to `fetchStringifyURL'
pkg_io.c:(.text+0x201): undefined reference to `fetchIO_close'
pkg_io.c:(.text+0x277): undefined reference to `fetchIO_read'
../lib/libinstall.a(pkg_io.o): In function `fetch_archive_close':
pkg_io.c:(.text+0x2dd): undefined reference to `fetchIO_close'
../lib/libinstall.a(pkg_io.o): In function `open_archive_by_url':
pkg_io.c:(.text+0x32a): undefined reference to `fetchCopyURL'
pkg_io.c:(.text+0x33d): undefined reference to `fetchStringifyURL'
../lib/libinstall.a(pkg_io.o): In function `find_best_package_int':
pkg_io.c:(.text+0x558): undefined reference to `fetchUnquoteFilename'
pkg_io.c:(.text+0x62b): undefined reference to `fetchInitURLList'
pkg_io.c:(.text+0x657): undefined reference to `fetchStringifyURL'
pkg_io.c:(.text+0x69e): undefined reference to `fetchFreeURLList'
pkg_io.c:(.text+0x6dc): undefined reference to `fetchUnquoteFilename'
pkg_io.c:(.text+0x6ff): undefined reference to `fetchFreeURLList'
pkg_io.c:(.text+0x77c): undefined reference to `fetchCopyURL'
pkg_io.c:(.text+0x7f5): undefined reference to `fetchFreeURLList'
*** Error code 1

bmake: stopped in /tmp/moh/work/wrk/pkgtools/pkg_install/work/pkg_install-20110215/add
*** Error code 1

It does not fail with CCVER set to gcc41.

How to reproduce:
cd /usr/pkgsrc/bootstrap
mkdir /tmp/moh && ./bootstrap --prefix /tmp/moh/pkg --varbase /tmp/moh/pkgvar --workdir /tmp/moh/work --unprivileged

then to try the bootstrap again you can just remove /tmp/moh and start over.

Sascha Wildner asked me to test this patch,, but it did not fix the issue.



#1 Updated by matthiasr about 6 years ago

The problem is a collision between the internal libfetch pkg_install et al.
build during their configure phase and DragonFly's system libfetch. For some
reason the latter is being linked where it should be the former.

For reproducing this it's enough to bmake in pkgtools/pkg_install.

Moving /usr/libfetch.* out of the way "fixes" this.

#2 Updated by matthiasr about 6 years ago

The problem also applies with pkgin and the regular libfetch from pkgsrc. With
CCVER=gcc41 /usr/pkg/lib/libfetch.a is used, as it should be. With gcc44
/usr/lib/libfetch.a is used, which is incompatible.

#3 Updated by matthiasr about 6 years ago

The full link command for pkgin is

cc -L/export/pkgobj/bootstrap/work/pkgsrc/pkgtools/pkgin/work/libnbcompat -
L/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -o pkgin main.o
summary.o tools.o pkgindb.o depends.o actions.o pkglist.o download.o order.o
impact.o autoremove.o fsops.o pkgindb_queries.o automatic.o decompress.o dewey.o
fexec.o global.o opattern.o pkgdb.o var.o sqlite3.o -L/usr/pkg/lib -Wl,-
rpath,/usr/pkg/lib -lbz2 -lz -larchive -lfetch -lssl -lcrypto -ltermcap -lutil -
lpthread -lnbcompat -lnbcompat

calling it from $WRKDIR works if and only if I prepend CCVER=gcc41 or move
/usr/lib/libfetch.* out of the way. BINUTILSVER has no effect.

#4 Updated by matthiasr about 6 years ago

This is caused by DragonFly commit e42b0192f1e7ce6df0aa461075bde4978fa72adc[1],
without these changes building and linking pkg_install works fine.


#5 Updated by matthiasr about 6 years ago

... and it's fixed with 3385e5b7b79897e14d0c17d477a34bb9257b257c.

Also available in: Atom PDF