From 3ce000c5f3a8341fe190883f43dd9bd6cf15a2e7 Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Wed, 4 Nov 2015 10:45:28 +0000 Subject: [PATCH] Revert "Makefile: allow overriding CFLAGS on the command line" Riku Voipio reports a regression introduced by d0e2772b93ab ("Makefile: allow overriding CFLAGS on the command line"): | This breaks builds of debian packages as dpkg-buildpackage sets LDFLAGS | to something unsuitable for guest init. Revert the problematic patch for the moment, while we rethink how we'd like to support user-provided toolchain flags. This reverts commit d0e2772b93abcc8a66f83ed8ed248c94adabce4b. Conflicts: Makefile Signed-off-by: Will Deacon --- Makefile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index eac1220..9138942 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,9 @@ include config/utilities.mak include config/feature-tests.mak CC := $(CROSS_COMPILE)gcc +CFLAGS := LD := $(CROSS_COMPILE)ld +LDFLAGS := FIND := find CSCOPE := cscope @@ -160,7 +162,7 @@ ifeq ($(ARCH), arm) OBJS += arm/aarch32/kvm-cpu.o ARCH_INCLUDE := $(HDRS_ARM_COMMON) ARCH_INCLUDE += -Iarm/aarch32/include - override CFLAGS += -march=armv7-a + CFLAGS += -march=armv7-a ARCH_WANT_LIBFDT := y endif @@ -272,12 +274,12 @@ endif ifeq ($(LTO),1) FLAGS_LTO := -flto ifeq ($(call try-build,$(SOURCE_HELLO),$(CFLAGS),$(LDFLAGS) $(FLAGS_LTO)),y) - override CFLAGS += $(FLAGS_LTO) + CFLAGS += $(FLAGS_LTO) endif endif ifeq ($(call try-build,$(SOURCE_STATIC),$(CFLAGS),$(LDFLAGS) -static),y) - override CFLAGS += -DCONFIG_GUEST_INIT + CFLAGS += -DCONFIG_GUEST_INIT GUEST_INIT := guest/init GUEST_OBJS = guest/guest_init.o ifeq ($(ARCH_PRE_INIT),) @@ -329,8 +331,7 @@ DEFINES += -DKVMTOOLS_VERSION='"$(KVMTOOLS_VERSION)"' DEFINES += -DBUILD_ARCH='"$(ARCH)"' KVM_INCLUDE := include -override CFLAGS += $(CPPFLAGS) $(DEFINES) -I$(KVM_INCLUDE) -I$(ARCH_INCLUDE) -override CFLAGS += -O2 -fno-strict-aliasing -g +CFLAGS += $(CPPFLAGS) $(DEFINES) -I$(KVM_INCLUDE) -I$(ARCH_INCLUDE) -O2 -fno-strict-aliasing -g WARNINGS += -Wall WARNINGS += -Wformat=2 @@ -348,10 +349,10 @@ WARNINGS += -Wvolatile-register-var WARNINGS += -Wwrite-strings WARNINGS += -Wno-format-nonliteral -override CFLAGS += $(WARNINGS) +CFLAGS += $(WARNINGS) ifneq ($(WERROR),0) - override CFLAGS += -Werror + CFLAGS += -Werror endif all: $(PROGRAM) $(PROGRAM_ALIAS) $(GUEST_INIT) $(GUEST_PRE_INIT)