NetBSD Problem Report #48974

From www@NetBSD.org  Tue Jul  8 07:54:32 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(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 1E212A6545
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  8 Jul 2014 07:54:32 +0000 (UTC)
Message-Id: <20140708075430.4EC05A6548@mollari.NetBSD.org>
Date: Tue,  8 Jul 2014 07:54:30 +0000 (UTC)
From: joern.clausen@uni-bielefeld.de
Reply-To: joern.clausen@uni-bielefeld.de
To: gnats-bugs@NetBSD.org
Subject: textproc/mdocml does not build on Solaris 10
X-Send-Pr-Version: www-1.0

>Number:         48974
>Category:       pkg
>Synopsis:       textproc/mdocml does not build on Solaris 10
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 08 07:55:00 +0000 2014
>Last-Modified:  Wed Jul 09 14:40:00 +0000 2014
>Originator:     Jörn Clausen
>Release:        
>Organization:
University of Bielefeld
>Environment:
>Description:
textproc/mdocml does not link on Solaris 10:

--- mandoc ---
Undefined                       first referenced
 symbol                             in file
asprintf                            libmandoc.a(mdoc.o)
ld: fatal: Symbol referencing errors. No output written to mandoc
collect2: error: ld returned 1 exit status
*** [mandoc] Error code 1

because Solaris 10 does not provide asprintf in libc.

There is an implementation in devel/gettext-asprintf. What is the correct way to tell mdocml to additionally link this library? Simply adding

.include "../../devel/gettext-asprintf/buildlink3.mk"

is not enough, and I haven't found the answer in the pkgsrc guide. Maybe I didn't look hard enough?
>How-To-Repeat:

>Fix:

>Audit-Trail:
From: =?UTF-8?Q?J=C3=B6rn_Clausen?= <joernc@googlemail.com>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/48974: textproc/mdocml does not build on Solaris 10
Date: Tue, 8 Jul 2014 10:06:58 +0200

 BTW: I have given this a high priority, because a lot of packages now
 depend on mdocml and consequently fail to build.

 On Tue, Jul 8, 2014 at 9:55 AM,  <joern.clausen@uni-bielefeld.de> wrote:
 >>Number:         48974
 >>Category:       pkg
 >>Synopsis:       textproc/mdocml does not build on Solaris 10
 >>Confidential:   no
 >>Severity:       serious
 >>Priority:       high
 >>Responsible:    pkg-manager
 >>State:          open
 >>Class:          sw-bug
 >>Submitter-Id:   net
 >>Arrival-Date:   Tue Jul 08 07:55:00 +0000 2014
 >>Originator:     J=C3=B6rn Clausen
 >>Release:
 >>Organization:
 > University of Bielefeld
 >>Environment:
 >>Description:
 > textproc/mdocml does not link on Solaris 10:
 >
 > --- mandoc ---
 > Undefined                       first referenced
 >  symbol                             in file
 > asprintf                            libmandoc.a(mdoc.o)
 > ld: fatal: Symbol referencing errors. No output written to mandoc
 > collect2: error: ld returned 1 exit status
 > *** [mandoc] Error code 1
 >
 > because Solaris 10 does not provide asprintf in libc.
 >
 > There is an implementation in devel/gettext-asprintf. What is the correct=
  way to tell mdocml to additionally link this library? Simply adding
 >
 > .include "../../devel/gettext-asprintf/buildlink3.mk"
 >
 > is not enough, and I haven't found the answer in the pkgsrc guide. Maybe =
 I didn't look hard enough?
 >>How-To-Repeat:
 >
 >>Fix:
 >



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

From: "OBATA Akio" <obata@lins.jp>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/48974: textproc/mdocml does not build on Solaris 10
Date: Tue, 08 Jul 2014 17:14:31 +0900

 Please refer to mk/features/features-vars.mk

   USE_FEATURES+=asprintf

 (and with some source changes?)

 In mk/platform/SunOS.mk:
 _OPSYS_MISSING_FEATURES=asprintf

 Is it not true for Solaris 11?

From: =?ISO-8859-15?Q?J=F6rn_Clausen?= <joern.clausen@uni-bielefeld.de>
To: gnats-bugs@NetBSD.org
Cc: OBATA Akio <obata@lins.jp>, pkg-manager@NetBSD.org, gnats-admin@NetBSD.org,
 pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/48974: textproc/mdocml does not build on Solaris 10
Date: Tue, 08 Jul 2014 10:47:51 +0200

 >   Please refer to mk/features/features-vars.mk
 >
 >     USE_FEATURES+=asprintf
 >
 >   (and with some source changes?)
 >
 >   In mk/platform/SunOS.mk:
 >   _OPSYS_MISSING_FEATURES=asprintf
 >
 >   Is it not true for Solaris 11?

 Is the idea to link the complete libnbcompat.a, or only the necessary 
 snippet, in this case asprintf.o?

 After adding

 USE_FEATURES+=asprintf

 libnbcompat is build and an appropriate -L flag to work/libnbcompat is 
 added for mdocml, but nothing actually links either to the library or 
 the object file.

 I can't say if asprintf is included in Solaris 11. Probably yes, 
 otherwise the failure of this package would have been detected much earlier.

 -- 
   Jörn Clausen                             joern.clausen@uni-bielefeld.de
   Hochschulrechenzentrum                 http://www.uni-bielefeld.de/hrz/
   Universität Bielefeld

From: =?ISO-8859-15?Q?J=F6rn_Clausen?= <joern.clausen@uni-bielefeld.de>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@NetBSD.org, gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/48974: textproc/mdocml does not build on Solaris 10
Date: Wed, 09 Jul 2014 14:51:08 +0200

 My current workaround is this change to pkgsrc's Makefile:

 --- Makefile    2014/07/08 08:16:59     1.1
 +++ Makefile    2014/07/08 15:31:12
 @@ -20,6 +20,8 @@
   SUBST_FILES.roff+=     eqn.7 man.7 mdoc.7 tbl.7
   SUBST_SED.roff=                -e 's,Xr roff,Xr mandoc-roff,g'

 +USE_FEATURES+=asprintf
 +
   .include "../../mk/bsd.fast.prefs.mk"

   # Mac OS X and Solaris 10 and newer do not support static binaries.


 combined with this patch to insert the necessary object in mdocml's 
 Makefile:

 --- Makefile.old        Tue Jul  8 17:25:49 2014
 +++ Makefile    Tue Jul  8 17:26:00 2014
 @@ -352,7 +352,7 @@
          $(INSTALL_DATA) mdocml.md5 
 $(PREFIX)/snapshots/mdocml-$(VERSION).md5

   libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
 -       $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
 +       $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) 
 ../libnbcompat/asprintf.o

   mandoc: $(MANDOC_OBJS) libmandoc.a
          $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a


 -- 
   Jörn Clausen                             joern.clausen@uni-bielefeld.de
   Hochschulrechenzentrum                 http://www.uni-bielefeld.de/hrz/
   Universität Bielefeld

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48974: textproc/mdocml does not build on Solaris 10
Date: Wed, 9 Jul 2014 15:19:37 +0200

 On Wed, Jul 09, 2014 at 12:55:00PM +0000, Jörn Clausen wrote:
 >  --- Makefile.old        Tue Jul  8 17:25:49 2014
 >  +++ Makefile    Tue Jul  8 17:26:00 2014
 >  @@ -352,7 +352,7 @@
 >           $(INSTALL_DATA) mdocml.md5 
 >  $(PREFIX)/snapshots/mdocml-$(VERSION).md5
 >  
 >    libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
 >  -       $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
 >  +       $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) 
 >  ../libnbcompat/asprintf.o
 >  
 >    mandoc: $(MANDOC_OBJS) libmandoc.a
 >           $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a

 Try adding FEATURE_LIBS to the mandoc link line instead.

 Joerg

