[PATCH] sysutils/heirloom: [Unbreak AMD64 build]

Jeffrey H. Johnson CPE1704TKS at bellsouth.net
Tue Jan 31 18:16:36 PST 2006


>Submitter-Id:	current-users
>Originator:	Jeffrey H. Johnson
>Organization:	
>Confidential:	no 
>Synopsis:	[PATCH] sysutils/heirloom: [Unbreak AMD64 build]
>Severity:	non-critical
>Priority:	medium
>Category:	ports 
>Class:		change-request
>Release:	FreeBSD 6.0-STABLE i386
>Environment:
System: FreeBSD offworld.cqasys.com 6.0-STABLE FreeBSD 6.0-STABLE #21: Wed Jan 18 22:35:45 EST 2006
>Description:

> Subject: heirloom-060122 failed on amd64 6
> [.. snip ..]
> http://pointyhat.freebsd.org/errorlogs/amd64-errorlogs/e.7.2006011605/heirloom-060122.log
> http://portsmon.freebsd.org/portoverview.py?category=&portname=heirloom&wildcard=

This only seems to fail on 6 and 7, not on 5 which is strange!  It
also works on all other 64-bit architectures.  The code in question
is actually code from OpenSolaris.  I see no reason why it would
fail, but I do not have access to an AMD64 machine.  

I had someone who does send me a back trace, and the error is in a 
debugging statement, and apparently it is argv becoming corrupted.

Commenting out the debugging statements fix the port, and it also
produces bit-identical output, verified by sha256.  

I can only assume this is a compiler bug on AMD64 FreeBSD!  This
code also works correctly when compiled for 64-bit PPC Mac OS X.

Someone else can verify?

Again, not compiling-in these two fprintf statements will fix the
build on AMD64.  I wasn't able to test using a non-default compiler.

Thanks.

Added file(s):
- files/patch-spell::spellin.c

Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:
>Fix:

--- heirloom-060122.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/sysutils/heirloom/files/patch-spell::spellin.c /usr/home/trn/heirloom/files/patch-spell::spellin.c
--- /usr/ports/sysutils/heirloom/files/patch-spell::spellin.c	Wed Dec 31 19:00:00 1969
+++ /usr/home/trn/heirloom/files/patch-spell::spellin.c	Tue Jan 31 21:10:33 2006
@@ -0,0 +1,19 @@
+--- spell/spellin.c.orig	Tue Jan 31 20:45:43 2006
++++ spell/spellin.c	Tue Jan 31 21:05:25 2006
+@@ -146,12 +146,16 @@
+ 	for (i = 0; i < wp; i++)
+ 		le32p(table[i], (char *)&table[i]);
+ 	fwrite((char *)table, sizeof (*table), wp, stdout);
++#ifndef __amd64__
+ 	fprintf(stderr,
+ 	    "%s: %ld items, %d ignored, %d extra, %u words occupied\n",
+ 	    argv[0], (long)count, ignore, extra, (unsigned)wp);
++#endif /* !amd64 */
+ 	count -= ignore;
++#ifndef __amd64__
+ 	fprintf(stderr, "%s: %f table bits/item, %f table+index bits\n",
+ 	    argv[0], (((float)BYTE * wp) * sizeof (*table) / count),
+ 	    (BYTE * ((float)wp * sizeof (*table) + sizeof (hindex)) / count));
++#endif /* !amd64 */
+ 	return 0;
+ }
--- heirloom-060122.patch ends here ---



More information about the freebsd-ports mailing list