pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc Bootstrap: Fix bootstrap on FreeBSD 12.1, likely broke...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/823e4f0cdcfd
branches:  trunk
changeset: 441183:823e4f0cdcfd
user:      maya <maya%pkgsrc.org@localhost>
date:      Wed Oct 28 16:52:43 2020 +0000

description:
Bootstrap: Fix bootstrap on FreeBSD 12.1, likely broken by an issue in lld.

It looks like lld doesn't want to statically link a libarchive without
resolving all of the symbols, even if only a few symbols are used.

In order to resolve all of the symbols, we need to also link with -lmd.
One generic way to do so is inspect Libs.private in the pkgconfig file.

While pkgsrc is likely not at fault here, having a dysfunctional bootstrap
is bad. We should check again in the future to see if this can be removed.

Actually fixes PR pkg/55400.

diffstat:

 bootstrap/bootstrap                           |  7 ++++++-
 pkgtools/pkg_install/files/add/Makefile.in    |  4 ++--
 pkgtools/pkg_install/files/create/Makefile.in |  4 ++--
 3 files changed, 10 insertions(+), 5 deletions(-)

diffs (66 lines):

diff -r 535204cd9bf3 -r 823e4f0cdcfd bootstrap/bootstrap
--- a/bootstrap/bootstrap       Wed Oct 28 15:37:59 2020 +0000
+++ b/bootstrap/bootstrap       Wed Oct 28 16:52:43 2020 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: bootstrap,v 1.294 2020/10/07 10:44:14 jperkin Exp $
+# $NetBSD: bootstrap,v 1.295 2020/10/28 16:52:43 maya Exp $
 #
 # Copyright (c) 2001-2011 Alistair Crooks <agc%NetBSD.org@localhost>
 # All rights reserved.
@@ -1235,6 +1235,10 @@
 esac
 
 # bootstrap pkg_install
+extra_libarchive_depends() {
+       $sedprog -n -e 's/Libs.private: //p' $wrkdir/libarchive/build/pkgconfig/libarchive.pc
+}
+
 echo_msg "Bootstrapping pkgtools"
 copy_src $pkgsrcdir/archivers/libarchive/files libarchive
 run_cmd "(cd $wrkdir/libarchive; env $BSTRAP_ENV \
@@ -1253,6 +1257,7 @@
 --with-pkgdbdir=$pkgdbdir --infodir=$infodir \
 --mandir=$mandir $pkg_install_args && \
 STATIC_LIBARCHIVE=$wrkdir/libarchive/.libs/libarchive.a \
+STATIC_LIBARCHIVE_LDADD=`extra_libarchive_depends` \
 PKGSRC_MACHINE_ARCH="$machine_arch" $bmake $make_quiet_flags -j$make_jobs)"
 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/add/pkg_add $wrkdir/sbin/pkg_add"
 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin"
diff -r 535204cd9bf3 -r 823e4f0cdcfd pkgtools/pkg_install/files/add/Makefile.in
--- a/pkgtools/pkg_install/files/add/Makefile.in        Wed Oct 28 15:37:59 2020 +0000
+++ b/pkgtools/pkg_install/files/add/Makefile.in        Wed Oct 28 16:52:43 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.in,v 1.33 2015/12/27 12:36:42 joerg Exp $
+# $NetBSD: Makefile.in,v 1.34 2020/10/28 16:52:43 maya Exp $
 
 srcdir=                @srcdir@
 
@@ -29,7 +29,7 @@
 .endif
 LIBS+=         @LIBS@
 .else
-LIBS=          -linstall ${STATIC_LIBARCHIVE} @LIBS@
+LIBS=          -linstall ${STATIC_LIBARCHIVE} ${STATIC_LIBARCHIVE_LDADD} @LIBS@
 CPPFLAGS+=     -DBOOTSTRAP
 .endif
 
diff -r 535204cd9bf3 -r 823e4f0cdcfd pkgtools/pkg_install/files/create/Makefile.in
--- a/pkgtools/pkg_install/files/create/Makefile.in     Wed Oct 28 15:37:59 2020 +0000
+++ b/pkgtools/pkg_install/files/create/Makefile.in     Wed Oct 28 16:52:43 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.in,v 1.29 2015/12/27 12:36:42 joerg Exp $
+# $NetBSD: Makefile.in,v 1.30 2020/10/28 16:52:43 maya Exp $
 
 srcdir=                @srcdir@
 
@@ -33,7 +33,7 @@
 LIBS+=         -lssl -lcrypto
 .endif
 .else
-LIBS=          -linstall ${STATIC_LIBARCHIVE} @LIBS@
+LIBS=          -linstall ${STATIC_LIBARCHIVE} ${STATIC_LIBARCHIVE_LDADD} @LIBS@
 CPPFLAGS+=     -DBOOTSTRAP
 .endif
 



Home | Main Index | Thread Index | Old Index