NetBSD Problem Report #40959

From www@NetBSD.org  Wed Mar  4 11:03:58 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 936A063BD3B
	for <gnats-bugs@gnats.netbsd.org>; Wed,  4 Mar 2009 11:03:58 +0000 (UTC)
Message-Id: <20090304110358.2593763BAB8@www.NetBSD.org>
Date: Wed,  4 Mar 2009 11:03:58 +0000 (UTC)
From: joern.clausen@uni-bielefeld.de
Reply-To: joern.clausen@uni-bielefeld.de
To: gnats-bugs@NetBSD.org
Subject: security/mhash with Sun Studio Compiler
X-Send-Pr-Version: www-1.0

>Number:         40959
>Category:       pkg
>Synopsis:       security/mhash with Sun Studio Compiler
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 04 11:05:00 +0000 2009
>Closed-Date:    Thu Jun 18 06:21:52 +0000 2015
>Last-Modified:  Thu Jun 18 06:21:52 +0000 2015
>Originator:     Jörn Clausen
>Release:        
>Organization:
University of Bielefeld
>Environment:
SunOS opensolaris 5.11 snv_101b i86pc i386 i86pc

>Description:
security/mhash does not compile with Sun Studio Compiler.
>How-To-Repeat:

>Fix:
One case of a void function returning an int:

--- lib/stdfns.c.orig   2009-03-04 02:04:19.075011426 -0800
+++ lib/stdfns.c
@@ -222,7 +222,8 @@ mutils_memcpy(void *dest, __const void *
        if ((n < 16) || ((mutils_word32)ptr1 & 0x3) || ((mutils_word32)ptr2 
 & 0x3))
        {
-               return mutils_memcpy8(ptr2, ptr1, n);
+               mutils_memcpy8(ptr2, ptr1, n);
+               return;
        }

        words = n >> 2;

Note that this has been fixed in the current version 0.9.9.9 of mhash.

And this definition of __const is not caught:

--- include/mutils/mutils.h.orig        2009-03-04 02:04:19.069664077 -0800
+++ include/mutils/mutils.h
@@ -23,7 +23,7 @@

 #include <mutils/mincludes.h>

-#if defined(const)
+#if defined(const) || (defined(sun) && !defined(__GNUC__))
 #define __const const
 #endif 

I'm not sure if one should also check for "__sun__", but this patch works both with Sun Studio and GCC. This patch has been sent to mhash developer list, but awaits approval.

>Release-Note:

>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40959 CVS commit: pkgsrc/security/mhash
Date: Thu, 18 Jun 2015 06:17:33 +0000

 Module Name:	pkgsrc
 Committed By:	dholland
 Date:		Thu Jun 18 06:17:33 UTC 2015

 Modified Files:
 	pkgsrc/security/mhash: distinfo
 Added Files:
 	pkgsrc/security/mhash/patches: patch-include_mutils_mutils.h
 	    patch-lib_stdfns.c

 Log Message:
 Add Sun Studio build fixes from Joern Clausen in PR 40959.


 To generate a diff of this commit:
 cvs rdiff -u -r1.10 -r1.11 pkgsrc/security/mhash/distinfo
 cvs rdiff -u -r0 -r1.1 \
     pkgsrc/security/mhash/patches/patch-include_mutils_mutils.h \
     pkgsrc/security/mhash/patches/patch-lib_stdfns.c

 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: dholland@NetBSD.org
State-Changed-When: Thu, 18 Jun 2015 06:21:52 +0000
State-Changed-Why:
Committed, thanks. I used __sun as per the standard pkgsrc recommendation;
if that doesn't work for some reason let me know.


>Unformatted:

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.