From: Timothy J. W. <tj...@om...> - 2001-07-21 17:55:02
|
For some reason the generated objc-parse.c had its token defines offset by one from those in c-parse.c (thus 'const' got parsed as a CONSTANT node (like an integer constant), not a TYPE_QUAL node). Yikes! It really seems a lot happier now, at least during compilation. When I try to link a tiny ObjC test case, though, I get: /Volumes/Space/mingw32/lib/gcc- lib/i386-mingw32msvc/2.95.3-4/libobjc.a(encoding.o): In function `objc_layout_structure_next_member': /Users/Shared/bungi/Source/MinGW/source/gcc-2.95.3-20010608/libobjc/encoding. c:804: undefined reference to `target_flags' In libobjc/encoding.c we have: #ifdef BIGGEST_FIELD_ALIGNMENT desired_align = MIN (desired_align, BIGGEST_FIELD_ALIGNMENT); #endif BIGGEST_FIELD_ALIGNMENT comes from gcc/config/i386/i386.h: #define TARGET_ALIGN_DOUBLE (target_flags & MASK_ALIGN_DOUBLE) #define BIGGEST_FIELD_ALIGNMENT (TARGET_ALIGN_DOUBLE ? 64 : 32) So the runtime library is using a macro that references a flag that is actually defined in the compiler itself! GCC 3.0 fixes this problem and I've attached diff against gcc-2.95.3-20010608 to incorporate these changes. In addition to the problem above, gcc 3.0 removes the '.' at the end of the BIGGEST_ALIGNMENT macro which turns it into a float. I figured I'd include that since it seems pretty odd. Could someone commit this to the MinGW repository? Thanks! -tim 2000-02-23 Zack Weinberg <za...@wo...> * libobjc/Makefile.in: Add -DIN_TARGET_LIBS to ALL_CFLAGS. * gcc/config/i386/i386.h: If IN_TARGET_LIBS is defined, make BIGGEST_FIELD_ALIGNMENT a constant. --- libobjc/Makefile.in-orig 1999/09/21 13:48:59 1.13 +++ libobjc/Makefile.in 2000/02/23 08:43:44 1.14 @@ -60,7 +60,8 @@ 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 --- gcc/config/i386/i386.h-orig Sat Jul 21 10:23:55 2001 +++ gcc/config/i386/i386.h Sat Jul 21 10:31:43 2001 @@ -427,14 +427,23 @@ /* Minimum size in bits of the largest boundary to which any and all fundamental data types supported by the hardware might need to be aligned. No data type wants to be aligned - rounder than this. The i386 supports 64-bit floating point - quantities, but these can be aligned on any 32-bit boundary. - The published ABIs say that doubles should be aligned on word - boundaries, but the Pentium gets better performance with them - aligned on 64 bit boundaries. */ + rounder than this. + + Pentium+ preferrs DFmode values to be alignmed to 64 bit boundary + and Pentium Pro XFmode values at 128 bit boundaries. */ -#define BIGGEST_ALIGNMENT 128. +#define BIGGEST_ALIGNMENT 128 + +/* 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 /* If defined, a C expression to compute the alignment given to a constant that is being placed in memory. CONSTANT is the constant |