From nakaji@localhost.takamatsu-nct.ac.jp  Thu Jun 22 00:09:41 2006
Return-Path: <nakaji@localhost.takamatsu-nct.ac.jp>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id EF1DC16A47A;
	Thu, 22 Jun 2006 00:09:40 +0000 (UTC)
	(envelope-from nakaji@localhost.takamatsu-nct.ac.jp)
Received: from localhost.takamatsu-nct.ac.jp (cterm.takamatsu-nct.ac.jp [210.137.230.3])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 485BC43D48;
	Thu, 22 Jun 2006 00:09:39 +0000 (GMT)
	(envelope-from nakaji@localhost.takamatsu-nct.ac.jp)
Received: from roddy.c3922.takamatsu-nct.ac.jp (localhost [127.0.0.1])
	by localhost.takamatsu-nct.ac.jp (8.13.6/8.13.4) with ESMTP id k5M09a4F069081;
	Thu, 22 Jun 2006 09:09:36 +0900 (JST)
	(envelope-from nakaji@roddy.c3922.takamatsu-nct.ac.jp)
Received: (from nakaji@localhost)
	by roddy.c3922.takamatsu-nct.ac.jp (8.13.6/8.13.6/Submit) id k5M09Zww069080;
	Thu, 22 Jun 2006 09:09:35 +0900 (JST)
	(envelope-from nakaji)
Message-Id: <200606220009.k5M09Zww069080@roddy.c3922.takamatsu-nct.ac.jp>
Date: Thu, 22 Jun 2006 09:09:35 +0900 (JST)
From: NAKAJI Hiroyuki <nakaji@jp.freebsd.org>
Reply-To: NAKAJI Hiroyuki <nakaji@jp.freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: maho@freebsd.org
Subject: openoffice.org-2.0 fails on current because of the addition of gethostbyname_r to libc
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         99284
>Category:       ports
>Synopsis:       openoffice.org-2.0 fails on current because of the addition of gethostbyname_r to libc
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    openoffice
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 22 00:10:22 GMT 2006
>Closed-Date:    Thu Jul 06 03:08:43 GMT 2006
>Last-Modified:  Thu Jul 06 03:08:43 GMT 2006
>Originator:     NAKAJI Hiroyuki
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD roddy.c3922.takamatsu-nct.ac.jp 7.0-CURRENT FreeBSD 7.0-CURRENT #56: Thu Jun 8 10:18:51 JST 2006 root@roddy.c3922.takamatsu-nct.ac.jp:/usr/obj/usr/src/sys/RODDY i386


>Description:
	As Diane Bruce reported to openoffice@freebsd.org,
