This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libobjc-noheaders] First patch to the branch


Further refining and further patch, made using this script

for i in arc arm bfin cris crx fr30 frv h8300 ia64 iq2000 m32r m68hc11 \
mcore mips mmix ms1 pa sh sparc stormy16 v850 vax xtensa; do
gcc -DIN_TARGET_LIBS -dM -I../../gcc/config/$i -I../../include \
-I../../gcc -I../../build/gcc -include backwards/abi.h \
-x c -E $i/$i.h | \
egrep 'BIGGEST_FIELD_ALIGNMENT|ROUND_TYPE_(ALIGN|SIZE)|PCC_BITFIELD_TYPE_MATTERS' \
> $i/$i.h.new;
done


> gcc/config/bfin 0 0 0 1 0
> gcc/config/cris 0 0 0 1 1
> gcc/config/h8300 0 0 0 1 0
> gcc/config/m68hc11 0 0 0 0 1
> gcc/config/mmix 0 0 0 0 1
> gcc/config/sh 0 0 0 0 1

These belong in the `very easy' category, because the definitions are either for STRUCTURE_SIZE_BOUNDARY (last column of the table), or are "#define PCC_BITFIELD_TYPE_MATTERS 0".

> gcc/config/alpha 0 0 0 1 3*
> gcc/config/arc 0 0 0 1 1
> gcc/config/crx 0 0 0 1 1
> gcc/config/fr30 0 0 0 1 0
> gcc/config/ia64 0 0 0 1 0
> gcc/config/iq2000 0 0 0 1 1
> gcc/config/m32r 0 0 0 1 1
> gcc/config/mcore 0 0 0 1 1
> gcc/config/mips 0 0 0 1 1
> gcc/config/ms1 0 0 0 1 1
> gcc/config/pa 0 0 0 1 1
> gcc/config/sparc 0 1 0 1 1
> gcc/config/stormy16 0 0 0 1 0
> gcc/config/xtensa 0 0 0 1 1

All this are "#define PCC_BITFIELD_TYPE_MATTERS 1". I believe this test can be autoconfiscated, but for now I'm creating a separate file, and making it common to all these targets.

Alpha belongs here because, again, the last column is for STRUCTURE_SIZE_BOUNDARY, which it is not being used anymore on the branch.

This also allows us to remove the __sparc__ special casing in libobjc, because the definition is actually the same as the default (I have added a fixme that we don't support TARGET_FASTER_STRUCTS yet).

gcc/config/arm 2 0 0 2
gcc/config/frv 2 0 0 3
gcc/config/v850 1 0 0 0 0
gcc/config/vax 1 0 0 1 1

This are also converted by the attached patch.


This leaves i386, m68k, rs6000. I will only do powerpc-darwin and maybe i386-linux, the rest is up to you (or the respective target maintainers). :-)

Ok?

Paolo
2005-11-17  Paolo Bonzini  <bonzini@gnu.org>

	* configure.ac [bfin, cris, h8300, m6811, m6812, m68hc11, m68hc12,
	m32c, mmix, sh]: No need for an abi.h file.
	[s390]: Make pattern more generic.
	[m32r]: Fix typo, use the PCC bitfield abi.h
	[alpha, arc, crx, fr30, ia64, iq2000, m32r, mcore, mips, ms1, hppa,
	parisc, sparc, xstormy16, xtensa]: Use the PCC bitfield abi.h
	[arm, ep9312, strongarm, xscale]: Use config/arm/abi.h.
	[frv]: Use config/frv/abi.h.
	[v850e, v850e1]: Use config/v850/abi.h.
	[vax]: Use config/vax/abi.h.
	* configure: Regenerate.
	* encoding.c (objc_layout_finish_structure): Remove __sparc__
	special casing.
	* config/arm/abi.h, config/frv/abi.h, config/pcc-bitfield/abi.h,
	config/v850/abi.h, config/vax/abi.h: New.

Index: configure.ac
===================================================================
--- configure.ac	(revision 107115)
+++ configure.ac	(working copy)
@@ -86,16 +86,64 @@ AC_SUBST(OBJC_BOEHM_GC)
 
 case "${host}" in
    avr*-*-* | \
+   bfin*-*-* | \
+   cris-*-* | \
    c4x*-*-* | tic4x-*-* | \
-   m32r*-*-* | \
+   h8300-*-* | \
+   m68hc11-*-* | m6811-*-* | m68hc12-*-* | m6812-*-* \
+   m32c*-*-* | \
+   mmix-knuth-mmixware | \
    mn10300-*-* | am33_2.0-*-* | \
    pdp11-*-* | \
-   s390-*-* | s390x-*-*)
+   s390*-*-* | \
+   sh*-*-*)
+     ;;
+
+   alpha*-*-* | \
+   arc-*-* | \
+   crx-*-* | \
+   fr30-*-* | \
+   ia64-*-* | \
+   iq2000-*-* | \
+   m32r*-*-* | \
+   mcore-*-* | \
+   mips*-*-* | \
+   ms1-*-* | \
+   hppa*-*-* | parisc*-*-* | \
+   xstormy16-*-* |
+   xtensa-*-*)
+     target_config_directory="config/pcc-bitfield"
+     ;;
+
+   arm*-*-* | \
+   ep9312*-*-* | \
+   strongarm*-*-* | \
+   xscale*-*-*)
+     target_config_directory="config/arm"
+     ;;
+
+   frv*-*-*)
+     target_config_directory="config/frv"
+     ;;
+  
+   # FIXME: for SPARC we do not support -mfaster-structs yet
+   sparc*-*-*)
+     target_config_directory="config/pcc-bitfield"
+     ;;
+
+   v850e-*-* | \
+   v850e1-*-*)
+     target_config_directory="config/v850"
+     ;;
+
+   vax-*-*)
+     target_config_directory="config/vax"
      ;;
 
 #  x86_64-*-linux-*) 
 #    target_config_directory="config/x86_64"
 #    ;;
+
    *)
      target_config_directory="config/backwards"
 esac
Index: encoding.c
===================================================================
--- encoding.c	(revision 107115)
+++ encoding.c	(working copy)
@@ -856,7 +856,7 @@ void objc_layout_finish_structure (struc
          in the record type.  Round it up to a multiple of the record's
          alignment. */
 
-#if defined (ROUND_TYPE_ALIGN) && ! defined (__sparc__)
+#ifdef ROUND_TYPE_ALIGN
       layout->record_align = ROUND_TYPE_ALIGN (layout->original_type,
                                                1,
                                                layout->record_align);
Index: config/arm/abi.h
===================================================================
--- config/arm/abi.h	(revision 0)
+++ config/arm/abi.h	(revision 0)
@@ -0,0 +1,21 @@
+/* Definitions of ABI characteristics for libobjc, for ARM.
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 2, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING.  If not, write to
+   the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#define BIGGEST_FIELD_ALIGNMENT 64
Index: config/v850/abi.h
===================================================================
--- config/v850/abi.h	(revision 0)
+++ config/v850/abi.h	(revision 0)
@@ -0,0 +1,21 @@
+/* Definitions of ABI characteristics for libobjc. NEC V850 series
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   GCC is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING.  If not, write to
+   the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#define BIGGEST_FIELD_ALIGNMENT 32
Index: config/pcc-bitfield/abi.h
===================================================================
--- config/pcc-bitfield/abi.h	(revision 0)
+++ config/pcc-bitfield/abi.h	(revision 0)
@@ -0,0 +1,30 @@
+/* abi.h file for targets with PCC bitfields
+   Copyright (C) 1993, 1995, 1996, 1997, 1998, 2000, 2002, 2004
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING.  If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
+/* As a special exception, if you link this library with files
+   compiled with GCC to produce an executable, this does not cause
+   the resulting executable to be covered by the GNU General Public License.
+   This exception does not however invalidate any other reasons why
+   the executable file might be covered by the GNU General Public License.  */
+
+/* TODO: maybe we can autoconfiscate this.  */
+
+#define PCC_BITFIELD_TYPE_MATTERS 1
Index: config/frv/abi.h
===================================================================
--- config/frv/abi.h	(revision 0)
+++ config/frv/abi.h	(revision 0)
@@ -0,0 +1,22 @@
+/* Definitions of ABI characteristics for libobjc, for FRV.
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 2, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING.  If not, write to the Free
+   Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.  */
+
+#define PCC_BITFIELD_TYPE_MATTERS 1
+#define BIGGEST_FIELD_ALIGNMENT 64
Index: config/vax/abi.h
===================================================================
--- config/vax/abi.h	(revision 0)
+++ config/vax/abi.h	(revision 0)
@@ -0,0 +1,23 @@
+/* Definitions of ABI characteristics for libobjc.  VAX version.
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING.  If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
+
+#define PCC_BITFIELD_TYPE_MATTERS 1
+#define BIGGEST_FIELD_ALIGNMENT 32

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]