From: =?ISO-8859-15?Q?J=F6rn_Clausen?= <joern.clausen@uni-bielefeld.de>
To: gnats-bugs@NetBSD.org
Cc: Joerg Sonnenberger <joerg@britannica.bec.de>, pkg-manager@NetBSD.org,
 gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/48974: textproc/mdocml does not build on Solaris 10
Date: Wed, 09 Jul 2014 15:58:43 +0200

 >   Try adding FEATURE_LIBS to the mandoc link line instead.

 Do you mean like this:

   mandoc: $(MANDOC_OBJS) libmandoc.a
 -       $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a
 +       $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a $(FEATURE_LIBS)


 That does not work:

 gcc -L/pkgsrc/source/pkgsrc/textproc/mdocml/work.pkgsrc-i86/libnbcompat 
 -L/usr/pkgsrc/20140707/lib -Wl,-R/usr/pkgsrc/20140707/lib -L/usr/lib 
 -Wl,-R/usr/lib -o mandoc eqn_html.o  html.o  man_html.o  mdoc_html.o 
 tbl_html.o  mdoc_man.o  eqn_term.o  man_term.o  mdoc_term.o  term.o 
 term_ascii.o  term_ps.o  tbl_term.o  main.o  out.o  tree.o libmandoc.a
 Undefined                       first referenced
   symbol                             in file
 asprintf                            libmandoc.a(mdoc.o)


 although FEATURE_LIBS is defined:

 $ bmake show-var VARNAME=FEATURE_LIBS
   -lnbcompat


 Even if it would work: Is it a good idea to replace all the functions 
 defined in libnbcompat, even those provided by the OS?

 -- 
   Jörn Clausen                             joern.clausen@uni-bielefeld.de
   Hochschulrechenzentrum                 http://www.uni-bielefeld.de/hrz/
   Universität Bielefeld

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	joern.clausen@uni-bielefeld.de
Subject: Re: pkg/48974: textproc/mdocml does not build on Solaris 10
Date: Wed, 9 Jul 2014 16:38:31 +0200

 On Wed, Jul 09, 2014 at 02:00:01PM +0000, Jörn Clausen wrote:
 >  >   Try adding FEATURE_LIBS to the mandoc link line instead.
 >  
 >  Do you mean like this:
 >  
 >    mandoc: $(MANDOC_OBJS) libmandoc.a
 >  -       $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a
 >  +       $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a $(FEATURE_LIBS)

 Yeah.

 >  That does not work:
 >  
 >  gcc -L/pkgsrc/source/pkgsrc/textproc/mdocml/work.pkgsrc-i86/libnbcompat 
 >  -L/usr/pkgsrc/20140707/lib -Wl,-R/usr/pkgsrc/20140707/lib -L/usr/lib 
 >  -Wl,-R/usr/lib -o mandoc eqn_html.o  html.o  man_html.o  mdoc_html.o 
 >  tbl_html.o  mdoc_man.o  eqn_term.o  man_term.o  mdoc_term.o  term.o 
 >  term_ascii.o  term_ps.o  tbl_term.o  main.o  out.o  tree.o libmandoc.a
 >  Undefined                       first referenced
 >    symbol                             in file
 >  asprintf                            libmandoc.a(mdoc.o)

 OIC It's not exported, e.g. ALL_ENV+= FEATURE_LIBS=${FEATURE_LIBS:Q} is
 also needed.

 >  Even if it would work: Is it a good idea to replace all the functions 
 >  defined in libnbcompat, even those provided by the OS?

 Existing and not-known-to-be-broken functions shouldn't be defined in
 libnbcompat.a.

 Joerg

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.