@@ -13,6 +13,17 @@
static struct xtensa_config xtensa_defconfig = XTENSA_CONFIG_INITIALIZER;
+#define _STRINGIFY(a) #a
+#define STRINGIFY(a) _STRINGIFY(a)
+
+#undef XTENSA_CONFIG_ENTRY
+#define XTENSA_CONFIG_ENTRY(a) "__" #a "=" STRINGIFY(a)
+
+static const char *xtensa_config_strings[] = {
+ XTENSA_CONFIG_ENTRY_LIST,
+ NULL,
+};
+
#if !defined (HAVE_DLFCN_H) && defined (_WIN32)
#define RTLD_LAZY 0 /* Dummy value. */
@@ -115,3 +126,14 @@ struct xtensa_config *xtensa_get_config (void)
}
return config;
}
+
+const char **xtensa_get_config_strings (void)
+{
+ static const char **config_strings;
+
+ if (!config_strings)
+ config_strings = (const char **) xtensa_load_config ("xtensa_config_strings",
+ &xtensa_config_strings);
+
+ return config_strings;
+}
@@ -73,5 +73,6 @@ extern void xtensa_expand_prologue (void);
extern void xtensa_expand_epilogue (void);
extern void order_regs_for_local_alloc (void);
extern enum reg_class xtensa_regno_to_class (int regno);
+extern const char **xtensa_get_config_strings (void);
#endif /* !__XTENSA_PROTOS_H__ */
@@ -63,6 +63,7 @@ along with GCC; see the file COPYING3. If not see
/* Target CPU builtins. */
#define TARGET_CPU_CPP_BUILTINS() \
do { \
+ const char **builtin; \
builtin_assert ("cpu=xtensa"); \
builtin_assert ("machine=xtensa"); \
builtin_define ("__xtensa__"); \
@@ -72,6 +73,8 @@ along with GCC; see the file COPYING3. If not see
builtin_define (TARGET_BIG_ENDIAN ? "__XTENSA_EB__" : "__XTENSA_EL__"); \
if (!TARGET_HARD_FLOAT) \
builtin_define ("__XTENSA_SOFT_FLOAT__"); \
+ for (builtin = xtensa_get_config_strings (); *builtin; ++builtin) \
+ builtin_define (*builtin); \
} while (0)
#define CPP_SPEC " %(subtarget_cpp_spec) "