NetBSD Problem Report #52250

From www@NetBSD.org  Mon May 22 07:13:01 2017
Return-Path: <www@NetBSD.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 "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A8B8C7A16F
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 22 May 2017 07:13:01 +0000 (UTC)
Message-Id: <20170522071300.883907A2AD@mollari.NetBSD.org>
Date: Mon, 22 May 2017 07:13:00 +0000 (UTC)
From: joern.clausen@uni-bielefeld.de
Reply-To: joern.clausen@uni-bielefeld.de
To: gnats-bugs@NetBSD.org
Subject: gmp and mpfr not found by some packages
X-Send-Pr-Version: www-1.0

>Number:         52250
>Category:       pkg
>Synopsis:       gmp and mpfr not found by some packages
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    solaris-pkg-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 22 07:15:00 +0000 2017
>Last-Modified:  Wed May 02 09:30:00 +0000 2018
>Originator:     Joern Clausen
>Release:        
>Organization:
University of Bielefeld
>Environment:
>Description:
This is a followup to pkg/52244, because I am afraid a more fundamental problem might get lost in a very specific PR.

I am using a stand-alone GCC 4.8.5 on Solaris 11.2. This configuration hasn't been changed for more than a year. Since recently, I can't build some packages relying on gmp and mpfr. After configuring e.g. "security/gnutls", I get

$ bmake show-var VARNAME=BUILDLINK_PREFIX.gmp
/usr

or for print/luatex I get

$ bmake show-var VARNAME=BUILDLINK_PREFIX.mpfr
/usr

Other packages show a correct dependency, e.g. "security/nettle":

$ bmake show-var VARNAME=BUILDLINK_PREFIX.gmp
/opt/pkg-hrz/20170105


gmp and mpfr are two libraries that are used when bootstrapping GCC, so this might be relevant. But my GCC is installed somewhere under /opt, a path in /usr should not be used in any case.
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: =?UTF-8?Q?J=c3=b6rn_Clausen?= <joern.clausen@uni-bielefeld.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Mon, 22 May 2017 14:16:54 +0200

 I forgot to mention, that other dependencies in the affected packages 
 are resolved correctly, e.g. in luatex:

 $ bmake show-var VARNAME=BUILDLINK_PREFIX.png
 /opt/pkg-hrz/20170105


 I tried various debug options of bmake (especially c, f, p and v) for 
 "mpfr" and "png" and compared the results. The only difference was the 
 final result, i.e. the path. There were absolutely no differences in the 
 preceding debug output.

 Any ideas how to debug this are welcome.

 -- 
 Jörn Clausen
 Plattformen & Serverdienste
 BITS - Bielefelder IT-Servicezentrum

 Universität Bielefeld
 Universitätsstraße 25
 33615 Bielefeld
 Telefon: +49 521 106-12601
 E-Mail: joern.clausen@uni-bielefeld.de

 http://www.uni-bielefeld.de/bits

Responsible-Changed-From-To: pkg-manager->solaris-pkg-people
Responsible-Changed-By: hauke@NetBSD.org
Responsible-Changed-When: Mon, 22 May 2017 19:51:18 +0000
Responsible-Changed-Why:
This is a Solaris problem.


From: =?UTF-8?Q?J=C3=B6rn_Clausen?= <joernc@googlemail.com>
To: gnats-bugs@netbsd.org
Cc: solaris-pkg-people@netbsd.org, pkg-manager@netbsd.org, 
	pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org, hauke@netbsd.org, 
	=?UTF-8?Q?J=C3=B6rn_Clausen?= <joern.clausen@uni-bielefeld.de>
Subject: Re: pkg/52250 (gmp and mpfr not found by some packages)
Date: Mon, 22 May 2017 22:23:39 +0200

 How do you know?

 On Mon, May 22, 2017 at 9:51 PM,  <hauke@netbsd.org> wrote:
 > Synopsis: gmp and mpfr not found by some packages
 >
 > Responsible-Changed-From-To: pkg-manager->solaris-pkg-people
 > Responsible-Changed-By: hauke@NetBSD.org
 > Responsible-Changed-When: Mon, 22 May 2017 19:51:18 +0000
 > Responsible-Changed-Why:
 > This is a Solaris problem.
 >
 >
 >



 -- 
 Joern Clausen
 http://www.oe-files.de/photography/

From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Tue, 23 May 2017 14:17:37 +0000

 Looks like the one that gets it right includes bsd.prefs.mk, so perhaps
 that's needed in the builtin.mk file? I'm not sure how pkgsrc
 infrastructure works (or is supposed to).

 as for the assignment, I personally completely ignore assignment unless
 it's assigned to a person (I just scroll all open pkg bugs), but I'm
 under the impression that it pings some people who otherwise might not
 notice it.

