Blackfin: propagate target cpu defines when building embedded env
authorMike Frysinger <vapier@gentoo.org>
Sun, 26 Sep 2010 07:00:38 +0000 (07:00 +0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 2 Oct 2010 20:00:40 +0000 (16:00 -0400)
Since we're no longer extracting the env from the target ELF file (since
upstream wouldn't take that change), we're back to the problem of cpu
defines not properly propagating to the env setup stage.  So the embedded
env built by the host compiler doesn't match the one that is linked into
the u-boot env.

Reported-by: Vivi Li <vivi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
arch/blackfin/config.mk

index e531edbfa981b7bd44a1c1927103eadeb14208c6..a3300841a0c3bb4349b3cd58353f94bae0febfe3 100644 (file)
@@ -43,6 +43,9 @@ ALL += $(obj)u-boot.ldr
 endif
 ifeq ($(CONFIG_ENV_IS_EMBEDDED_IN_LDR),y)
 CREATE_LDR_ENV = $(obj)tools/envcrc --binary > $(obj)env-ldr.o
+HOSTCFLAGS_NOPED += \
+       $(shell $(CPP) -dD - -mcpu=$(CONFIG_BFIN_CPU) </dev/null \
+               | awk '$$2 ~ /ADSP/ { print "-D" $$2 }')
 else
 CREATE_LDR_ENV =
 endif