From patchwork Thu Mar 29 00:48:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 10314307 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 B8E36605B4 for ; Thu, 29 Mar 2018 00:48:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD7C428EE0 for ; Thu, 29 Mar 2018 00:48:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2016291BD; Thu, 29 Mar 2018 00:48:43 +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=-6.9 required=2.0 tests=BAYES_00,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 393C028EE0 for ; Thu, 29 Mar 2018 00:48:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751113AbeC2Asm (ORCPT ); Wed, 28 Mar 2018 20:48:42 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:33779 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751206AbeC2AsR (ORCPT ); Wed, 28 Mar 2018 20:48:17 -0400 Received: by mail-pg0-f68.google.com with SMTP id i194so1950981pgd.0 for ; Wed, 28 Mar 2018 17:48:17 -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:in-reply-to :references; bh=VxY6mAIPlJvoL0g+BWId4bpP4yPZnrwFyL3K4rPyPWo=; b=g/Uq+W34+7ZpFl07EGdjF+KzlZU5mI+/Zvs/4cIXsb47XvLuFR7x3Ksoy5uzJk/RpT v7p81ycknEXAWyLTMg+hELPqWfgQablHsuw7vPAr1XZrEtk2j05o+DI5U9AkqQdIYUZo 8Hzq9JMjOPL+xHiP6Py8GZK9taMUKEafEP/mxLj5YWOwGgzColYogZ0boGVOFE1sYjsv ihfNQOZnbAblx77oHtu/47NfzWilYVHq+Wl4wW6l+5hvliOrq1V/X/uF8fNB/h++Ivgc QMpMsBmPg7um/QyOTUwbpjjuuFHU1i3Zmmg8ZKeXufYG4Hya6QNtYlnx+7hHW0tWRrXE vyXA== X-Gm-Message-State: AElRT7FXLjs/8Kz7eEcnTC93Aqf93aTMEdkCtE2/CX4iXMTA5tmWmvPB 5yxWObPIteJoBsFNcvutioLriw== X-Google-Smtp-Source: AIpwx49pMYIyToB4IZ/pO7uv6zqdIiHxRS0BijGhqwS43y58tjGO/bMdLPkmlqAxvO1wYNpTKdMRYg== X-Received: by 2002:a17:902:5a5:: with SMTP id f34-v6mr5987493plf.288.1522284496817; Wed, 28 Mar 2018 17:48:16 -0700 (PDT) Received: from localhost.net ([2601:602:9802:a8dc:9d5:10b1:50c5:95c0]) by smtp.gmail.com with ESMTPSA id f82sm10932511pfd.175.2018.03.28.17.48.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Mar 2018 17:48:15 -0700 (PDT) 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-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 --- 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)