From: "Johnny C. Lam" <jlam@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Tue, 23 May 2017 14:59:24 +0000

 On Mon, May 22, 2017 at 07:15:00AM +0000, joern.clausen@uni-bielefeld.de wrote:
 > 
 > I am using a stand-alone GCC 4.8.5 on Solaris 11.2. This
 > configuration hasn't been changed for more than a year. Since
 > recently, I can't build some packages relying on gmp and mpfr.
 > After configuring e.g. "security/gnutls", I get
 > 
 > $ bmake show-var VARNAME=BUILDLINK_PREFIX.gmp
 > /usr
 > 
 > or for print/luatex I get
 > 
 > $ bmake show-var VARNAME=BUILDLINK_PREFIX.mpfr
 > /usr

 Okay, the builtin.mk file math/mpfr looks completely wrong to me.
 It is abusing pkgconfig-builtin.mk, which is used to parse *.pc
 files, to parse a header file instead.  The detection problems
 likely begin and end there.

 For devel/gmp, where is your gmp.h header file located?

 --
 Johnny C. Lam
 jlam88@gmail.com

From: =?UTF-8?Q?J=c3=b6rn_Clausen?= <joern.clausen@uni-bielefeld.de>
To: gnats-bugs@NetBSD.org, solaris-pkg-people@NetBSD.org,
 gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Wed, 24 May 2017 12:17:04 +0200

 >  Looks like the one that gets it right includes bsd.prefs.mk, so perhaps
 >  that's needed in the builtin.mk file?

 Nope, that didn't change anything.

 -- 
 Jörn Clausen
 Plattformen & Serverdienste
 BITS - Bielefelder IT-Servicezentrum

 Universität Bielefeld
 Universitätsstraße 25
 33615 Bielefeld
 Telefon: +49 521 106-12601
 E-Mail: joern.clausen@uni-bielefeld.de

 http://www.uni-bielefeld.de/bits

From: =?UTF-8?Q?J=c3=b6rn_Clausen?= <joern.clausen@uni-bielefeld.de>
To: gnats-bugs@NetBSD.org, solaris-pkg-people@NetBSD.org,
 gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Wed, 24 May 2017 12:21:35 +0200

 >  For devel/gmp, where is your gmp.h header file located?

 Where it is supposed to be:

 $ ll /opt/pkg-hrz/20170105/include/gmp.h
 -rw-r--r--   1 pkgsrc   software   83733 Jan  5 20:08 
 /opt/pkg-hrz/20170105/include/gmp.h

 i.e. with opt/pkg-hrz/20170105 as LOCALBASE.

 -- 
 Jörn Clausen
 Plattformen & Serverdienste
 BITS - Bielefelder IT-Servicezentrum

 Universität Bielefeld
 Universitätsstraße 25
 33615 Bielefeld
 Telefon: +49 521 106-12601
 E-Mail: joern.clausen@uni-bielefeld.de

 http://www.uni-bielefeld.de/bits

From: =?UTF-8?Q?J=c3=b6rn_Clausen?= <joern.clausen@uni-bielefeld.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Wed, 24 May 2017 16:03:49 +0200

 Just for the record: Yesterday I was able to successfully build 
 security/gnutls on Solaris 10 with a similar setup (GCC 4.8.5, 32bit 
 though) in a fairly recently bootstrapped pkgsrc environment. So I did a 
 fresh bootstrap on Solaris 11.2 as well, but here I still have the same 
 problem.

 Again: Any input on how to debug the point where the decision is made 
 which gmp is used is really appreciated...

 -- 
 Jörn Clausen
 Plattformen & Serverdienste
 BITS - Bielefelder IT-Servicezentrum

 Universität Bielefeld
 Universitätsstraße 25
 33615 Bielefeld
 Telefon: +49 521 106-12601
 E-Mail: joern.clausen@uni-bielefeld.de

 http://www.uni-bielefeld.de/bits

From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Thu, 25 May 2017 07:44:14 +0000

 Important to note PREFER.gmp=pkgsrc in mk.conf is likely a workaround,
 so you can use things until it is resolved

From: =?UTF-8?Q?J=c3=b6rn_Clausen?= <joern.clausen@uni-bielefeld.de>
To: gnats-bugs@NetBSD.org, solaris-pkg-people@NetBSD.org,
 gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Fri, 26 May 2017 11:37:43 +0200

 >  Important to note PREFER.gmp=pkgsrc in mk.conf is likely a workaround,
 >  so you can use things until it is resolved

 That does work indeed. I added gmp and mpfr and now packages are building.

 I guess I can check from time to time what happens if I remove this 
 workaround, maybe someone will solve this by accident...

 Thanks for your help!

 -- 
 Jörn Clausen
 Plattformen & Serverdienste
 BITS - Bielefelder IT-Servicezentrum

 Universität Bielefeld
 Universitätsstraße 25
 33615 Bielefeld
 Telefon: +49 521 106-12601
 E-Mail: joern.clausen@uni-bielefeld.de

 http://www.uni-bielefeld.de/bits

From: =?UTF-8?Q?J=c3=b6rn_Clausen?= <joern.clausen@uni-bielefeld.de>
To: gnats-bugs@NetBSD.org, solaris-pkg-people@NetBSD.org,
 gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Mon, 19 Jun 2017 14:44:26 +0200

 This probably warrants another PR...

 I just noticed while building net/net-snmp:

 on Solaris 11.3/i86:

 $ bmake show-var VARNAME=BUILDLINK_PREFIX.tcp_wrappers
 /opt/pkg-hrz/20170529

 on Solaris 11.3/sparc:

 $ bmake show-var VARNAME=BUILDLINK_PREFIX.tcp_wrappers
 /usr


 Both platforms build from the same source tree, use the same version of 
 GCC and should be completely identical in practically any other way.

 How can I backtrace, when and how variables get assigned? I'd really 
 like to find the source of this difference. Filling up PREFER_PKGSRC 
 with more and more packages is really not what I want.

 -- 
 Jörn Clausen
 Plattformen & Serverdienste
 BITS - Bielefelder IT-Servicezentrum

