Subject: pkg/18811: Generator: Problem with stat() solved
To: None <gnats-bugs@gnats.netbsd.org>
From: Christian Biere <christianbiere@gmx.de>
List: netbsd-bugs
Date: 10/26/2002 14:44:07
>Number:         18811
>Category:       pkg
>Synopsis:       Generator: Problem with stat() solved
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 26 05:45:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Christian Biere
>Release:        NetBSD 1.6J
>Organization:
       
>Environment:

Architecture: i386
Machine: i386

>Description:

patch-ab for pkgsrc/emulators/generator was a workaround for a problem
with stat(). I've found the reason for this problem. Generator is compiled
with -malign-double if a x86 architecture is detected. This produces code
which is not binary compatible with the stat structure (see man stat(2)).
This might also lead to incompatibilities with other structures. I've
totally removed the automatic pentium optimizations from configure and
configure.in. If at all desired such options should be set manually and I
doubt -march=pentium produces the optimum code for actual x86 CPUs.
Note that -malign-double has alread been removed in the CVS repository of
Generator. I suggest replacing the workaround patch-ab with the attached
file.

Christian

>How-To-Repeat:

>Fix:
--Multipart_Sat__26_Oct_2002_14:44:07_+0200_081fea00
Content-Type: text/plain;
 name="patch.udif"
Content-Disposition: attachment;
 filename="patch.udif"
Content-Transfer-Encoding: 7bit

--- configure	2002/10/26 12:11:38	1.1
+++ configure	2002/10/26 12:12:44
@@ -1581,13 +1581,6 @@
 echo "${ECHO_T}Turning on gcc 3 optimisations" >&6
         CFLAGS="$CFLAGS -minline-all-stringops -fno-math-errno"
       fi
-      case $target_cpu in
-        i?86) echo "$as_me:1585: result: Turning on pentium optimisations" >&5
-echo "${ECHO_T}Turning on pentium optimisations" >&6
-              CFLAGS="$CFLAGS -march=pentium -malign-double -malign-loops=5"
-              CFLAGS="$CFLAGS -malign-jumps=5 -malign-functions=5"
-              ;;
-      esac
     else
       { echo "$as_me:1592: WARNING: You did not opt for gcc optimisations!" >&5
 echo "$as_me: WARNING: You did not opt for gcc optimisations!" >&2;}
--- configure.in	2002/10/26 12:11:38	1.1
+++ configure.in	2002/10/26 12:13:15
@@ -123,12 +123,6 @@
         AC_MSG_RESULT(Turning on gcc 3 optimisations)
         CFLAGS="$CFLAGS -minline-all-stringops -fno-math-errno"
       fi
-      case $target_cpu in
-        i?86) AC_MSG_RESULT(Turning on pentium optimisations)
-              CFLAGS="$CFLAGS -march=pentium -malign-double -malign-loops=5"
-              CFLAGS="$CFLAGS -malign-jumps=5 -malign-functions=5"
-              ;;
-      esac
     else
       AC_MSG_WARN(You did not opt for gcc optimisations!)
       optimum=no

--Multipart_Sat__26_Oct_2002_14:44:07_+0200_081fea00--
>Release-Note:
>Audit-Trail:
>Unformatted:
 This is a multi-part message in MIME format.
 
 --Multipart_Sat__26_Oct_2002_14:44:07_+0200_081fea00
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit