NetBSD Problem Report #53089

From tsutsui@ceres.dti.ne.jp  Sun Mar 11 14:46:26 2018
Return-Path: <tsutsui@ceres.dti.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id E439D7A1EE
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 11 Mar 2018 14:46:26 +0000 (UTC)
Message-Id: <201803111446.w2BEkMSf023316@ceres.dti.ne.jp>
Date: Sun, 11 Mar 2018 23:46:22 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: qt5-qtbase workaround for ld assertion failure on NetBSD
X-Send-Pr-Version: 3.95

>Number:         53089
>Category:       pkg
>Synopsis:       qt5-qtbase workaround for ld assertion failure on NetBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 11 14:50:00 +0000 2018
>Closed-Date:    Thu Apr 05 14:58:03 +0000 2018
>Last-Modified:  Thu Apr 05 14:58:03 +0000 2018
>Originator:     Izumi Tsutsui
>Release:        NetBSD 7.1.1
>Organization:
>Environment:
System: NetBSD optiplex 7.1.1 NetBSD 7.1.1 (GENERIC.201712222334Z) i386
Architecture: i386 (but affects all)
Machine: i386
>Description:
On qt5 5.10.0 update, there was a "linker problem blocking qt5 update":
http://mail-index.netbsd.org/tech-pkg/2018/01/09/msg019292.html
which caused assertion failure of ld(1).

There is a suggested workaround to add -lexecinfo before -lQt5Widget for
each package that links Qt5Widget (without *.pro Qt settings with qmake):
http://mail-index.netbsd.org/tech-pkg/2018/01/14/msg019307.html

However it is a bit pain to check and add hacks.mk for all affected
packages:
 http://mail-index.netbsd.org/pkgsrc-changes/2018/02/12/msg170740.html
 (pkgsrc/inputmethod/mozc-tool also gets the same assertion)

If the packages use pkg-config to pull Qt5 libraries it is easier
to put -lexecinfo into /usr/pkg/lib/pkgconfig/Qt5Widget.pc file,
even though it's still a bit ugly.

>How-To-Repeat:
cd pkgsrc/inputmethod/mozc-tool && make package

>Fix:
Adding pkgsrc/x11/qt5-qtbase/hacks.mk to add -lexecinfo to
Qt5Widget.pc pkgconfig file in post-build seems to work around:

--- cut here ---
# $NetBSD$

.if !defined(QT5_QTBASE_HACKS_MK)
QT5_QTBASE_HACKS_MK= defined

### On NetBSD ld(1) gets assertion fails on linking Qt5Widget library
### after Qt 5.10.0 updates.
### Explicitly linking -lexecinfo before -lQt5Widgets (in the pkgconfig file)
### works around.
###  http://mail-index.netbsd.org/tech-pkg/2018/01/14/msg019307.html
.if ${OPSYS} == "NetBSD" && exists(/usr/lib/libexecinfo.so)
post-build:
	${SED}  -e 's/^Libs:/& -lexecinfo/g'\
		 ${WRKSRC}/lib/pkgconfig/Qt5Widgets.pc > \
		 ${WRKSRC}/lib/pkgconfig/Qt5Widgets.pc.hack
	${MV} ${WRKSRC}/lib/pkgconfig/Qt5Widgets.pc.hack \
		 ${WRKSRC}/lib/pkgconfig/Qt5Widgets.pc
.endif

.endif	# QT5_QTBASE_HACKS_MK
--- cut here ---

>Release-Note:

>Audit-Trail:
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: Re: pkg/53089: qt5-qtbase workaround for ld assertion failure on NetBSD
Date: Thu, 22 Mar 2018 01:22:01 +0900

 If there is no objection, I'll commit the change this weekend.

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53089: qt5-qtbase workaround for ld assertion failure on
 NetBSD
Date: Fri, 23 Mar 2018 21:32:19 +0100

 On Wed, Mar 21, 2018 at 04:25:01PM +0000, Izumi Tsutsui wrote:
 >  If there is no objection, I'll commit the change this weekend.

 Can you hold off? I'm testing a real fix right now.

 Joerg

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: joerg@bec.de, tsutsui@ceres.dti.ne.jp
Subject: Re: pkg/53089: qt5-qtbase workaround for ld assertion failure onNetBSD
Date: Sat, 24 Mar 2018 06:14:48 +0900

 >  Can you hold off? I'm testing a real fix right now.

 Sure.  Note the following individual packages have hacks.mk
 to explicitly link libexecelf using BULIDLINK_TRANSFORM.NetBSD:

 audio/kid3/hacks.mk
 devel/kcoreaddons/hacks.mk
 devel/kidletime/hacks.mk
 devel/kpeople/hacks.mk
 devel/kitemmodels/hacks.mk
 graphics/kplotting/hacks.mk
 graphics/prison/hacks.mk
 misc/attica-qt5/hacks.mk
 multimedia/phonon-qt5/hacks.mk
 textproc/sonnet/hacks.mk
 textproc/syntax-highlighting/hacks.mk
 x11/kded/hacks.mk
 x11/kdesignerplugin/hacks.mk
 x11/kguiaddons/hacks.mk
 x11/kxmlgui/hacks.mk
 x11/kitemviews/hacks.mk
 x11/kwidgetsaddons/hacks.mk
 x11/kwindowsystem/hacks.mk

 ---
 Izumi Tsutsui

State-Changed-From-To: open->feedback
State-Changed-By: maya@NetBSD.org
State-Changed-When: Wed, 28 Mar 2018 13:12:59 +0000
State-Changed-Why:
Does this change help? (note it seems to apply to -7 too)
Module Name:    src
Committed By:   joerg
Date:           Tue Mar 27 23:39:23 UTC 2018

Modified Files:
        src/external/gpl3/binutils/dist/bfd: elflink.c

Log Message:
When trying to decide the status of a weak symbol, resolve any
indirectness first. In the case of various Qt5 libraries, __bss_start
ends up with a Qt5 version, but it has to be resolved first to match the
actual (implicit) definition. This fixes the root cause of pkg/53089.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/binutils/dist/bfd/elflink.c


From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: Re: pkg/53089 (qt5-qtbase workaround for ld assertion failure on NetBSD)
Date: Wed, 28 Mar 2018 22:39:22 +0900

 I don't use -current, and I'm afraid a fix against the base system
 doesn't help users of the latest 7.1.2 (and 7.0.2) releases.

 Anyway, please close this PR as request rejected.

 ---
 Izumi Tsutsui

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53089 (qt5-qtbase workaround for ld assertion failure on
 NetBSD)
Date: Wed, 28 Mar 2018 16:42:11 +0200

 On Wed, Mar 28, 2018 at 01:40:00PM +0000, Izumi Tsutsui wrote:
 >  I don't use -current, and I'm afraid a fix against the base system
 >  doesn't help users of the latest 7.1.2 (and 7.0.2) releases.

 The fix is meant to be pulled up to all affected release branches.
 Yes, this means that anyone who wants to use Qt5 has to make sure that
 the base system is up-to-date on the respective branch, but that's no
 different from a lot of other bug fixes.

 Joerg

State-Changed-From-To: feedback->closed
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Thu, 05 Apr 2018 14:58:03 +0000
State-Changed-Why:
The requrest has been rejected.
Anyway it seems fixed by pkgsrc/x11/qt5-qtbase/Makefile rev 1.55
 http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/x11/qt5-qtbase/Makefile#rev1.55


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.