From: Jonathan Perkin <jperkin@pkgsrc.org>
To: =?iso-8859-1?Q?J=F6rn?= Clausen <joern.clausen@uni-bielefeld.de>
Cc: gnats-bugs@NetBSD.org, solaris-pkg-people@NetBSD.org,
	gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Mon, 19 Jun 2017 13:52:53 +0100

 * On 2017-06-19 at 13:44 BST, Jörn Clausen wrote:

 > This probably warrants another PR...
 > 
 > I just noticed while building net/net-snmp:
 > 
 > on Solaris 11.3/i86:
 > 
 > $ bmake show-var VARNAME=BUILDLINK_PREFIX.tcp_wrappers
 > /opt/pkg-hrz/20170529
 > 
 > on Solaris 11.3/sparc:
 > 
 > $ bmake show-var VARNAME=BUILDLINK_PREFIX.tcp_wrappers
 > /usr
 > 
 > 
 > Both platforms build from the same source tree, use the same version of GCC
 > and should be completely identical in practically any other way.
 > 
 > How can I backtrace, when and how variables get assigned? I'd really like to
 > find the source of this difference. Filling up PREFER_PKGSRC with more and
 > more packages is really not what I want.

 1. security/tcp_wrappers/builtin.mk is the logic to determine whether a
    builtin is available, and if so whether it should be used.  In this
    case it checks for the existence of /usr/include/tcpd.h and libwrap in
    the system library paths.

 2. IS_BUILTIN.tcp_wrappers will tell you if a builtin has been detected.

 3. USE_BUILTIN.tcp_wrappers will tell you if the builtin will be used.

 1 and 2 are independent of any settings, 3 can be controlled with
 PREFER_PKGSRC etc.  The likelyhood is that your systems are different, and
 one of them has tcpd.h/libwrap installed and the other does not, but
 IS_BUILTIN will tell for sure.

 -- 
 Jonathan Perkin       www.perkin.org.uk
 github.com/jperkin  twitter.com/jperkin

