aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/Makefile
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2006-10-10 15:44:10 +0100
committerRalf Baechle <ralf@linux-mips.org>2006-10-11 19:30:59 +0100
commitf94054121efcba573f12101a75a4be93e871b309 (patch)
tree0836e0e2eb24976e5c7f52309e140ce3724a1156 /arch/mips/Makefile
parent[MIPS] Fix timer setup for Jazz (diff)
downloadlinux-dev-f94054121efcba573f12101a75a4be93e871b309.tar.xz
linux-dev-f94054121efcba573f12101a75a4be93e871b309.zip
[MIPS] Workaround for bug in gcc -EB / -EL options.
Certain gcc versions upto gcc 4.1.1 (probably 4.2-subversion as of 2006-10-10 don't properly change the the predefined symbols if -EB / -EL are used, so we kludge that here. A bug has been filed at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29413. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/Makefile')
-rw-r--r--arch/mips/Makefile13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 2124350ab94d..641aa30b3638 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -91,8 +91,17 @@ cflags-y += -ffreestanding
# carefully avoid to add it redundantly because gcc 3.3/3.4 complains
# when fed the toolchain default!
#
-cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB -D__MIPSEB__)
-cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL -D__MIPSEL__)
+# Certain gcc versions upto gcc 4.1.1 (probably 4.2-subversion as of
+# 2006-10-10 don't properly change the the predefined symbols if -EB / -EL
+# are used, so we kludge that here. A bug has been filed at
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29413.
+#
+undef-all += -UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__
+undef-all += -UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__
+predef-be += -DMIPSEB -D_MIPSEB -D__MIPSEB -D__MIPSEB__
+predef-le += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__
+cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(undef-all) $(predef-be))
+cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(undef-all) $(predef-le))
cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \
-fno-omit-frame-pointer