NetBSD Problem Report #56038

From www@netbsd.org  Thu Mar  4 22:27:32 2021
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_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 2A2871A921F
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  4 Mar 2021 22:27:32 +0000 (UTC)
Message-Id: <20210304222730.D7D561A924E@mollari.NetBSD.org>
Date: Thu,  4 Mar 2021 22:27:30 +0000 (UTC)
From: mdehling@gmail.com
Reply-To: mdehling@gmail.com
To: gnats-bugs@NetBSD.org
Subject: databases/lmdb fails to compile on Solaris 10u7 w/ SunStudio 12u1
X-Send-Pr-Version: www-1.0

>Number:         56038
>Category:       pkg
>Synopsis:       databases/lmdb fails to compile on Solaris 10u7 w/ SunStudio 12u1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 04 22:30:00 +0000 2021
>Last-Modified:  Fri Mar 05 04:35:01 +0000 2021
>Originator:     Malte Dehling
>Release:        pkgsrc-2020Q4
>Organization:
>Environment:
SunOS deuterium 5.10 Generic_139555-08 sun4u sparc sun4u
cc: Sun C 5.10 SunOS_sparc 2009/06/03

>Description:
Building databases/lmdb fails with a missing symbol fdatasync.
>How-To-Repeat:

>Fix:
On Solaris 10 fdatasync is defined in /usr/lib/64/librt.so.1, so simply adding -lrt to LDFLAGS.SunOS works.  This should work for older versions as well.

A quick google search seems to indicate that -lrt is not required in Solaris 11.

The following patch works for me, though I'm not convinced the test for OS_VERSION below is the right thing to do here.


--- Makefile.orig       Thu Mar  4 22:32:49 2021
+++ Makefile    Thu Mar  4 23:26:13 2021
@@ -27,6 +27,11 @@
 TEST_TARGET=           test

 .include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "SunOS" && ${OS_VERSION} != "5.11"
+LDFLAGS+=              -lrt
+.endif
+
 .if ${OPSYS} == "Darwin"
 MAKE_FLAGS+=   SOEXT=.dylib
 MAKE_FLAGS+=   SOLIBS=-install_name\ ${PREFIX}/lib/liblmdb.dylib

>Audit-Trail:
From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/56038: databases/lmdb fails to compile on Solaris 10u7 w/
 SunStudio 12u1
Date: Fri, 5 Mar 2021 04:33:04 +0000

 On Thu, Mar 04, 2021 at 10:30:00PM +0000, mdehling@gmail.com wrote:
  > +.if ${OPSYS} == "SunOS" && ${OS_VERSION} != "5.11"
  > +LDFLAGS+=              -lrt
  > +.endif

 Since it probably doesn't work on Solaris 9 anyway (and with high
 probability nobody cares) wouldn't it make more sense to do

  +.if ${OPSYS} == "SunOS" && ${OS_VERSION} == "5.10"
  +LDFLAGS+=              -lrt
  +.endif

 ?

 -- 
 David A. Holland
 dholland@netbsd.org

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.