From: =?UTF-8?Q?J=c3=b6rn_Clausen?= <joern.clausen@uni-bielefeld.de>
To: Jonathan Perkin <jperkin@pkgsrc.org>
Cc: gnats-bugs@NetBSD.org, solaris-pkg-people@NetBSD.org,
 gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Mon, 19 Jun 2017 15:08:43 +0200

 > 1. security/tcp_wrappers/builtin.mk is the logic to determine whether a
 >    builtin is available, and if so whether it should be used.  In this
 >    case it checks for the existence of /usr/include/tcpd.h and libwrap in
 >    the system library paths.

 Solaris 11.3/i86:

 $ ll /usr/include/tcpd.h
 -rw-r--r--   1 root     bin        10386 Jun  1  2015 /usr/include/tcpd.h

 $ ll /usr/lib/*wrap*
 lrwxrwxrwx   1 root     root          14 May 28  2015 
 /usr/lib/libwrap.so -> libwrap.so.1.0
 lrwxrwxrwx   1 root     root          14 May 28  2015 
 /usr/lib/libwrap.so.1 -> libwrap.so.1.0
 -rwxr-xr-x   1 root     bin        56960 May 29 10:12 
 /usr/lib/libwrap.so.1.0
 -rw-r--r--   1 root     bin         1294 May 28  2015 /usr/lib/llib-lwrap
 -rw-r--r--   1 root     bin        33904 May 29 10:12 /usr/lib/llib-lwrap.ln

 Solaris 11.3/sparc:

 $ ll /usr/include/tcpd.h
 -rw-r--r--   1 root     bin        10386 Jul  8  2016 /usr/include/tcpd.h

 $ ll /usr/lib/*wrap*
 lrwxrwxrwx   1 root     root          14 Jul  8  2016 
 /usr/lib/libwrap.so -> libwrap.so.1.0
 lrwxrwxrwx   1 root     root          14 Jul  8  2016 
 /usr/lib/libwrap.so.1 -> libwrap.so.1.0
 -rwxr-xr-x   1 root     bin        61056 May 23 10:06 
 /usr/lib/libwrap.so.1.0
 -rw-r--r--   1 root     bin         1294 Jul  8  2016 /usr/lib/llib-lwrap
 -rw-r--r--   1 root     bin        33765 May 23 10:07 /usr/lib/llib-lwrap.ln


 > 2. IS_BUILTIN.tcp_wrappers will tell you if a builtin has been detected.

 i86:

 $ bmake show-var VARNAME=IS_BUILTIN.tcp_wrappers
 no

 sparc:

 $ bmake show-var VARNAME=IS_BUILTIN.tcp_wrappers
 yes


 > 3. USE_BUILTIN.tcp_wrappers will tell you if the builtin will be used.

 identical to IS_BUILTIN


 I have tried different debug options of bmake some time ago, but none 
 would help (in a way I am aware of) to understand the flow of 
 information and to see, at which point things start to diverge.

 -- 
 Jörn Clausen
 Plattformen & Serverdienste
 BITS - Bielefelder IT-Servicezentrum

From: Jonathan Perkin <jperkin@pkgsrc.org>
To: =?iso-8859-1?Q?J=F6rn?= Clausen <joern.clausen@uni-bielefeld.de>
Cc: gnats-bugs@NetBSD.org, solaris-pkg-people@NetBSD.org,
	gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Mon, 19 Jun 2017 14:12:43 +0100

 * On 2017-06-19 at 14:08 BST, Jörn Clausen wrote:

 > > 1. security/tcp_wrappers/builtin.mk is the logic to determine whether a
 > >    builtin is available, and if so whether it should be used.  In this
 > >    case it checks for the existence of /usr/include/tcpd.h and libwrap in
 > >    the system library paths.
 > 
 > Solaris 11.3/i86:
 > 
 > $ ll /usr/include/tcpd.h
 > -rw-r--r--   1 root     bin        10386 Jun  1  2015 /usr/include/tcpd.h
 > 
 > $ ll /usr/lib/*wrap*
 > lrwxrwxrwx   1 root     root          14 May 28  2015 /usr/lib/libwrap.so ->
 > libwrap.so.1.0
 > lrwxrwxrwx   1 root     root          14 May 28  2015 /usr/lib/libwrap.so.1
 > -> libwrap.so.1.0
 > -rwxr-xr-x   1 root     bin        56960 May 29 10:12
 > /usr/lib/libwrap.so.1.0
 > -rw-r--r--   1 root     bin         1294 May 28  2015 /usr/lib/llib-lwrap
 > -rw-r--r--   1 root     bin        33904 May 29 10:12 /usr/lib/llib-lwrap.ln
 > 
 > Solaris 11.3/sparc:
 > 
 > $ ll /usr/include/tcpd.h
 > -rw-r--r--   1 root     bin        10386 Jul  8  2016 /usr/include/tcpd.h
 > 
 > $ ll /usr/lib/*wrap*
 > lrwxrwxrwx   1 root     root          14 Jul  8  2016 /usr/lib/libwrap.so ->
 > libwrap.so.1.0
 > lrwxrwxrwx   1 root     root          14 Jul  8  2016 /usr/lib/libwrap.so.1
 > -> libwrap.so.1.0
 > -rwxr-xr-x   1 root     bin        61056 May 23 10:06
 > /usr/lib/libwrap.so.1.0
 > -rw-r--r--   1 root     bin         1294 Jul  8  2016 /usr/lib/llib-lwrap
 > -rw-r--r--   1 root     bin        33765 May 23 10:07 /usr/lib/llib-lwrap.ln
 > 
 > 
 > > 2. IS_BUILTIN.tcp_wrappers will tell you if a builtin has been detected.
 > 
 > i86:
 > 
 > $ bmake show-var VARNAME=IS_BUILTIN.tcp_wrappers
 > no
 > 
 > sparc:
 > 
 > $ bmake show-var VARNAME=IS_BUILTIN.tcp_wrappers
 > yes

 Ok, so let's dig a little deeper into the logic of builtin.mk.  What are

   BUILTIN_LIB_FOUND.wrap
   H_TCP_WRAPPERS

 set to on each?

 -- 
 Jonathan Perkin       www.perkin.org.uk
 github.com/jperkin  twitter.com/jperkin

From: =?UTF-8?Q?J=c3=b6rn_Clausen?= <joern.clausen@uni-bielefeld.de>
To: Jonathan Perkin <jperkin@pkgsrc.org>
Cc: gnats-bugs@NetBSD.org, solaris-pkg-people@NetBSD.org,
 gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Mon, 19 Jun 2017 17:12:26 +0200

 > Ok, so let's dig a little deeper into the logic of builtin.mk.  What are
 >
 >   BUILTIN_LIB_FOUND.wrap
 >   H_TCP_WRAPPERS
 >
 > set to on each?
 >

 i86:

 $ bmake show-var VARNAME=BUILTIN_LIB_FOUND.wrap
 no
 $ bmake show-var VARNAME=H_TCP_WRAPPERS
 /usr/include/tcpd.h


 sparc:

 $ bmake show-var VARNAME=BUILTIN_LIB_FOUND.wrap
 yes
 $ bmake show-var VARNAME=H_TCP_WRAPPERS
 /usr/include/tcpd.h


 Okay, I guess this is the problem:

 i86:

 $ bmake show-var VARNAME=COMPILER_LIB_DIRS
 /lib/amd64 /usr/lib/amd64

 sparc:

 $ bmake show-var VARNAME=COMPILER_LIB_DIRS
 /lib /usr/lib


 Both installations were bootstrapped with "--abi 64". Looking at "gcc 
 -dumpspecs", I think GCC is sane on both platforms (i.e. where i86 has 
 "amd64", sparc has "sparcv9").


 Ah, my dear friend "hans" left this in mk/platform/SunOS.mk:

 revision 1.47
 date: 2013-02-01 13:25:16 +0100;  author: hans;  state: Exp;  lines: +5 -1;
 Set LIBABISUFFIX on SunOS x86_64. Should probably also be done for
 sparcv9, but I can't test that.

 Yes, indeed, this should probably be symmetrical on both 
 architectures... Although I doubt that this is correct at all, I guess 
 this is more of a hack.

 -- 
 Jörn Clausen
 Plattformen & Serverdienste
 BITS - Bielefelder IT-Servicezentrum

From: Jonathan Perkin <jperkin@pkgsrc.org>
To: =?iso-8859-1?Q?J=F6rn?= Clausen <joern.clausen@uni-bielefeld.de>
Cc: gnats-bugs@NetBSD.org, solaris-pkg-people@NetBSD.org,
	gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Mon, 19 Jun 2017 16:34:12 +0100

 Ok, if you're able to test this patch sufficiently then we can commit it,
 I don't know of many people left who have SPARC and can test this so I'd
 be happy to go with the results of your tests.

 diff --git a/mk/platform/SunOS.mk b/mk/platform/SunOS.mk
 index b2cfd6c9636a..fc9fc2190df2 100644
 --- a/mk/platform/SunOS.mk
 +++ b/mk/platform/SunOS.mk
 @@ -113,9 +113,9 @@ _STRIPFLAG_INSTALL?=	${_INSTALL_UNSTRIPPED:D:U-s}	# install(1) option to strip

  PKG_TOOLS_BIN?=		${LOCALBASE}/sbin

 -.if ${MACHINE_ARCH} == "x86_64"
 -LIBABISUFFIX=		/amd64
 -.endif
 +LIBABISUFFIX.sparc64=	/sparcv9
 +LIBABISUFFIX.x86_64=	/amd64
 +LIBABISUFFIX?=		${LIBABISUFFIX.${MACHINE_ARCH}}
  _OPSYS_SYSTEM_RPATH?=	/lib${LIBABISUFFIX}:/usr/lib${LIBABISUFFIX}
  _OPSYS_LIB_DIRS?=	/lib${LIBABISUFFIX} /usr/lib${LIBABISUFFIX}
  _OPSYS_INCLUDE_DIRS?=	/usr/include

 Thanks,

 -- 
 Jonathan Perkin       www.perkin.org.uk
 github.com/jperkin  twitter.com/jperkin

From: =?UTF-8?Q?J=C3=B6rn_Clausen?= <joernc@googlemail.com>
To: Jonathan Perkin <jperkin@pkgsrc.org>
Cc: gnats-bugs@netbsd.org, solaris-pkg-people@netbsd.org, 
	gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Mon, 19 Jun 2017 20:23:49 +0200

 I'll test it tomorrow and let you know.

 Technically, this solves the issue that lead me here, but not in a
 nice way: net/net-snmp depends on tcpwrapper. On i86 the native
 library is not found and the pkgsrc version is used, ending in a
 successful build of net-snmp. On sparc, net-snmp tries to use the
 native version and bails out. Both should find the native version -
 and fail to use it...

 On Mon, Jun 19, 2017 at 5:34 PM, Jonathan Perkin <jperkin@pkgsrc.org> wrote:
 > Ok, if you're able to test this patch sufficiently then we can commit it,
 > I don't know of many people left who have SPARC and can test this so I'd
 > be happy to go with the results of your tests.
 >
 > diff --git a/mk/platform/SunOS.mk b/mk/platform/SunOS.mk
 > index b2cfd6c9636a..fc9fc2190df2 100644
 > --- a/mk/platform/SunOS.mk
 > +++ b/mk/platform/SunOS.mk
 > @@ -113,9 +113,9 @@ _STRIPFLAG_INSTALL?=        ${_INSTALL_UNSTRIPPED:D:U-s}    # install(1) option to strip
 >
 >  PKG_TOOLS_BIN?=                ${LOCALBASE}/sbin
 >
 > -.if ${MACHINE_ARCH} == "x86_64"
 > -LIBABISUFFIX=          /amd64
 > -.endif
 > +LIBABISUFFIX.sparc64=  /sparcv9
 > +LIBABISUFFIX.x86_64=   /amd64
 > +LIBABISUFFIX?=         ${LIBABISUFFIX.${MACHINE_ARCH}}
 >  _OPSYS_SYSTEM_RPATH?=  /lib${LIBABISUFFIX}:/usr/lib${LIBABISUFFIX}
 >  _OPSYS_LIB_DIRS?=      /lib${LIBABISUFFIX} /usr/lib${LIBABISUFFIX}
 >  _OPSYS_INCLUDE_DIRS?=  /usr/include
 >
 > Thanks,
 >
 > --
 > Jonathan Perkin       www.perkin.org.uk
 > github.com/jperkin  twitter.com/jperkin



 -- 
 Joern Clausen
 http://www.oe-files.de/photography/

From: Jonathan Perkin <jperkin@pkgsrc.org>
To: =?iso-8859-1?Q?J=F6rn?= Clausen <joernc@googlemail.com>
Cc: gnats-bugs@netbsd.org, solaris-pkg-people@netbsd.org,
	gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Mon, 19 Jun 2017 20:20:46 +0100

 * On 2017-06-19 at 19:24 BST, Jörn Clausen wrote:

 > I'll test it tomorrow and let you know.
 > 
 > Technically, this solves the issue that lead me here, but not in a
 > nice way: net/net-snmp depends on tcpwrapper. On i86 the native
 > library is not found and the pkgsrc version is used, ending in a
 > successful build of net-snmp. On sparc, net-snmp tries to use the
 > native version and bails out. Both should find the native version -
 > and fail to use it...

 Ok, that's fine, we just need to put a proper fix in at the right place.
 The order of which would be something like:

 1. If it's just a bug in net-snmp's tcp_wrappers support then we should
    fix it there via a software patch.

 2. If the builds are failing because Solaris tcp_wrappers is fundamentally
    incompatible with pkgsrc tcp_wrappers and is likely to cause problems
    with a reasonable number of packages, then we should either modify the
    tcp_wrappers builtin.mk file so that IS_BUILTIN returns no on that
    platform, or set _OPSYS_PREFER.tcp_wrappers=pkgsrc in
    mk/platform/SunOS.mk.

 3. If it's that net-snmp is incompatible with Solaris tcp_wrappers in a
    major way then we can do something like set PREFER.tcp_wrappers=pkgsrc
    in the net-snmp Makefile for SunOS.  This isn't a great solution as it
    can lead to conflicts between some packages using native tcp_wrappers
    and others using pkgsrc, hence why it is last.

 -- 
 Jonathan Perkin       www.perkin.org.uk
 github.com/jperkin  twitter.com/jperkin

From: =?UTF-8?Q?J=c3=b6rn_Clausen?= <joern.clausen@uni-bielefeld.de>
To: Jonathan Perkin <jperkin@pkgsrc.org>
Cc: gnats-bugs@NetBSD.org, solaris-pkg-people@NetBSD.org,
 gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Wed, 21 Jun 2017 09:01:11 +0200

 On 19.06.17 17:34, Jonathan Perkin wrote:
 > Ok, if you're able to test this patch sufficiently then we can commit it,
 > I don't know of many people left who have SPARC and can test this so I'd
 > be happy to go with the results of your tests.

 I have updated a few dozen packages on each platform, no problems so 
 far. As expected, net-snmp now built tcp_wrapper as prerequisite on 
 sparc as well. As I don't have the time to investigate the differences 
 between native and pkgsrc tcp-wrapper, I'd say we leave it at this.

 BTW: The original problem regarding mpfr and gmp is still present, so 
 this PR should be kept open.

 -- 
 Jörn Clausen
 Plattformen & Serverdienste
 BITS - Bielefelder IT-Servicezentrum

From: "Jonathan Perkin" <jperkin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52250 CVS commit: pkgsrc/mk/platform
Date: Wed, 21 Jun 2017 08:20:10 +0000

 Module Name:	pkgsrc
 Committed By:	jperkin
 Date:		Wed Jun 21 08:20:10 UTC 2017

 Modified Files:
 	pkgsrc/mk/platform: SunOS.mk

 Log Message:
 Set LIBABISUFFIX correctly on SunOS/sparc64.  Tested by Jörn Clausen as
 part of PR#52250.


 To generate a diff of this commit:
 cvs rdiff -u -r1.75 -r1.76 pkgsrc/mk/platform/SunOS.mk

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

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Tue, 20 Feb 2018 07:24:23 +0000

 On Wed, Jun 21, 2017 at 07:05:01AM +0000, J?rn Clausen wrote:
  >  BTW: The original problem regarding mpfr and gmp is still present, so 
  >  this PR should be kept open.

 As already noted the mpfr builtin.mk seems to be baloney. That should
 get fixed. (It should look roughly like the gmp one.)

 If the gmp one still isn't working, I guess the first question is what
 gmp.h it's finding, what version of gmp it thinks that is, and why it
 thinks that's suitable for use.

 What are IS_BUILTIN.gmp, BUILTIN_VERSION.gmp, and H_GMP getting set
 to? Also, am I correct in thinking USE_BUILTIN.gmp is coming out
 "yes"?

 -- 
 David A. Holland
 dholland@netbsd.org

From: Joern Clausen <joern.clausen@uni-bielefeld.de>
To: gnats-bugs@NetBSD.org, solaris-pkg-people@NetBSD.org,
 gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Tue, 20 Feb 2018 11:02:23 +0100

 On 02/20/18 08:25, David Holland wrote:
 > The following reply was made to PR pkg/52250; it has been noted by GNATS.
 > 
 > From: David Holland <dholland-pbugs@netbsd.org>
 > To: gnats-bugs@NetBSD.org
 > Cc:
 > Subject: Re: pkg/52250: gmp and mpfr not found by some packages
 > Date: Tue, 20 Feb 2018 07:24:23 +0000
 > 
 >   On Wed, Jun 21, 2017 at 07:05:01AM +0000, J?rn Clausen wrote:
 >    >  BTW: The original problem regarding mpfr and gmp is still present, so
 >    >  this PR should be kept open.
 >   
 >   As already noted the mpfr builtin.mk seems to be baloney. That should
 >   get fixed. (It should look roughly like the gmp one.)
 >   
 >   If the gmp one still isn't working, I guess the first question is what
 >   gmp.h it's finding, what version of gmp it thinks that is, and why it
 >   thinks that's suitable for use.
 >   
 >   What are IS_BUILTIN.gmp, BUILTIN_VERSION.gmp, and H_GMP getting set
 >   to? Also, am I correct in thinking USE_BUILTIN.gmp is coming out
 >   "yes"?

 I'm not sure if the solution was that simple all the time, or if 
 anything changed in the meantime:

 Adding

 BUILDLINK_API_DEPENDS.gmp+=     gmp>=5.0

 to gnutls's Makefile fixes the problem. The native gmp is

 $ bmake show-var VARNAME=BUILTIN_VERSION.gmp
 4.3.2

 The fix above is stolen from security/nettle, which already worked in 
 the past.


 In the original PR 52244 I had trouble building print/luatex because of 
 mpfr. The same there:

 $ bmake show-var VARNAME=BUILTIN_VERSION.mpfr
 2.4.2

 but pkgsrc provides version 4.0.1. luatex includes mpfr without 
 requesting a minimal version.

 I think the overall fix would be to check all packages depending on gmp 
 and mpfr and adding appropriate BUILDLINK_API_DEPENDS - whatever the 
 minimal version might be in any case. Another fix might be to make SunOS 
 always use pkgsrc's versions and never ever use the builtins.

 -- 
 Jörn Clausen
 Plattformen & Serverdienste
 BITS - Bielefelder IT-Servicezentrum

From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52250 CVS commit: pkgsrc/security/gnutls
Date: Sun, 29 Apr 2018 04:09:09 +0000

 Module Name:	pkgsrc
 Committed By:	dholland
 Date:		Sun Apr 29 04:09:08 UTC 2018

 Modified Files:
 	pkgsrc/security/gnutls: Makefile

 Log Message:
 Set BUILDLINK_API_DEPENDS.gmp to require gmp>=5.0, per PR 52250.
 Otherwise on Solaris it finds a really old builtin gmp and fails.


 To generate a diff of this commit:
 cvs rdiff -u -r1.177 -r1.178 pkgsrc/security/gnutls/Makefile

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

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Sun, 29 Apr 2018 04:32:09 +0000

 On Tue, Feb 20, 2018 at 10:05:01AM +0000, Joern Clausen wrote:
  >  I think the overall fix would be to check all packages depending on gmp 
  >  and mpfr and adding appropriate BUILDLINK_API_DEPENDS - whatever the 
  >  minimal version might be in any case. Another fix might be to make SunOS 
  >  always use pkgsrc's versions and never ever use the builtins.

 There's on the order of 100 such packages, and since minimum versions
 are rarely documented well (or at all) this doesn't entirely seem like
 an effective approach.

 Also some crosschecking with the Solaris bulk reports doesn't seem to
 suggest that it's a huge problem, although maybe that's a function of
 Solaris version.

 Would it be feasible for you to put something like

 .if defined(USE_BUILTIN.gmp) && !empty(USE_BUILTIN.gmp:M[Yy][Ee][Ss])
 .warning "****** CAUTION"
 .warning "****** Using builtin gmp."
 .warning "****** This might be problematic."
 .endif

 (and maybe another one for mpfr) in your mk.conf, so if you step on
 this problem again it doesn't waste your time, and if you hit any
 cases let us know?

 -- 
 David A. Holland
 dholland@netbsd.org

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org, joern.clausen@uni-bielefeld.de
Cc: 
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Sun, 29 Apr 2018 04:40:58 +0000

 On Tue, Feb 20, 2018 at 07:25:00AM +0000, David Holland wrote:
  >  As already noted the mpfr builtin.mk seems to be baloney. That should
  >  get fixed. (It should look roughly like the gmp one.)

 Here's a new builtin.mk for mpfr, untested (I don't have a machine
 with a builtin mpfr) ... let me know if (a) it seems to work and (b)
 if by itself it solves any of the problems.

    ------
 # $NetBSD$

 BUILTIN_PKG:=	mpfr

 BUILTIN_FIND_HEADERS_VAR:=	H_MPFR
 BUILTIN_FIND_HEADERS.H_MPFR=	mpfr.h mpfr/mpfr.h

 BUILTIN_VERSION_SCRIPT.mpfr= ${AWK} \
 	'/\#define[ \t]*MPFR_VERSION_STRING[ \t]/ { \
 	v = substr($$3, 2, length($$3)-2) } \
 	END { gsub("-p",".",v); print v }'

 .include "../../mk/buildlink3/bsd.builtin.mk"

 ###
 ### Determine if there is a built-in implementation of the package and
 ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
 ###
 .if !defined(IS_BUILTIN.mpfr)
 IS_BUILTIN.mpfr=	no
 .  if empty(H_MPFR:M__nonexistent__) && empty(H_MPFR:M${LOCALBASE}/*)
 IS_BUILTIN.mpfr=	yes
 .  endif
 .endif
 MAKEVARS+=	IS_BUILTIN.mpfr

 ###
 ### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
 ### a package name to represent the built-in package.
 ###
 .if !defined(BUILTIN_PKG.mpfr) && \
     !empty(IS_BUILTIN.mpfr:M[yY][eE][sS]) && \
     empty(H_MPFR:M__nonexistent__)
 BUILTIN_VERSION.mpfr!=	${BUILTIN_VERSION_SCRIPT.mpfr} ${H_MPFR}
 BUILTIN_PKG.mpfr=	mpfr-${BUILTIN_VERSION.mpfr}
 .endif
 MAKEVARS+=	BUILTIN_PKG.mpfr

 ###
 ### Determine whether we should use the built-in implementation if it
 ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
 ###
 .if !defined(USE_BUILTIN.mpfr)
 .  if ${PREFER.mpfr} == "pkgsrc"
 USE_BUILTIN.mpfr=	no
 .  else
 USE_BUILTIN.mpfr=	${IS_BUILTIN.mpfr}
 .    if defined(BUILTIN_PKG.mpfr) && !empty(IS_BUILTIN.mpfr:M[yY][eE][sS])
 USE_BUILTIN.mpfr=	yes
 .      for _dep_ in ${BUILDLINK_API_DEPENDS.mpfr}
 .        if !empty(USE_BUILTIN.mpfr:M[yY][eE][sS])
 USE_BUILTIN.mpfr!=	\
         if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.mpfr:Q}; then	\
 		${ECHO} yes;						\
         else								\
 		${ECHO} no;						\
         fi
 .        endif
 .      endfor
 .    endif
 .  endif  # PREFER.mpfr
 .endif
 MAKEVARS+=	USE_BUILTIN.mpfr

 CHECK_BUILTIN.mpfr?=	no
 .if !empty(CHECK_BUILTIN.mpfr:M[Nn][Oo])
 .  if !empty(USE_BUILTIN.mpfr:M[Yy][Ee][Ss])
 MPFR_INCLUDE=		${H_MPFR:H}
 CONFIGURE_ARGS+=	--with-mpfr-include=${MPFR_INCLUDE}
 BUILDLINK_INCDIRS.mpfr=	${MPFR_INCLUDE}
 CONFIGURE_ARGS+=	--with-mpfr-lib=${BUILDLINK_PREFIX.mpfr}/lib${LIBABISUFFIX}
 BUILDLINK_LIBDIRS.mpfr=	lib${LIBABISUFFIX}
 CPPFLAGS+=		-I${MPFR_INCLUDE}
 CFLAGS+=		-I${MPFR_INCLUDE}
 .  endif
 .endif # CHECK_BUILTIN.mpfr
    ------


 -- 
 David A. Holland
 dholland@netbsd.org

From: Joern Clausen <joern.clausen@uni-bielefeld.de>
To: David Holland <dholland-pbugs@netbsd.org>, gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Wed, 02 May 2018 11:07:39 +0200

 Thanks for the new builtin.mk. I (still) get

 $ bmake show-var VARNAME=BUILDLINK_PREFIX.mpfr
 /usr

 in print/luatex. Only with

 PREFER_PKGSRC = mpfr

 I get

 $ bmake show-var VARNAME=BUILDLINK_PREFIX.mpfr
 /opt/pkg-hrz/20180102

 So builtin.mk probably works as intended, but I still need to work 
 around the fact that the builtin mpfr is not good enough in some cases.

 -- 
 Jörn Clausen
 Plattformen & Serverdienste
 BITS - Bielefelder IT-Servicezentrum

From: Joern Clausen <joern.clausen@uni-bielefeld.de>
To: gnats-bugs@NetBSD.org, solaris-pkg-people@NetBSD.org,
 gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52250: gmp and mpfr not found by some packages
Date: Wed, 02 May 2018 11:26:00 +0200

 On 04/29/18 06:35, David Holland wrote:
 >   On Tue, Feb 20, 2018 at 10:05:01AM +0000, Joern Clausen wrote:
 >    >  I think the overall fix would be to check all packages depending on gmp
 >    >  and mpfr and adding appropriate BUILDLINK_API_DEPENDS - whatever the
 >    >  minimal version might be in any case. Another fix might be to make SunOS
 >    >  always use pkgsrc's versions and never ever use the builtins.
 >   
 >   There's on the order of 100 such packages, and since minimum versions
 >   are rarely documented well (or at all) this doesn't entirely seem like
 >   an effective approach.
 >   
 >   Also some crosschecking with the Solaris bulk reports doesn't seem to
 >   suggest that it's a huge problem, although maybe that's a function of
 >   Solaris version.

 If I remember @jperkin correctly, the bulk builds are done on Illumos, 
 which probably does have a different (i.e. newer) userland compared to 
 Solaris 11.

 >   Would it be feasible for you to put something like
 >   
 >   .if defined(USE_BUILTIN.gmp) && !empty(USE_BUILTIN.gmp:M[Yy][Ee][Ss])
 >   .warning "****** CAUTION"
 >   .warning "****** Using builtin gmp."
 >   .warning "****** This might be problematic."
 >   .endif
 >   
 >   (and maybe another one for mpfr) in your mk.conf, so if you step on
 >   this problem again it doesn't waste your time, and if you hit any
 >   cases let us know?

 I don't think that a mix of packages using native and pkgsrc versions of 
 gmp and mpfr is a good idea, so I will keep

 PREFER_PKGSRC = gmp mpfr

 anyway and not try to solve this on a per-package level. And if the 
 per-package solution depends on the exact derivative of Solaris, I think 
 this will get way to complicated.

 -- 
 Jörn Clausen
 Plattformen & Serverdienste
 BITS - Bielefelder IT-Servicezentrum

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