From gad@freefour.acs.rpi.edu  Sat May  1 20:07:44 2004
Return-Path: <gad@freefour.acs.rpi.edu>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9C85616A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  1 May 2004 20:07:44 -0700 (PDT)
Received: from freefour.acs.rpi.edu (freefour.acs.rpi.edu [128.113.24.91])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3A81D43D1D
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  1 May 2004 20:07:44 -0700 (PDT)
	(envelope-from gad@freefour.acs.rpi.edu)
Received: from freefour.acs.rpi.edu (localhost [127.0.0.1])
	by freefour.acs.rpi.edu (8.12.11/8.12.11) with ESMTP id i4237hGW015780
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 1 May 2004 23:07:43 -0400 (EDT)
	(envelope-from gad@freefour.acs.rpi.edu)
Received: (from gad@localhost)
	by freefour.acs.rpi.edu (8.12.11/8.12.11/Submit) id i4237ho1015716;
	Sat, 1 May 2004 23:07:43 -0400 (EDT)
	(envelope-from gad)
Message-Id: <200405020307.i4237ho1015716@freefour.acs.rpi.edu>
Date: Sat, 1 May 2004 23:07:43 -0400 (EDT)
From: Garance A Drosehn <gad@freefour.acs.rpi.edu>
Reply-To: Garance A Drosehn <drosih@rpi.edu>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [PATCH] Fix ezm3 for 64-bit time_t on sparc64  5.x-current
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         66159
>Category:       ports
>Synopsis:       [PATCH] Fix ezm3 for 64-bit time_t on sparc64  5.x-current
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jdp
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 01 20:10:21 PDT 2004
>Closed-Date:    Sun May 16 10:45:22 PDT 2004
>Last-Modified:  Sun May 16 10:45:22 PDT 2004
>Originator:     Garance A Drosehn
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
RPI; Troy, NY 
>Environment:
System: FreeBSD freefour.acs.rpi.edu 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Fri Mar 26 15:41:46 EST 2004 root@santropez.netel.rpi.edu:/usr/obj/usr/src/sys/Dual-Athlon2k i386


	Ignore the system-info above.  This is an issue for anyone who wants
	to use cvsup when running on 5.x-current on sparc64 hardware.
>Description:
	The freebsd/sparc64 platform recently switched to 64-bit time_t's.
	ezm3, as it stands, does not handle this.  This is bad for cvsup.
	Right now people using 64-bit time_t's are running a special
	ezm3 package that I have at http://people.freebsd.org/~gad :
		ezm3-64btt-1.1_1.tbz
	along with a special package of cvsup-without-gui as built by
	that version of ezm3, at:
		cvsup-without-gui-64btt-16.1h.tbz
	However, if they rebuild ezm3 from the present ports collection
	then they will run into problems with cvsup.

>How-To-Repeat:
	This has been discussed on freebsd-sparc64 maling list.

>Fix:
	I have a patch at:

	http://people.freebsd.org/~gad/time-64/port-ezm3.diff

	which, if applied to the port, will fix exm3.  There is some
	debate as to whether this is the perfect fix, but it is at
	least a very workable and reliable way to solve the issue.

	One way or another, this issue with the ezm3 port should be
	addressed before we get to 5.3-release.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->jdp 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat May 1 22:24:30 PDT 2004 
Responsible-Changed-Why:  
Over to maintainer. 

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

From: Marius Strobl <marius@alchemy.franken.de>
To: freebsd-gnats-submit@FreeBSD.org
Cc: drosih@rpi.edu
Subject: Re: ports/66159: [PATCH] Fix ezm3 for 64-bit time_t on sparc64 5.x-current
Date: Sun, 16 May 2004 18:03:49 +0200

 The patch at http://people.freebsd.org/~gad/time-64/port-ezm3.diff
 causes some problems as it makes the Makefile evaluate CHECKRESULT
 every time it's run, even when WRKSRC doesn't exists. This causes
 e.g. `make -V <something>` to break:
 marius@nephilim:/tmp/co/ezm3 > make -V PGKNAME
 /usr/bin/ld: cannot open output file /checktimet: Permission denied
 "Makefile", line 63: warning: "/bin/rm -rf /checktimet &&  cc -o /checktimet /tmp/co/ezm3/files/checktimet.c &&  /checktimet" returned non-zero status
 
 While the ezm3 port probably can be made to use checktimet.c without
 causing problems it now should be sufficient to use OSVERSION to
 decide whether the value of time_t should be changed to int64_t. The
 reason for this is that FreeBSD/sparc64 fully switched to 64bit
 time_t by default with __FreeBSD_version 502107; there should be
 no more testing of the time_t change and going back and forth
 between 32bit and 64bit time_t, just users that recompile their
 ports after switching to a 64bit time_t FreeBSD/sparc64.
 The author of the above mentioned patch basically agreed to this in:
 http://lists.freebsd.org/pipermail/freebsd-sparc64/2004-March/001444.html
 A patch which makes the ezm3 port change time_t on FreeBSD/sparc64
 based on OSVERSION is below.
 
 Index: Makefile
 ===================================================================
 RCS file: /mnt/futile/usr/data/bsd/cvs/fbsd/ports/lang/ezm3/Makefile,v
 retrieving revision 1.9
 diff -u -r1.9 Makefile
 --- Makefile	4 Feb 2004 05:21:33 -0000	1.9
 +++ Makefile	4 Mar 2004 18:42:30 -0000
 @@ -26,6 +26,7 @@
  SCRIPTS_ENV+=	TARGET=${TARGET}
  USE_BZIP2=	yes
  USE_GMAKE=	yes
 +USE_REINPLACE=	yes
  
  PROGS=		bin/m3build \
  		bin/m3bundle \
 @@ -57,6 +58,12 @@
  BOOTSTRAP=	ezm3-${PORTVERSION}-${TARGET}-boot.tar.bz2
  .endif
  
 +post-patch:
 +.if ${ARCH} == "sparc64" && ${OSVERSION} >= 502107
 +	@${REINPLACE_CMD} -E -e 's|(^.*time_t.*=.*)int32_t;|\1int64_t;|' \
 +		${WRKSRC}/libs/m3core/src/unix/freebsd-4.sparc64/Utypes.i3
 +.endif
 +
  do-build:
  	@${ECHO_MSG} "This port does everything in the install step."
  	@${ECHO_MSG} "The build step is a no-op."
State-Changed-From-To: open->closed 
State-Changed-By: jdp 
State-Changed-When: Sun May 16 10:42:38 PDT 2004 
State-Changed-Why:  
Fixed in ports/lang/ezm3/Makefile revision 1.10.  I used the simpler 
patch submitted by Marius Strobl because of the problems mentioned 
in the PR that occur if WRKSRC doesn't exist (and also just because 
it's simpler).  Many thanks to both submitters for helping solve 
this problem. 

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