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]

Re: un-break libobjc on i386


On Fri, Feb 11, 2000 at 10:00:24AM -0800, Richard Henderson wrote:
> On Fri, Feb 11, 2000 at 09:39:30AM -0800, Zack Weinberg wrote:
> > This patch makes it possible to link Objective C programs again.
> > BIGGEST_FIELD_ALIGNMENT is used inside libobjc and therefore cannot
> > depend on target_flags.
> 
> It's wrong though.
> 
> You'll have to come up with something similar to IN_LIBGCC2.

How about this?

I only added IN_TARGET_LIBS to libobjc's Makefile because this is
proof of concept - we've got a whole stack of libs that may want it.

zw

===================================================================
Index: libobjc/Makefile.in
--- libobjc/Makefile.in	1999/09/21 13:48:59	1.13
+++ libobjc/Makefile.in	2000/02/11 19:57:55
@@ -60,7 +60,8 @@ RANLIB = @RANLIB@
 
 CC = @CC@
 CFLAGS = @CFLAGS@
-ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) -DIN_GCC
+ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) \
+	-DIN_GCC -DIN_TARGET_LIBS
 
 #
 # Define the cc1obj in terms of the CC that is passed on from higher
===================================================================
Index: gcc/config/i386/i386.h
--- gcc/config/i386/i386.h	2000/02/08 17:15:00	1.100
+++ gcc/config/i386/i386.h	2000/02/11 19:57:56
@@ -469,10 +469,16 @@ extern int ix86_arch;
 #define BIGGEST_ALIGNMENT 128
 
 /* The published ABIs say that doubles should be aligned on word
-   boundaries, so lower the aligmnet for structure fields unless
+   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.  It is only used as a clamp value, so set it to 64 always
+   in that context.  */
+#ifndef IN_TARGET_LIBS
 #define BIGGEST_FIELD_ALIGNMENT (TARGET_ALIGN_DOUBLE ? 64 : 32)
+#else
+#define BIGGEST_FIELD_ALIGNMENT 64
+#endif
 
 /* If defined, a C expression to compute the alignment given to a
    constant that is being placed in memory.  CONSTANT is the constant

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