This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

[patch] fix recent breakage of darwin, mingw and others


Yesterday's patch to move gfortran to use libcpp uncovered some problems with 
different target configurations. This patch removes the usage of the culprit 
TARGET_* macros as the macros they define are nice-to-have during compilation 
of fortran-sources but (probably) not essential. 


2008-05-26  Daniel Franke  <franke.daniel@gmail.com>

	* fortran/cpp.c (cpp_define_builtins): Remove usage of TARGET_* macros,
	added FIXME instead.


Tested on i686-pc-linux-gnu by myself, on x86_64-pc-mingw32 by Kai Tietz and 
on Dominique Dhumieres currently tests it on i686-darwin.

Assuming no further problems, ok to commit?

	Daniel
Index: fortran/cpp.c
===================================================================
--- fortran/cpp.c	(revision 135891)
+++ fortran/cpp.c	(working copy)
@@ -9,6 +9,7 @@
 
 #include "options.h"
 #include "gfortran.h"
+#include "tm_p.h"		/* Target prototypes.  */
 #include "target.h"
 #include "toplev.h"
 #include "diagnostic.h"
@@ -218,9 +219,22 @@ cpp_define_builtins (cpp_reader *pfile)
 # define builtin_define_std(TXT)
 # define builtin_assert(TXT) cpp_assert (pfile, TXT)
 
+  /* FIXME: Pandora's Box
+    Using the macros below results in multiple breakages:
+     - mingw will fail to compile this file as dependent macros
+       assume to be used in c-cppbuiltin.c only. Further, they use
+       flags only valid/defined in C (same as noted above).
+       [config/i386/mingw32.h, config/i386/cygming.h]
+     - other platforms (not as popular) break similarly
+       [grep for 'builtin_define_with_int_value' in config/*]
+     - darwin will compile but not link
+       (Makefile.in needs to link f951 with some target library or
+       object files. Adding $(C_TARGET_OBJS) to $(F951_OBJS) does
+       seemingly not fix the problem.)
+
   TARGET_CPU_CPP_BUILTINS ();
   TARGET_OS_CPP_BUILTINS ();
-  TARGET_OBJFMT_CPP_BUILTINS ();
+  TARGET_OBJFMT_CPP_BUILTINS (); */
 
 #undef builtin_define
 #undef builtin_define_std

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