This is the mail archive of the 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: Trouble building gcc-3.4.0 cygwin->linux

Jim Wilson wrote:
Looking at it again, I see that there are some curious __CYGWIN__ ifdefs in there which might instead be the problem. Your cygwin-x-linux cross compiler would have been compiled with a compiler that defined __CYGWIN__, and thus some stuff in cp/method.c would have been enabled and/or disabled that should not have been. To fix this, put a
in config/i386/cygwin.h (or maybe cygming.h?) and modify cp/method.c to use that define instead of __CYGWIN__. We need a more elegant solution for gcc mainline, but one has already been written. This is the TARGET_USE_LOCAL_THUNK_ALIAS_P stuff I mentioned earler.

See PR 14808. This contains the method.c.diff patch that broke gcc-3.4. This was an attempt to write a safer simpler patch than the one that went into mainline, which can be found here
Unfortunately, this patch breaks cross compilers built on cygwin.

Bingo. The following patch let my cygwin->linux build succeed. Thanks! - Dan

--- gcc-3.4.0/gcc/cp/method.c.old	Sun Jun  6 22:46:04 2004
+++ gcc-3.4.0/gcc/cp/method.c	Sun Jun  6 22:48:13 2004
@@ -286,7 +286,7 @@
   tree alias;
   char buf[256];

-#if defined (__CYGWIN__) || defined (__MINGW32__)
+#if defined (TARGET_IS_PE_COFF)
   if (DECL_ONE_ONLY (function))
     return function;
@@ -404,7 +404,7 @@
   push_to_top_level ();

 #if defined (ASM_OUTPUT_DEF) \
-  && !(defined (__CYGWIN__) || defined (__MINGW32__))
+  && !defined (TARGET_IS_PE_COFF)
   if (targetm.have_named_sections)
       resolve_unique_section (function, 0, flag_function_sections);
--- gcc-3.4.0/gcc/config/i386/cygwin.h.old	Sun Jun  6 22:50:41 2004
+++ gcc-3.4.0/gcc/config/i386/cygwin.h	Sun Jun  6 22:52:18 2004
@@ -22,6 +22,8 @@

#define TARGET_VERSION fprintf (stderr, " (x86 Cygwin)");

+#define TARGET_IS_PE_COFF 1
 #define EXTRA_OS_CPP_BUILTINS()  /* Nothing.  */

 #undef CPP_SPEC
--- gcc-3.4.0/gcc/config/i386/cygming.h.old	Sun Jun  6 22:50:46 2004
+++ gcc-3.4.0/gcc/config/i386/cygming.h	Sun Jun  6 22:52:10 2004
@@ -27,6 +27,8 @@


+#define TARGET_IS_PE_COFF 1
 #include <stdio.h>

/* Masks for subtarget switches used by other files. */

-- My technical stuff: My politics: see for examples of why I'm for regime change

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