sh: only add -mno-fdpic if the compiler supports it
authorMike Frysinger <vapier@gentoo.org>
Thu, 13 Oct 2011 04:45:47 +0000 (00:45 -0400)
committerNobuhiro Iwamatsu <iwamatsu@nigauri.org>
Fri, 2 Dec 2011 04:46:20 +0000 (13:46 +0900)
Not all SuperH toolchains support -mno-fdpic.  Chances are good that if
the flag doesn't work, it isn't defaulting to the FDPIC ABI, so the flag
isn't needed.  So only add it if it is actually supported.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
arch/sh/cpu/sh2/config.mk

index f46b38fa0f0535e1fbb6e272d1f75987587ae1bd..bdd3315ee182d2275afed45c4203e249aaaa1349 100644 (file)
 ENDIANNESS += -EB
 
 ifdef CONFIG_SH2A
-PLATFORM_CPPFLAGS += -m2a -m2a-nofpu -mb -mno-fdpic -ffreestanding
+PLATFORM_CPPFLAGS += -m2a -m2a-nofpu -mb -ffreestanding
 else # SH2
 PLATFORM_CPPFLAGS += -m3e -mb
 endif
+PLATFORM_CPPFLAGS += $(call cc-option,-mno-fdpic)
 
 PLATFORM_RELFLAGS += -ffixed-r13
 PLATFORM_LDFLAGS += $(ENDIANNESS)