NetBSD Problem Report #46779

From  Tue Aug  7 12:09:47 2012
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id D1CCD63B85F
	for <>; Tue,  7 Aug 2012 12:09:47 +0000 (UTC)
Message-Id: <>
Date: Tue,  7 Aug 2012 19:52:06 +0900 (JST)
Subject: heimdal 1.5.2nb2 compilation failure on PC's due to a gcc error
X-Send-Pr-Version: 3.95

>Number:         46779
>Category:       pkg
>Synopsis:       pkgsrc/security/heimdal 1.5.2nb2 compilation failure on PC's
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          feedback
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 07 12:10:00 +0000 2012
>Last-Modified:  Tue Aug 07 13:56:51 +0000 2012
>Originator:     Ken'ichi Fukamachi
>Release:        NetBSD 5.1.2

		System: NetBSD 5.1.2 NetBSD 5.1.2 (HOME_SERVER) #0: Sat Feb 18 21:03:22 JST 2012 i386
		Architecture: i386
		Machine: i386


We cannot comile pkgsrc/security/heimdal 1.5.2nb2 on PC's since the proper CFLAGS is not given to GCC.

We can see the following errors on several PCs:

   pkgsrc/security/heimdal/work/heimdal-1.5.2/base/.libs/ undefined reference to `__sync_add_and_fetch_4'
   *** Error code 1

For example, NetBSD 5.1.2/i386 (and 5.1.2_PATCH taken and built from
anoncvs) reveals this problem but NetBSD 6.0_BETA/i386 and NetBSD
6.0_BETA/i386 on KVM (with a kvm hack) NOT.

The patch attached below resolves it on the following limited environments:
(1) using GCC on Intel CPU,
(2) pkgsrc/devel/cpuflags works well,
(3) maybe NetBSD 5.x.y/i386.

The more smart solution is that pkgsrc/mk framework should be changed
to use by default.

Also, the following quick hacks found in pkgsrc may be or should be
changed to framework:

  .if ${MACHINE_ARCH} == "i386"
    CFLAGS+=        -march=i486
    CXXFLAGS+=      -march=i486


	build pkgsrc/security/heimdal on NetBSD 5.x.y/i386


diff --exclude=CVS -ubr security/heimdal/Makefile nsrg/heimdal/Makefile
--- security/heimdal/Makefile	2012-08-07 15:53:13.000000000 +0900
+++ nsrg/heimdal/Makefile	2012-08-07 15:18:55.000000000 +0900
@@ -24,6 +24,12 @@

+# check cpu types
+.if ${MACHINE_ARCH} == "i386"
+BUILD_DEPENDS+=		cpuflags-[0-9]*:../../devel/cpuflags
 .include "../../mk/"
 .include ""

@@ -91,6 +97,11 @@
 	${TOUCH} ${WRKSRC}/po/localefiles

+# check cpu types
+.if exists(${LOCALBASE}/share/mk/
+.   include "${LOCALBASE}/share/mk/"
 .include "../../databases/sqlite3/"
 .include "../../devel/readline/"
 .include "../../security/openssl/"


From: "OBATA Akio" <>
Subject: PR/46779 CVS commit: pkgsrc/security/heimdal
Date: Tue, 7 Aug 2012 13:54:22 +0000

 Module Name:	pkgsrc
 Committed By:	obache
 Date:		Tue Aug  7 13:54:22 UTC 2012

 Modified Files:
 	pkgsrc/security/heimdal: distinfo
 	pkgsrc/security/heimdal/patches: patch-ad

 Log Message:
 Improve detection of __sync_add_and_fetch, avoid compiler optimization.

 Fixes PR 46779.

 To generate a diff of this commit:
 cvs rdiff -u -r1.34 -r1.35 pkgsrc/security/heimdal/distinfo
 cvs rdiff -u -r1.10 -r1.11 pkgsrc/security/heimdal/patches/patch-ad

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

State-Changed-From-To: open->feedback
State-Changed-When: Tue, 07 Aug 2012 13:56:51 +0000
Should be fixed with different way.
Please feedback whether it is acceptable for you or not.

 		since the proper CFLAGS is not given to GCC.

NetBSD Home
NetBSD PR Database Search

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