From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751941AbeC2Aso (ORCPT ); Wed, 28 Mar 2018 20:48:44 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:42696 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751207AbeC2AsR (ORCPT ); Wed, 28 Mar 2018 20:48:17 -0400 X-Google-Smtp-Source: AIpwx49pMYIyToB4IZ/pO7uv6zqdIiHxRS0BijGhqwS43y58tjGO/bMdLPkmlqAxvO1wYNpTKdMRYg== From: Laura Abbott To: Masahiro Yamada , Michal Marek , Josh Poimboeuf Cc: Laura Abbott , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] objtool: Support HOSTCFLAGS and HOSTLDFLAGS Date: Wed, 28 Mar 2018 17:48:04 -0700 Message-Id: <20180329004805.7278-3-labbott@redhat.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180329004805.7278-1-labbott@redhat.com> References: <20180329004805.7278-1-labbott@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It may be useful to compile host programs with different flags (e.g. hardening). Ensure that objtool picks up the appropriate flags. Signed-off-by: Laura Abbott --- tools/objtool/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile index e6acc281dd37..0ff3bcac1ca9 100644 --- a/tools/objtool/Makefile +++ b/tools/objtool/Makefile @@ -31,8 +31,9 @@ INCLUDES := -I$(srctree)/tools/include \ -I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \ -I$(srctree)/tools/objtool/arch/$(ARCH)/include WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed -CFLAGS += -Wall -Werror $(WARNINGS) -fomit-frame-pointer -O2 -g $(INCLUDES) -LDFLAGS += -lelf $(LIBSUBCMD) +CFLAGS += -Wall -Werror $(WARNINGS) $(HOSTCFLAGS) -fomit-frame-pointer -O2 -g \ + $(INCLUDES) +LDFLAGS += -lelf $(LIBSUBCMD) $(HOSTLDFLAGS) # Allow old libelf to be used: elfshdr := $(shell echo '\#include ' | $(CC) $(CFLAGS) -x c -E - | grep elf_getshdr) -- 2.16.2