diff options
author | Nick Sanders <nsanders@chromium.org> | 2011-11-14 16:19:01 -0800 |
---|---|---|
committer | Nick Sanders <nsanders@chromium.org> | 2011-11-14 16:38:28 -0800 |
commit | 6f5da79114987c3b3881230f2efad6f50dd564ae (patch) | |
tree | 811a8db5aead78c4984566c0b207d563556594cb /Makefile | |
parent | 52499b8f3c9db6e7bd948a48d3c7c7e49b722cf8 (diff) | |
download | vboot-6f5da79114987c3b3881230f2efad6f50dd564ae.tar.gz |
Revert "Break out common compile flags"
This reverts commit 5ca219f8d6eb854d95c5d811a4cfdeff2d8405b4
Mysterious ARM PFQ breakage
Change-Id: I45e1067502da0c3cbf77d8b6aafc9d17b461cea3
Reviewed-on: https://gerrit.chromium.org/gerrit/11663
Commit-Ready: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 50 |
1 files changed, 22 insertions, 28 deletions
@@ -5,43 +5,39 @@ export FIRMWARE_ARCH export MOCK_TPM -# -# Provide default CC and CFLAGS for firmware builds; if you have any -D flags, -# please add them after this point (e.g., -DVBOOT_DEBUG). +export CC ?= gcc +export CXX ?= g++ +export CFLAGS = -Wall -Werror + +ifeq (${DEBUG},) +CFLAGS += -O3 +else +CFLAGS += -O0 -g +endif + # # TODO(crosbug.com/16808) 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. # -# As a first step, this makes the setting of CC and CFLAGS here optional, to -# permit a calling script or Makefile to set these. +# Override CC and CFLAGS for firmware builds; if you have any -D flags, please +# add them after this point (e.g., -DVBOOT_DEBUG). # -# Flag ordering: arch, then -f, then -m, then -W -DEBUG_FLAGS := $(if ${DEBUG},-g -O0,-Os) -COMMON_FLAGS := -nostdinc -pipe \ - -ffreestanding -fno-builtin -fno-stack-protector \ - -Werror -Wall -Wstrict-prototypes $(DEBUG_FLAGS) - ifeq ($(FIRMWARE_ARCH), arm) -CC ?= armv7a-cros-linux-gnueabi-gcc -CFLAGS ?= -march=armv5 \ - -fno-common -ffixed-r8 \ - -msoft-float -marm -mabi=aapcs-linux -mno-thumb-interwork \ - $(COMMON_FLAGS) +CC = armv7a-cros-linux-gnueabi-gcc +CFLAGS = -g -Os -fno-common -ffixed-r8 -msoft-float -fno-builtin \ + -ffreestanding -nostdinc \ + -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 -# Drop -march=i386 to permit use of SSE instructions -CFLAGS ?= \ - -ffunction-sections -fvisibility=hidden -fno-strict-aliasing \ - -fomit-frame-pointer -fno-toplevel-reorder -fno-dwarf2-cfi-asm \ - -mpreferred-stack-boundary=2 -mregparm=3 \ - $(COMMON_FLAGS) +CC = i686-pc-linux-gnu-gcc +CFLAGS = -g -Os -ffunction-sections -fvisibility=hidden -fno-builtin \ + -ffreestanding -nostdinc -pipe -Wstrict-prototypes -mregparm=3 \ + -fomit-frame-pointer -fno-stack-protector \ + -mpreferred-stack-boundary=2 -fno-dwarf2-cfi-asm -Werror -Wall endif -CC ?= gcc -CXX ?= g++ - # Fix compiling directly on host (outside of emake) ifeq ($(ARCH),) export ARCH=amd64 @@ -59,8 +55,6 @@ ifeq (${DISABLE_NDEBUG},) CFLAGS += -DNDEBUG endif -export CC CXX CFLAGS - export TOP = $(shell pwd) export FWDIR=$(TOP)/firmware export HOSTDIR=$(TOP)/host |