delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-apps/2001/08/25/06:21:41

Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com
List-Subscribe: <mailto:cygwin-apps-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-apps/>
List-Post: <mailto:cygwin-apps AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-apps-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/lists.html#faqs>
Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com
Message-ID: <20010825102121.55745.qmail@web14505.mail.yahoo.com>
Date: Sat, 25 Aug 2001 20:21:21 +1000 (EST)
From: =?iso-8859-1?q?Danny=20Smith?= <danny_r_smith_2001 AT yahoo DOT co DOT nz>
Subject: RFC: Structure alignment patch for GCC 3.x
To: cygwin-apps <cygwin-apps AT cygwin DOT com>
MIME-Version: 1.0

Hello 
 
Changes in  gcc/config/i386/i386.h (GCC 3.0.x) break compatbility with
"native" default 8-byte structure alignment.

This definition of BIGGEST_FIELD_ALIGNMENT in i386.h (GCC-3.0.1
release) is responsible for the regression:

/* The published ABIs say that doubles should be aligned on word
   boundaries, so lower the aligment for structure fields unless
   -malign-double is set.  */
/* BIGGEST_FIELD_ALIGNMENT is also used in libobjc, where it must be
   constant.  Use the smaller value in that context.  */
#ifndef IN_TARGET_LIBS
#define BIGGEST_FIELD_ALIGNMENT (TARGET_ALIGN_DOUBLE ? 64 : 32)
#else
#define BIGGEST_FIELD_ALIGNMENT 32
#endif

Unless -malign-double switch is used struct align defaults to 4-bytes.

This patch to cygwin.h will fix:

--- cygwin.h.orig	Fri Jun 22 18:27:34 2001
+++ cygwin.h	Sat Aug 25 21:35:19 2001
@@ -563,6 +563,11 @@ extern int i386_pe_dllimport_name_p PARA
 #undef	BIGGEST_ALIGNMENT
 #define BIGGEST_ALIGNMENT 128
 
+/* Native complier aligns internal doubles in structures on dword
boundaries.  */
+#undef	BIGGEST_FIELD_ALIGNMENT
+#define BIGGEST_FIELD_ALIGNMENT 64
+
+
 /* A bitfield declared as `int' forces `int' alignment for the struct.
 */
 #undef PCC_BITFIELDS_TYPE_MATTERS
 #define PCC_BITFIELDS_TYPE_MATTERS 1


Any comments before I submit to GCC patches.

Danny



_____________________________________________________________________________
http://shopping.yahoo.com.au - Father's Day Shopping
- Find the perfect gift for your Dad for Father's Day

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019