NetBSD Problem Report #54506

From tobiasu@tmux.org  Thu Aug 29 13:03:41 2019
Return-Path: <tobiasu@tmux.org>
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 69F3D7A176
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 29 Aug 2019 13:03:41 +0000 (UTC)
Message-Id: <20190829130336.068D51B67DC@nbsd1.tmux.org>
Date: Thu, 29 Aug 2019 13:03:35 +0000 (UTC)
From: tobiasu@tmux.org
Reply-To: tobiasu@tmux.org
To: gnats-bugs@NetBSD.org
Subject: undefined float128 symbols in math/mpfr on netbsd 9
X-Send-Pr-Version: 3.95

>Number:         54506
>Category:       pkg
>Synopsis:       gcc-aux installs older libgcc_s.so (was: undefined float128 symbols in math/mpfr on netbsd 9)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 29 13:05:00 +0000 2019
>Closed-Date:    Wed Oct 23 00:01:46 +0000 2019
>Last-Modified:  Wed Oct 23 00:01:46 +0000 2019
>Originator:     Tobias Ulmer
>Release:        NetBSD 9.99.10
>Organization:

>Environment:


System: NetBSD nbsd1.tmux.org 9.99.10 NetBSD 9.99.10 (GENERIC) #0: Sat Aug 24 11:51:26 UTC 2019 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
https://github.com/NetBSD/pkgsrc/commit/7611affe73d9f7c953878fc9ace71904be552baf#diff-fe42a3075a4b6a6ba583b40054b5ff69
>How-To-Repeat:
>Fix:
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/math/mpfr/Makefile,v
retrieving revision 1.40
diff -u -p -r1.40 Makefile
--- Makefile	13 Feb 2019 22:26:50 -0000	1.40
+++ Makefile	29 Aug 2019 12:53:22 -0000
@@ -1,6 +1,7 @@
 # $NetBSD: Makefile,v 1.40 2019/02/13 22:26:50 wiz Exp $

 DISTNAME=		mpfr-4.0.2
+PKGREVISION=		1
 CATEGORIES=		math
 MASTER_SITES=		http://www.mpfr.org/${DISTNAME}/
 EXTRACT_SUFX=		.tar.bz2
@@ -12,7 +13,7 @@ LICENSE=		gnu-lgpl-v3

 .include "../../mk/bsd.prefs.mk"
 GNU_CONFIGURE=		yes
-.if !empty(MACHINE_PLATFORM:MNetBSD-[0-8]*-*) || !empty(MACHINE_PLATFORM:MDragonFly-[0-5]*-*)
+.if !empty(MACHINE_PLATFORM:MNetBSD-[0-9]*-*) || !empty(MACHINE_PLATFORM:MDragonFly-[0-5]*-*)
 CONFIGURE_ARGS+=        --disable-float128
 .endif
 USE_LIBTOOL=		yes

>Release-Note:

>Audit-Trail:

From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/54506: undefined float128 symbols in math/mpfr on netbsd 9
Date: Thu, 5 Sep 2019 16:51:50 +0000

 what's the symptom for failure? I can build web2c.
 thanks.

State-Changed-From-To: open->feedback
State-Changed-By: maya@NetBSD.org
State-Changed-When: Thu, 05 Sep 2019 19:10:54 +0000
State-Changed-Why:
requesting failure message/ symtpoms.


