From patchwork Wed Apr 11 20:04:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 10337119 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 223136053B for ; Wed, 11 Apr 2018 20:04:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 126BF27F60 for ; Wed, 11 Apr 2018 20:04:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 064AD2810E; Wed, 11 Apr 2018 20:04:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9A6027F60 for ; Wed, 11 Apr 2018 20:04:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756332AbeDKUEv (ORCPT ); Wed, 11 Apr 2018 16:04:51 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:46631 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756148AbeDKUEt (ORCPT ); Wed, 11 Apr 2018 16:04:49 -0400 Received: by mail-pl0-f66.google.com with SMTP id 59-v6so2166886plc.13 for ; Wed, 11 Apr 2018 13:04:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=o1SvKtJdNrfJI5lhPAaV5HztC403asLKjRCXSgKl7fg=; b=SQ3gYDZ7q+gMhySs5HXD38PFJ6fF00ijlt7BpNUQdWewOIddT4LqA36WWLB/l+NnBa 8F7ovdyQLYrk1kACHpZkeqzJ3QhAuKwG9oII7SZwI/n6EeLT1GS5IfgAdm3nDMmc83WZ sdan0UpnRcr5Kf0ttXtde6WpHDLCar0jnQ29ijgaz8Ov6noTNcp6TE+uGLb4QEJGo2J6 iO1nqRrZSzdnIzG2o2Aq+BcIXE3G/EYwYjBf4BmXIAa1yc+7iJdd3qSXx/mIuG/vq5AV ol2dl4MHmzXJGXvkjX6P8p7pkMGG1zK9wJ6NS+eI6/aOwE/bxxGPT5C/5NmKqGS7RWgX yzLA== X-Gm-Message-State: ALQs6tDBwbpgVWEo4T197HANtSR7Bg7k6EC/+LODP7tFcmMk3hfq0VqZ hkPAVzOAwie5NJQnnqZH1Qjdqg== X-Google-Smtp-Source: AIpwx492z3cFHfTDQxFnwBUVjxt38xas6AsqN5w1doFrO5+Todb8GZreYKpOwwMhDtc03D02tOpR1A== X-Received: by 2002:a17:902:209:: with SMTP id 9-v6mr6380776plc.403.1523477088958; Wed, 11 Apr 2018 13:04:48 -0700 (PDT) Received: from labbott-redhat.redhat.com ([2601:602:9802:a8dc:4eb2:6dae:ab32:e5b0]) by smtp.gmail.com with ESMTPSA id y2sm3106938pgv.38.2018.04.11.13.04.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Apr 2018 13:04:47 -0700 (PDT) From: Laura Abbott To: Josh Poimboeuf , Masahiro Yamada Cc: Laura Abbott , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCHv2] objtool: Support HOSTCFLAGS and HOSTLDFLAGS Date: Wed, 11 Apr 2018 13:04:32 -0700 Message-Id: <20180411200432.3493-1-labbott@redhat.com> X-Mailer: git-send-email 2.14.3 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- v2: Drop several flags that are already defined in HOSTCFLAGS --- tools/objtool/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile index e6acc281dd37..7df979ae4573 100644 --- a/tools/objtool/Makefile +++ b/tools/objtool/Makefile @@ -31,8 +31,8 @@ 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 += -Werror $(WARNINGS) $(HOSTCFLAGS) -g $(INCLUDES) +LDFLAGS += -lelf $(LIBSUBCMD) $(HOSTLDFLAGS) # Allow old libelf to be used: elfshdr := $(shell echo '\#include ' | $(CC) $(CFLAGS) -x c -E - | grep elf_getshdr)