the setting of CC in the payload (coreinfo) when calling
make CC=i386-elf-gcc AS=i386-elf-as AR=i386-elf-ar STRIP=i386-elf-strip
This still does not cope with the hardcoded -fno-stack-protector in
libpayload's Makefile.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Peter Stuge <peter@stuge.se>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3477
2b7e53f0-3cfb-0310-b3e9-
8179ed1497e1
HOSTCXXFLAGS := -I$(srck) -I$(objk)
LIBPAYLOAD_DIR := ../libpayload
HOSTCXXFLAGS := -I$(srck) -I$(objk)
LIBPAYLOAD_DIR := ../libpayload
-CC = $(LIBPAYLOAD_DIR)/bin/lpgcc
+XCC := CC=$(CC) $(LIBPAYLOAD_DIR)/bin/lpgcc
AS = $(LIBPAYLOAD_DIR)/bin/lpas
AS = $(LIBPAYLOAD_DIR)/bin/lpas
INCLUDES = -Ibuild
CFLAGS := -Wall -Werror -Os $(INCLUDES)
INCLUDES = -Ibuild
CFLAGS := -Wall -Werror -Os $(INCLUDES)
$(TARGET): $(src)/.config $(OBJS)
$(Q)printf " LD $(subst $(shell pwd)/,,$(@))\n"
$(TARGET): $(src)/.config $(OBJS)
$(Q)printf " LD $(subst $(shell pwd)/,,$(@))\n"
- $(Q)$(CC) -o $@ $(OBJS)
+ $(Q)$(XCC) -o $@ $(OBJS)
$(Q)printf " STRIP $(subst $(shell pwd)/,,$(@))\n"
$(Q)printf " STRIP $(subst $(shell pwd)/,,$(@))\n"
$(obj)/%.S.o: $(src)/%.S
$(Q)printf " AS $(subst $(shell pwd)/,,$(@))\n"
$(obj)/%.S.o: $(src)/%.S
$(Q)printf " AS $(subst $(shell pwd)/,,$(@))\n"
$(obj)/%.o: $(src)/%.c
$(Q)printf " CC $(subst $(shell pwd)/,,$(@))\n"
$(obj)/%.o: $(src)/%.c
$(Q)printf " CC $(subst $(shell pwd)/,,$(@))\n"
- $(Q)$(CC) $(CFLAGS) -c -o $@ $<
+ $(Q)$(XCC) $(CFLAGS) -c -o $@ $<
# GCC wrapper for libpayload
# GCC wrapper for libpayload
+if [ "$CC" != "" ]; then
+DEFAULT_CC=$CC
+else
. $BASE/lp.functions
trygccoption() {
. $BASE/lp.functions
trygccoption() {
- $DEFAULT_CC $1 -S -xc /dev/null -o .$$.tmp > /dev/null
+ $DEFAULT_CC $1 -S -xc /dev/null -o .$$.tmp &> /dev/null
+ RET=$?