From: Tobias Ulmer <tobiasu@tmux.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/54506: undefined float128 symbols in math/mpfr on netbsd 9
Date: Fri, 6 Sep 2019 17:27:25 +0200

 On Thu, Sep 05, 2019 at 04:55:01PM +0000, coypu@sdf.org wrote:
 > The following reply was made to PR pkg/54506; it has been noted by GNATS.
 > 
 > From: coypu@sdf.org
 > To: gnats-bugs@netbsd.org
 > Cc: 
 > Subject: Re: pkg/54506: undefined float128 symbols in math/mpfr on netbsd 9
 > Date: Thu, 5 Sep 2019 16:51:50 +0000
 > 
 >  what's the symptom for failure? I can build web2c.
 >  thanks.
 >  

 Ok, I've tried to reproduce this, it's more complicated than I first thought.

 It can be reproduced by installing lang/gcc5-aux, then building it again:

 ...
 checking for the correct version of gmp.h... yes
 checking for the correct version of mpfr.h... yes
 checking for the correct version of mpc.h... yes
 checking for the correct version of the gmp/mpfr/mpc libraries... no
 configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
 Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
 their locations.  Source code for these libraries can be found at
 their respective hosting sites as well as at
 ftp://gcc.gnu.org/pub/gcc/infrastructure/.  See also
 http://gcc.gnu.org/install/prerequisites.html for additional info.  If
 you obtained GMP, MPFR and/or MPC from a vendor distribution package,
 make sure that you have installed both the libraries and the header
 files.  They may be located in separate packages.
 *** Error code 1

 Stop.
 make[1]: stopped in /usr/pkgsrc/lang/gcc5-aux

 from configure.log:
 configure:5757: checking for the correct version of the gmp/mpfr/mpc libraries 
 configure:5788: /usr/pkg/gcc5-aux/bin/ada -o conftest -g -O2 -I/usr/pkg/include -I/usr/pkg/include -I/usr/pkg/include   -lm -Wl,-R/usr/pkg/lib conftest.c  -L/usr/pkg/lib -L/usr/pkg/
 lib -L/usr/pkg/lib -lmpc -lmpfr -lgmp >&5 
 /usr/bin/ld: /usr/pkg/lib/libmpfr.so: undefined reference to `__subtf3@GCC_3.0' 
 /usr/bin/ld: /usr/pkg/lib/libmpfr.so: undefined reference to `__getf2@GCC_3.0' 
 /usr/bin/ld: /usr/pkg/lib/libmpfr.so: undefined reference to `__letf2@GCC_3.0' 
 /usr/bin/ld: /usr/pkg/lib/libmpfr.so: undefined reference to `__fixunstfdi@GCC_3.0' 
 /usr/bin/ld: /usr/pkg/lib/libmpfr.so: undefined reference to `__gttf2@GCC_3.0' 
 /usr/bin/ld: /usr/pkg/lib/libmpfr.so: undefined reference to `__multf3@GCC_3.0' 
 /usr/bin/ld: /usr/pkg/lib/libmpfr.so: undefined reference to `__floatunditf@GCC_4.2.0' 
 /usr/bin/ld: /usr/pkg/lib/libmpfr.so: undefined reference to `__trunctfdf2@GCC_3.0' 
 /usr/bin/ld: /usr/pkg/lib/libmpfr.so: undefined reference to `__addtf3@GCC_3.0' 
 /usr/bin/ld: /usr/pkg/lib/libmpfr.so: undefined reference to `__netf2@GCC_3.0' 
 /usr/bin/ld: /usr/pkg/lib/libmpfr.so: undefined reference to `__eqtf2@GCC_3.0' 
 /usr/bin/ld: /usr/pkg/lib/libmpfr.so: undefined reference to `__extenddftf2@GCC_3.0' 
 /usr/bin/ld: /usr/pkg/lib/libmpfr.so: undefined reference to `__lttf2@GCC_3.0' 
 collect2: error: ld returned 1 exit status 
 configure:5788: $? = 1

 This is because gcc5-aux builds and installs a libgcc_s.so without the symbols
 above. Building gcc5-aux a second time uses the installed Ada compiler
 instead of the bootstrap (on purpose) which fails as shown above.

 The bootstrap compiler does not contain a libgcc_s.so, it falls back to
 /usr/lib/libgcc_s.so.

 I can think of a couple ways of fixing this:
 - Disable long float support in mpfr like it was previously
 - Disable and remove (somehow) libgcc_s from gcc*-aux
 - Patch gcc*-aux to include the same set of symbols as base libgcc.
   The libgcc/config/ machinery doesn't seem to support NetBSD very much and
   base has custom Makefiles to build it, so that's fun.

 Patching mpfr seems the most trivial. What do yo think?

State-Changed-From-To: feedback->open
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sat, 07 Sep 2019 18:12:42 +0000
State-Changed-Why:
Feedback provided. Will need to provide logic for all the pkgsrc GCC variants to see if libgcc_s is older, then delete it at post-install.


From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54506 CVS commit: pkgsrc
Date: Sun, 8 Sep 2019 14:05:38 +0000

 Module Name:	pkgsrc
 Committed By:	maya
 Date:		Sun Sep  8 14:05:38 UTC 2019

 Modified Files:
 	pkgsrc/lang/gcc-aux: options.mk
 	pkgsrc/lang/gcc5-aux: options.mk
 	pkgsrc/mk/defaults: options.description

 Log Message:
 Add a new option 'always-libgcc', whether to install libgcc.
 If the pkgsrc compiler is GCC, don't install libgcc.

 Having an older libgcc is problematic: it may be missing symbols from
 newer libgcc. This is what happened in PR pkg/54506.

 Use this on gcc-aux and gcc5-aux: the libgcc_s.so they install is going
 to be older in all the operating systems these packages support.
 (Other GCC packages will require a more elaborate rule)

 Leaving SmartOS unchanged, by request from jperkin.


 To generate a diff of this commit:
 cvs rdiff -u -r1.6 -r1.7 pkgsrc/lang/gcc-aux/options.mk
 cvs rdiff -u -r1.5 -r1.6 pkgsrc/lang/gcc5-aux/options.mk
 cvs rdiff -u -r1.592 -r1.593 pkgsrc/mk/defaults/options.description

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54506 CVS commit: pkgsrc
Date: Sun, 8 Sep 2019 14:47:53 +0000

 Module Name:	pkgsrc
 Committed By:	maya
 Date:		Sun Sep  8 14:47:53 UTC 2019

 Modified Files:
 	pkgsrc/lang/gcc48: options.mk
 	pkgsrc/lang/gcc49: options.mk
 	pkgsrc/lang/gcc5: options.mk
 	pkgsrc/lang/gcc6: options.mk
 	pkgsrc/lang/gcc7: options.mk
 	pkgsrc/lang/gcc8: options.mk
 Added Files:
 	pkgsrc/mk/scripts: larger_symbol_version.awk

 Log Message:
 gcc{48,49,5,6,7,8}: In the case of a "system GCC", detect if the system
 libgcc is newer than the one about to be installed. If so, don't install
 the libgcc.

 Having an older libgcc appear in the lookup may result in binaries not
 running, as they need symbols from the newer libgcc.
 Such a case is PR pkg/54506.

 Leaves SunOS unchanged, by request from jperkin.


 To generate a diff of this commit:
 cvs rdiff -u -r1.11 -r1.12 pkgsrc/lang/gcc48/options.mk
 cvs rdiff -u -r1.3 -r1.4 pkgsrc/lang/gcc49/options.mk
 cvs rdiff -u -r1.2 -r1.3 pkgsrc/lang/gcc5/options.mk
 cvs rdiff -u -r1.1 -r1.2 pkgsrc/lang/gcc6/options.mk
 cvs rdiff -u -r1.4 -r1.5 pkgsrc/lang/gcc7/options.mk
 cvs rdiff -u -r1.1 -r1.2 pkgsrc/lang/gcc8/options.mk
 cvs rdiff -u -r0 -r1.1 pkgsrc/mk/scripts/larger_symbol_version.awk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Wed, 23 Oct 2019 00:01:46 +0000
State-Changed-Why:
I believe this is fixed. thanks for the report. Please report if I'm wrong.


>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.