(http://lists.freebsd.org/pipermail/freebsd-openoffice/2006-June/002457.html)
on 7.0-current after 700016, editors/openoffice.org-2.0 fails to build
with following error.

gmake[5]: Entering directory `/usr/ports/editors/openoffice.org-2.0/work/OOB680_m5/moz/unxfbsd.pro/misc/build/mozilla/nsprpub/pr/src/misc'
gcc-ooo -o prnetdb.o -c     -pipe  -ansi -Wall -O -fPIC  -UDEBUG -DMOZILLA_CLIENT=1 -DNDEBUG=1 -DXP_UNIX=1 -DFREEBSD=1 -DHAVE_BSD_FLOCK=1 -DHAVE_SOCKLEN_T=1 -DHAVE_LCHOWN=1 -DHAVE_STRERROR=1 -D_REENTRANT=1 -D_THREAD_SAFE=1  -DFORCE_PR_LOG -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM -D_NSPR_BUILD_ -I/usr/ports/editors/openoffice.org-2.0/work/OOB680_m5/moz/unxfbsd.pro/misc/build/mozilla/dist/include/nspr -I../../../pr/include -I../../../pr/include/private  prnetdb.c
prnetdb.c:1180: error: conflicting types for 'getprotobyname_r'
/usr/include/netdb.h:250: error: previous declaration of 'getprotobyname_r' was here
prnetdb.c:1180: error: conflicting types for 'getprotobyname_r'
/usr/include/netdb.h:250: error: previous declaration of 'getprotobyname_r' was here
prnetdb.c:1189: error: conflicting types for 'getprotobynumber_r'
/usr/include/netdb.h:253: error: previous declaration of 'getprotobynumber_r' was here
prnetdb.c:1189: error: conflicting types for 'getprotobynumber_r'
/usr/include/netdb.h:253: error: previous declaration of 'getprotobynumber_r' was here
gmake[5]: *** [prnetdb.o] Error 1
gmake[5]: Leaving directory `/usr/ports/editors/openoffice.org-2.0/work/OOB680_m5/moz/unxfbsd.pro/misc/build/mozilla/nsprpub/pr/src/misc'

>How-To-Repeat:
	cd /usr/ports/editors/openoffice.org-2.0
	make

>Fix:

	I added to files/patch-i65512 the diff which Diane reported.

Stephane E. Potvin showed another diff, I'm not sure which is better.
(http://lists.freebsd.org/pipermail/freebsd-openoffice/2006-May/002414.html)

Index: files/patch-i65512
===================================================================
RCS file: /home/ncvs/ports/editors/openoffice.org-2.0/files/patch-i65512,v
retrieving revision 1.2
diff -u -r1.2 patch-i65512
--- files/patch-i65512	3 Jun 2006 11:39:21 -0000	1.2
+++ files/patch-i65512	21 Jun 2006 23:46:36 -0000
@@ -41,3 +41,21 @@
  #endif
  
  #endif /* __OSL_SYSTEM_H__ */
+--- moz/mozilla-source-1.7.5.patch.orig	Wed Jun 21 23:50:14 2006
++++ moz/mozilla-source-1.7.5.patch	Thu Jun 22 00:00:08 2006
+@@ -7697,3 +7697,15 @@
+   
+   # Force applications to be built non-statically
+   # when building the mozcomps meta component
++--- misc/build/mozilla/nsprpub/pr/src/misc/prnetdb.c.orig	Thu Sep  2 08:44:37 2004
+++++ misc/build/mozilla/nsprpub/pr/src/misc/prnetdb.c	Wed Jun 21 23:58:12 2006
++@@ -105,7 +105,8 @@
++ #define _PR_HAVE_GETPROTO_R_INT
++ #endif
++ 
++-#if (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2)
+++#if (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2) || \
+++	(defined(__FreeBSD__) && __FreeBSD_version > 700016)
++ #define _PR_HAVE_GETPROTO_R
++ #define _PR_HAVE_5_ARG_GETPROTO_R
++ #endif
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->openoffice 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Jun 22 01:52:58 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=99284 

From: NAKAJI Hiroyuki <nakaji@jp.freebsd.org>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc: freebsd-ports-bugs@FreeBSD.org, Maho Nakata <maho@FreeBSD.org>
Subject: Re: ports/99284: openoffice.org-2.0 fails on current because of the addition of gethostbyname_r to libc
Date: Sun, 25 Jun 2006 11:45:16 +0900

 I found another build error; the diff I sent for gethostbyname_r() is
 not sufficient. So I give up this PR. The problem seems to be in
 libpthread.
 
 The error occurs on recent current like this.
 
 Checking DLL ../../../unxfbsdi.pro/lib/check_libmozabdrv2.so ...Fatal error 'Spinlock called when not threaded.' at line 91 in file /usr/src/lib/libpthread/thread/thr_spinlock.c (errno = 2)
 Abort trap (core dumped)
 dmake:  Error code 1, while making '../../../unxfbsdi.pro/lib/libmozabdrv2.so'
 '---* tg_merge.mk *---'
 
 ERROR: Error 65280 occurred while making /usr/ports/editors/openoffice.org-2.0/work/OOC680_m5/connectivity/source/drivers/mozab
 dmake:  Error code 1, while making 'build_instsetoo_native'
 '---* *---'
 *** Error code 255
 
 Stop in /usr/ports/editors/openoffice.org-2.0.
 
 My thr_spinlock.c is Rev. 1.24.
 -- 
 NAKAJI Hiroyuki

From: NAKAJI Hiroyuki <nakaji@jp.freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: freebsd-ports-bugs@freebsd.org, Nakata Maho <maho@freebsd.org>
Subject: Re: ports/99284: openoffice.org-2.0 fails on current because of the addition of gethostbyname_r to libc
Date: Thu, 06 Jul 2006 08:42:39 +0900

 Success!
 
 I had to remove /usr/lib/libc_r.* which causes c++'s -pedantic bug.
 
 After removing them, "portupgrade ja-openoffice.org" was successful with
 this patch (I had already sent).
 
 Index: files/patch-i65512
 ===================================================================
 RCS file: /home/ncvs/ports/editors/openoffice.org-2.0/files/patch-i65512,v
 retrieving revision 1.2
 diff -u -r1.2 patch-i65512
 --- files/patch-i65512	3 Jun 2006 11:39:21 -0000	1.2
 +++ files/patch-i65512	21 Jun 2006 23:46:36 -0000
 @@ -41,3 +41,21 @@
   #endif
   
   #endif /* __OSL_SYSTEM_H__ */
 +--- moz/mozilla-source-1.7.5.patch.orig	Wed Jun 21 23:50:14 2006
 ++++ moz/mozilla-source-1.7.5.patch	Thu Jun 22 00:00:08 2006
 +@@ -7697,3 +7697,15 @@
 +   
 +   # Force applications to be built non-statically
 +   # when building the mozcomps meta component
 ++--- misc/build/mozilla/nsprpub/pr/src/misc/prnetdb.c.orig	Thu Sep  2 08:44:37 2004
 +++++ misc/build/mozilla/nsprpub/pr/src/misc/prnetdb.c	Wed Jun 21 23:58:12 2006
 ++@@ -105,7 +105,8 @@
 ++ #define _PR_HAVE_GETPROTO_R_INT
 ++ #endif
 ++ 
 ++-#if (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2)
 +++#if (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2) || \
 +++	(defined(__FreeBSD__) && __FreeBSD_version > 700016)
 ++ #define _PR_HAVE_GETPROTO_R
 ++ #define _PR_HAVE_5_ARG_GETPROTO_R
 ++ #endif
 
 Note: I sent JCA to OOo, and I'm waiting I'll be listed.
 -- 
 NAKAJI Hiroyuki
State-Changed-From-To: open->closed 
State-Changed-By: maho 
State-Changed-When: Thu Jul 6 03:08:24 UTC 2006 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=99284 
>Unformatted:
