NetBSD Problem Report #45337

From kre@munnari.OZ.AU  Wed Sep  7 13:04:04 2011
Return-Path: <kre@munnari.OZ.AU>
Received: from ( [])
	by (Postfix) with ESMTP id 51E8763C093
	for <>; Wed,  7 Sep 2011 13:04:04 +0000 (UTC)
Message-Id: <>
Date: Wed, 7 Sep 2011 20:03:50 +0700 (ICT)
From: kre@munnari.OZ.AU
Subject: mail/evolution{,-data-server} library link errors (NetBSD 4.0)
X-Send-Pr-Version: 3.95

>Number:         45337
>Category:       pkg
>Synopsis:       mail/evolution{,-data-server} library link errors (NetBSD 4.0)
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    joerg
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 07 13:05:00 +0000 2011
>Last-Modified:  Mon Oct 29 19:01:51 +0000 2012
>Originator:     Robert Elz
>Release:        NetBSD 4.0   (pkgsrc -current 2011-09-07)
	Prince of Songkla University
System: NetBSD 5.1 NetBSD 5.1 (JADE-1.12-20101117) #5: Wed Nov 17 05:30:55 ICT 2010 i386
Architecture: i386
Machine: i386
	mail/evolution and mail/evolution-data-server both encounter
	a bug described by joerg as
		"the spec for GCC is wrong and it
		 has only been fixed around netbsd-4.99.x"
	when compiled on NetBSD 4.0 (which is before 4.99.x obviously).

	Other gnome based packages have had the same problem in the
	past, at least some of them (like audio/pulseaudio) have
	been fixed in the past (see PR 42820 for that one).

	This seems to have started becoming a problem when the gnome
	system was upgraded to the 2.30 gnome release around July 2010
	(for me, the evolution packages have not been rebuilt since
	that ime).

	Attempt to build mail/evolution or mail/evolution-data-server
	on a NetBSD 4.0 (unpatched) system (some later pullup to
	the netbsd-4 branch may have corrected it  - I don't know -
	for later NetBSD 4 based builds, but none of those has ever
	been actually released).

	Expect to see the builds fail with errors like ...

.libs/libart_lgpl_la-art_gray_svp.o: In function `art_gray_svp_callback':
art_gray_svp.c:(.text+0xf3): undefined reference to `memset'
art_gray_svp.c:(.text+0x141): undefined reference to `memset'
art_gray_svp.c:(.text+0x169): undefined reference to `memset'
art_gray_svp.c:(.text+0x187): undefined reference to `memset'
.libs/libart_lgpl_la-art_misc.o: In function `art_realloc':
art_misc.c:(.text+0x1a): undefined reference to `realloc'
.libs/libart_lgpl_la-art_misc.o: In function `art_free':
art_misc.c:(.text+0x3b): undefined reference to `free'
.libs/libart_lgpl_la-art_misc.o: In function `art_alloc':
art_misc.c:(.text+0x5f): undefined reference to `malloc'
.libs/libart_lgpl_la-art_misc.o: In function `art_warn':
art_misc.c:(.text+0x87): undefined reference to `__sF'
art_misc.c:(.text+0x92): undefined reference to `vfprintf'
.libs/libart_lgpl_la-art_misc.o: In function `art_die':

	for mail/evolution, and ...

.libs/libedataserver_1_2_la-e-account-list.o: In function `.L8':
e-account-list.c:(.text+0x6c): undefined reference to `strcmp'
.libs/libedataserver_1_2_la-e-account-list.o: In function `.L12':
e-account-list.c:(.text+0xe5): undefined reference to `strcmp'
.libs/libedataserver_1_2_la-e-account-list.o: In function `.L9':
e-account-list.c:(.text+0x100): undefined reference to `strcmp'
.libs/libedataserver_1_2_la-e-account-list.o: In function `.L10':
e-account-list.c:(.text+0x128): undefined reference to `strcmp'
.libs/libedataserver_1_2_la-e-account-list.o: In function `e_account_list_get_default':
e-account-list.c:(.text+0x234): undefined reference to `strcmp'
.libs/libedataserver_1_2_la-e-account-list.o:e-account-list.c:(.text+0x648): more undefined references to `strcmp' follow

	for mail/evolution-data-server - in both cases with rather
	more undefined symbols than I have included here.

	All the missing symbols come from libc - if the library
	in question were linked with -lc there would be no problem,
	but (apparently because of the gcc spec bug) that doesn't
	happen on NetBSD 4.   Since no real program ever runs without
	-lc linked in at run time, leaving those symbols undefined
	in the shared libraries that are being built, and satisfying
	them when puts it all together at program startup time
	seems relatively harmless, so that is the solution adopted.

	The patch below changes the Makefiles for both mail/evolution
	and mail/evolution-data-server so that on NetBSD-4 based
	systems the --no-undefined swictch is not passed through
	gcc to the linker.  This is really a work-around for the
	problem, but seems to be the standard NetBSD 4 solution.

	This fix originated with joerg@ or he@ not me ...  I'm just
	applying it to these packages.   With these patches in
	place, both packages now successfully build for NetBSD 4.0

	Apply the patch below in pkgsrc/mail and both Makefiles should be
	corrected (evolution/Makefile and evolution-data-server/Makefile).

	No revbump needed, as without this patch, these packages don't
	build on NetBSD 4 (and if a netbsd-4 based system has been
	corrected so they do build, the patch will not change anything
	that makes a difference.)

