summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChe-Liang Chiou <clchiou@chromium.org>2011-06-21 15:25:51 -0700
committerChe-Liang Chiou <clchiou@chromium.org>2011-06-21 16:26:36 -0700
commit74359b755c4a203df0fe3bf51fc53d5de87d1fbf (patch)
tree4a54d3ac7c2ed3378608df1949f6c2abc4d0d8e6
parentf155ab3a26d07f94dcf64732d6e19b59da1c96ed (diff)
downloadvboot-74359b755c4a203df0fe3bf51fc53d5de87d1fbf.tar.gz
make: temporarily hard-coded compiler flags for firmware builds
Before this commit, u-boot and vboot_reference are inter-dependent on each other; the former needs to be linked with the latter, and the latter needs the compiler flags of the former to be built properly. This commit hard-code u-boot's compiler flags into Makefile, and thus removes the inter-dependency. Note that this is just a temporarily measure before we get the compiler flags right. BUG=chromium-os:16808 TEST=emerge-{tegra2_seaboard,x86-alex} vboot_reference-firmware Change-Id: Ia3b487b32775afd98fa15db29dbff51ae9d8a94d Reviewed-on: http://gerrit.chromium.org/gerrit/2947 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
-rw-r--r--Makefile29
1 files changed, 25 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 93631541..125b9294 100644
--- a/Makefile
+++ b/Makefile
@@ -15,10 +15,31 @@ else
CFLAGS += -O0 -g
endif
-# Override CC and CFLAGS only if FIRMWARE_CONFIG_PATH is not empty, but we
-# wish to preserve -D flags (so move all -D flags after this).
-ifneq (${FIRMWARE_CONFIG_PATH},)
-include ${FIRMWARE_CONFIG_PATH}
+#
+# TODO We hard-code u-boot's compiler flags here just temporarily. As we are
+# still investigating which flags are necessary for maintaining a compatible
+# ABI, etc. between u-boot and vboot_reference.
+#
+# Override CC and CFLAGS for firmware builds; if you have any -D flags, please
+# add them after this point (e.g., -DVBOOT_DEBUG).
+#
+ifeq ($(FIRMWARE_ARCH), "arm")
+CC = armv7a-cros-linux-gnueabi-gcc
+CFLAGS = -g -Os -fno-common -ffixed-r8 -msoft-float -fno-builtin \
+ -ffreestanding -nostdinc \
+ -isystem /usr/lib/gcc/armv7a-cros-linux-gnueabi/4.4.3/gcc/armv7a-cros-linux-gnueabi/4.4.3/include \
+ -pipe -marm -mabi=aapcs-linux -mno-thumb-interwork -march=armv5 \
+ -Werror -Wall -Wstrict-prototypes -fno-stack-protector
+endif
+ifeq ($(FIRMWARE_ARCH), "i386")
+CC = i686-pc-linux-gnu-gcc
+CFLAGS = -g -Os -ffunction-sections -fvisibility=hidden -fno-builtin \
+ -ffreestanding -nostdinc \
+ -isystem /usr/lib/gcc/i686-pc-linux-gnu/4.4.3/gcc/i686-pc-linux-gnu/4.4.3/include \
+ -pipe -fno-strict-aliasing -Wstrict-prototypes -mregparm=3 \
+ -fomit-frame-pointer -ffreestanding -fno-toplevel-reorder \
+ -fno-stack-protector -mpreferred-stack-boundary=2 -fno-dwarf2-cfi-asm \
+ -march=i386 -Werror -Wall -Wstrict-prototypes -fno-stack-protector
endif
# Fix compiling directly on host (outside of emake)