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: List-Archive: List-Post: List-Help: , 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?= Subject: RFC: Structure alignment patch for GCC 3.x To: cygwin-apps MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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