Index: evolution/Makefile
RCS file: /cvsroot/NetBSD/pkgsrc/mail/evolution/Makefile,v
retrieving revision 1.174
diff -u -r1.174 Makefile
--- evolution/Makefile	10 Jun 2011 09:39:45 -0000	1.174
+++ evolution/Makefile	7 Sep 2011 08:41:12 -0000
@@ -52,6 +52,12 @@

+.include "../../mk/"
+.if ${OPSYS} == "NetBSD" && !empty(OS_VERSION:M4.*)
+BUILDLINK_TRANSFORM+=   rm:-Wl,--no-undefined
 .if !exists(/usr/include/semaphore.h)
 LDFLAGS+=	-lsemaphore
 .include "../../devel/pthread-sem/"
Index: evolution-data-server/Makefile
RCS file: /cvsroot/NetBSD/pkgsrc/mail/evolution-data-server/Makefile,v
retrieving revision 1.111
diff -u -r1.111 Makefile
--- evolution-data-server/Makefile	10 Jun 2011 09:39:43 -0000	1.111
+++ evolution-data-server/Makefile	5 Sep 2011 13:08:32 -0000
@@ -33,6 +33,9 @@
 .include "../../devel/pthread-sem/"
 LIBS+=		-lsemaphore
+.if ${OPSYS} == "NetBSD" && !empty(OS_VERSION:M4.*)
+BUILDLINK_TRANSFORM+=   rm:-Wl,--no-undefined

 .if ${OPSYS} == "Darwin"


From: Sergey Svishchev <>
Subject: Re: pkg/45337
Date: Wed, 7 Sep 2011 22:30:32 +0400

 This may also fix the PR:

 Index: devel/libtool/patches/patch-ac
 RCS file: /vol/2/cvsup/pkgsrc/devel/libtool/patches/patch-ac,v
 retrieving revision 1.26
 diff -u -r1.26 patch-ac
 --- devel/libtool/patches/patch-ac	14 May 2011 16:49:45 -0000	1.26
 +++ devel/libtool/patches/patch-ac	15 Jul 2011 21:16:29 -0000
 @@ -1,4 +1,4 @@
 -$NetBSD: patch-ac,v 1.26 2011/05/14 16:49:45 bsiegert Exp $

   --- libltdl/config/	2009-11-16 13:23:18.000000000 +0000
   +++ libltdl/config/
 @@ -51,7 +51,7 @@

 -@@ -6476,7 +6480,7 @@ func_mode_link ()
 +@@ -6476,16 +6480,13 @@ func_mode_link ()
          if test "$build_libtool_libs" = yes; then
    	if test -n "$rpath"; then
    	  case $host in
 @@ -60,3 +60,12 @@
    	    # these systems don't actually have a c library (as such)!
    	  *-*-rhapsody* | *-*-darwin1.[012])
 + 	    # Rhapsody C library is in the System framework
 + 	    deplibs="$deplibs System.ltframework"
 + 	    ;;
 +-	  *-*-netbsd*)
 +-	    # Don't link with libc until the a.out is fixed.
 +-	    ;;
 + 	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
 + 	    # Do not include libc due to us having libc/libc_r.
 + 	    ;;

 Sergey Svishchev

From: Robert Elz <kre@munnari.OZ.AU>
Subject: Re: pkg/45337
Date: Thu, 08 Sep 2011 17:12:54 +0700

     Date:        Wed,  7 Sep 2011 18:45:02 +0000 (UTC)
     From:        Sergey Svishchev <>
     Message-ID:  <>

   |  This may also fix the PR:

 I'll try that, but I'm not sure that the fix/workaround proposed
 isn't better anyway - with the one big exception of it being needed
 in many packages, rather than just once in libtool - which exception
 would be significant if it weren't for the fact that almost all the
 packages that need the fix seem to have been found now, and fixed
 (though without fixes for all yet committed).


From: "Thomas Klausner" <>
Subject: PR/45337 CVS commit: pkgsrc/mail/evolution
Date: Thu, 22 Sep 2011 11:54:23 +0000

 Module Name:	pkgsrc
 Committed By:	wiz
 Date:		Thu Sep 22 11:54:22 UTC 2011

 Modified Files:
 	pkgsrc/mail/evolution: Makefile

 Log Message:
 Fix build on NetBSD-4. From Robert Elz in PR 45337.

 To generate a diff of this commit:
 cvs rdiff -u -r1.174 -r1.175 pkgsrc/mail/evolution/Makefile

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

Responsible-Changed-From-To: pkg-manager->shattered
Responsible-Changed-When: Thu, 22 Sep 2011 11:56:40 +0000
Shattered suggested a better fix.

State-Changed-From-To: open->feedback
State-Changed-When: Thu, 22 Sep 2011 11:56:40 +0000
Waiting for feedback on the better fix.
(The workaround has been committed in the meantime.)

State-Changed-From-To: feedback->open
State-Changed-When: Mon, 30 Apr 2012 22:55:31 +0000
Looks to me like the better fix should be committed.

Responsible-Changed-From-To: shattered->joerg
Responsible-Changed-When: Mon, 29 Oct 2012 19:01:51 +0000
Let maintainer handle this.  (This package is too tricky.)


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.