This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

fix macro redefinitions for Xtensa targets


The include/xtensa-config.h file is sometimes included in target source
files (e.g., for libgcc) where the same Xtensa configuration macros may
have already been defined by other target include files.  This should
usually be harmless because the configuration had better be the same,
but it causes lots of build warnings and could someday lead to trouble. 
This patch undefines all the xtensa-config.h macros before defining
them, so that there will be no warnings about macro redefinitions and so
that the values defined here will always win over other target include
files.

Tested with an xtensa-linux build of gcc and binutils.  Committed on the
mainlines for gcc and binutils.

include ChangeLog:

2003-07-09  Bob Wilson  <bob.wilson@acm.org>

        * xtensa-config.h: Undef all macros before defining them.
Index: xtensa-config.h
===================================================================
RCS file: /cvs/gcc/gcc/include/xtensa-config.h,v
retrieving revision 1.1
diff -u -r1.1 xtensa-config.h
--- xtensa-config.h	1 Jul 2003 00:14:24 -0000	1.1
+++ xtensa-config.h	10 Jul 2003 05:03:17 -0000
@@ -24,45 +24,116 @@
    Xtensa System Software Reference Manual for documentation of these
    macros.  */
 
+#undef XCHAL_HAVE_BE
 #define XCHAL_HAVE_BE			1
+
+#undef XCHAL_HAVE_DENSITY
 #define XCHAL_HAVE_DENSITY		1
+
+#undef XCHAL_HAVE_CONST16
 #define XCHAL_HAVE_CONST16		0
+
+#undef XCHAL_HAVE_ABS
 #define XCHAL_HAVE_ABS			1
+
+#undef XCHAL_HAVE_ADDX
 #define XCHAL_HAVE_ADDX			1
+
+#undef XCHAL_HAVE_L32R
 #define XCHAL_HAVE_L32R			1
+
+#undef XCHAL_HAVE_MAC16
 #define XCHAL_HAVE_MAC16		0
+
+#undef XCHAL_HAVE_MUL16
 #define XCHAL_HAVE_MUL16		0
+
+#undef XCHAL_HAVE_MUL32
 #define XCHAL_HAVE_MUL32		0
+
+#undef XCHAL_HAVE_DIV32
 #define XCHAL_HAVE_DIV32		0
+
+#undef XCHAL_HAVE_NSA
 #define XCHAL_HAVE_NSA			1
+
+#undef XCHAL_HAVE_MINMAX
 #define XCHAL_HAVE_MINMAX		0
+
+#undef XCHAL_HAVE_SEXT
 #define XCHAL_HAVE_SEXT			0
+
+#undef XCHAL_HAVE_LOOPS
 #define XCHAL_HAVE_LOOPS		1
+
+#undef XCHAL_HAVE_BOOLEANS
 #define XCHAL_HAVE_BOOLEANS		0
+
+#undef XCHAL_HAVE_FP
 #define XCHAL_HAVE_FP			0
+
+#undef XCHAL_HAVE_FP_DIV
 #define XCHAL_HAVE_FP_DIV		0
+
+#undef XCHAL_HAVE_FP_RECIP
 #define XCHAL_HAVE_FP_RECIP		0
+
+#undef XCHAL_HAVE_FP_SQRT
 #define XCHAL_HAVE_FP_SQRT		0
+
+#undef XCHAL_HAVE_FP_RSQRT
 #define XCHAL_HAVE_FP_RSQRT		0
+
+#undef XCHAL_HAVE_WINDOWED
 #define XCHAL_HAVE_WINDOWED		1
 
+
+#undef XCHAL_ICACHE_SIZE
 #define XCHAL_ICACHE_SIZE		8192
+
+#undef XCHAL_DCACHE_SIZE
 #define XCHAL_DCACHE_SIZE		8192
+
+#undef XCHAL_ICACHE_LINESIZE
 #define XCHAL_ICACHE_LINESIZE		16
+
+#undef XCHAL_DCACHE_LINESIZE
 #define XCHAL_DCACHE_LINESIZE		16
+
+#undef XCHAL_ICACHE_LINEWIDTH
 #define XCHAL_ICACHE_LINEWIDTH		4
+
+#undef XCHAL_DCACHE_LINEWIDTH
 #define XCHAL_DCACHE_LINEWIDTH		4
+
+#undef XCHAL_DCACHE_IS_WRITEBACK
 #define XCHAL_DCACHE_IS_WRITEBACK	0
 
+
+#undef XCHAL_HAVE_MMU
 #define XCHAL_HAVE_MMU			1
+
+#undef XCHAL_MMU_MIN_PTE_PAGE_SIZE
 #define XCHAL_MMU_MIN_PTE_PAGE_SIZE	12
 
+
+#undef XCHAL_HAVE_DEBUG
 #define XCHAL_HAVE_DEBUG		1
+
+#undef XCHAL_NUM_IBREAK
 #define XCHAL_NUM_IBREAK		2
+
+#undef XCHAL_NUM_DBREAK
 #define XCHAL_NUM_DBREAK		2
+
+#undef XCHAL_DEBUGLEVEL
 #define XCHAL_DEBUGLEVEL		4
 
-#define XCHAL_EXTRA_SA_SIZE             0
-#define XCHAL_EXTRA_SA_ALIGN            1
+
+#undef XCHAL_EXTRA_SA_SIZE
+#define XCHAL_EXTRA_SA_SIZE		0
+
+#undef XCHAL_EXTRA_SA_ALIGN
+#define XCHAL_EXTRA_SA_ALIGN		1
 
 #endif /* !XTENSA_CONFIG_H */

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