From hrs@FreeBSD.org  Sun Mar 23 16:15:24 2008
Return-Path: <hrs@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F35911065678;
	Sun, 23 Mar 2008 16:15:23 +0000 (UTC)
	(envelope-from hrs@FreeBSD.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id DBD308FC2C;
	Sun, 23 Mar 2008 16:15:23 +0000 (UTC)
	(envelope-from hrs@FreeBSD.org)
Received: from freefall.freebsd.org (hrs@localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m2NGFNwj071871;
	Sun, 23 Mar 2008 16:15:23 GMT
	(envelope-from hrs@freefall.freebsd.org)
Received: (from hrs@localhost)
	by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m2NGFNdE071870;
	Sun, 23 Mar 2008 16:15:23 GMT
	(envelope-from hrs)
Message-Id: <200803231615.m2NGFNdE071870@freefall.freebsd.org>
Date: Sun, 23 Mar 2008 16:15:23 GMT
From: Hiroki Sato <hrs@FreeBSD.org>
Reply-To: Hiroki Sato <hrs@FreeBSD.org>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc: ade@FreeBSD.org
Subject: Update port: fix devel/m4 division of negative numbers bug
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         122018
>Category:       ports
>Synopsis:       Update port: fix devel/m4 division of negative numbers bug
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    ade
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 23 16:20:00 UTC 2008
>Closed-Date:    Tue May 06 04:33:37 UTC 2008
>Last-Modified:  Tue May 06 04:33:37 UTC 2008
>Originator:     Hiroki Sato
>Release:        FreeBSD 6.3-PRERELEASE i386
>Organization:
Tokyo University of Science
>Environment:
System: FreeBSD alph.allbsd.org 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #0: Wed Jan 9 01:39:40 JST 2008 hrs@alph.allbsd.org:/usr/obj/usr/src/sys/ALPH i386

>Description:
	GNU m4 1.4.9 has a known bug involving division of negative
	numbers so needs to be updated.  This breaks some software
	which depends on GNU m4 like cad/pcb.

	1.4.10 is not the latest version and still has the same bug,
	but the attached patch should fix it and it works.  Although
	upgrading m4 would be problematic since many software depends
	on it, the effect from upgrading to 1.4.10 is small enough.
	This patch to fix the bug has already been submitted to the
	upstream and accepted.

>How-To-Repeat:
	% echo "eval(-2/2)" | gm4 -
	2147483647

>Fix:

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/devel/m4/Makefile,v
retrieving revision 1.35
diff -d -u -I\$FreeBSD:.*\$ -I\$NetBSD:.*\$ -I\$OpenBSD:.*\$ -I\$DragonFly:.*\$ -I\$Id:.*\$ -I\$Translation:.*\$ -I\$hrs:.*\$ -r1.35 Makefile
--- Makefile	30 Sep 2007 20:39:13 -0000	1.35
+++ Makefile	6 Jan 2008 05:28:09 -0000
@@ -6,7 +6,8 @@
 #
 
 PORTNAME=	m4
-PORTVERSION=	1.4.9
+PORTVERSION=	1.4.10
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	devel
 MASTER_SITES=	${MASTER_SITE_GNU}
Index: distinfo
===================================================================
RCS file: /home/ncvs/ports/devel/m4/distinfo,v
retrieving revision 1.10
diff -d -u -I\$FreeBSD:.*\$ -I\$NetBSD:.*\$ -I\$OpenBSD:.*\$ -I\$DragonFly:.*\$ -I\$Id:.*\$ -I\$Translation:.*\$ -I\$hrs:.*\$ -r1.10 distinfo
--- distinfo	30 Sep 2007 20:39:13 -0000	1.10
+++ distinfo	6 Jan 2008 05:28:14 -0000
@@ -1,3 +1,3 @@
-MD5 (m4-1.4.9.tar.bz2) = bcfaf47194491a7a8b8d3c2811570b93
-SHA256 (m4-1.4.9.tar.bz2) = a8e29386374ba0eacbd7b339b97f169603d63a736bd87eee85ed2771ed7c3d29
-SIZE (m4-1.4.9.tar.bz2) = 609666
+MD5 (m4-1.4.10.tar.bz2) = 0a35bab2f5d605e08083d7e3cbd4b8b0
+SHA256 (m4-1.4.10.tar.bz2) = b2b66e645cd566a95d9714848a5d084427f3130ace5c5a0c6cb5544f11b7cbd7
+SIZE (m4-1.4.10.tar.bz2) = 739154
Index: files/patch-src-eval.c
===================================================================
RCS file: files/patch-src-eval.c
diff -N files/patch-src-eval.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-src-eval.c	5 Jan 2008 20:08:25 -0000
@@ -0,0 +1,11 @@
+--- src/eval.c.orig	2007-01-09 16:12:43.000000000 +0000
++++ src/eval.c
+@@ -721,7 +721,7 @@ mult_term (eval_token et, int32_t *v1)
+ 	    /* Avoid the x86 SIGFPE on INT_MIN / -1.  */
+ 	    *v1 = (int32_t) -(uint32_t) *v1;
+ 	  else
+-	    *v1 = (int32_t) ((uint32_t) *v1 / (uint32_t) v2);
++	    *v1 = *v1 / v2;
+ 	  break;
+ 
+ 	case MODULO:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->ade 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Mar 23 16:20:07 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

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

From: Ed Maste <emaste@freebsd.org>
To: bug-followup@FreeBSD.org, hrs@FreeBSD.org
Cc:  
Subject: Re: ports/122018: Update port: fix devel/m4 division of negative numbers bug
Date: Thu, 1 May 2008 13:55:26 -0400

 Does the patch-src-eval.c apply to 1.4.9 as well?  Even if we're not
 upgrading perhaps we can at least put just that fix in.
 
 -Ed

From: Hiroki Sato <hrs@FreeBSD.org>
To: emaste@FreeBSD.org
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/122018: Update port: fix devel/m4 division of negative
 numbers bug
Date: Fri, 02 May 2008 03:36:39 +0900 (JST)

 ----Security_Multipart(Fri_May__2_03_36_39_2008_541)--
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 Ed Maste <emaste@freebsd.org> wrote
   in <20080501175526.GA32949@sandvine.com>:
 
 em> Does the patch-src-eval.c apply to 1.4.9 as well?  Even if we're not
 em> upgrading perhaps we can at least put just that fix in.
 
  This patch works for 1.4.9 as well.
 
  I heard from Ade that he is planning to upgrade this after a test run
  on the package building cluster, BTW.
 
 --
 | Hiroki SATO
 
 ----Security_Multipart(Fri_May__2_03_36_39_2008_541)--
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.7 (FreeBSD)
 
 iD8DBQBIGg23TyzT2CeTzy0RAmScAKCD96iVdXLKaqnTo8PgPNR8s48BUACePdtW
 ff1AsLzuiVg1BmIAKop4F2Q=
 =fbI4
 -----END PGP SIGNATURE-----
 
 ----Security_Multipart(Fri_May__2_03_36_39_2008_541)----
State-Changed-From-To: open->closed 
State-Changed-By: ade 
State-Changed-When: Tue May 6 04:33:14 UTC 2008 
State-Changed-Why:  
This patch is incorporated into ports/123450, scheduled for an -exp run. 

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