From patchwork Thu Mar 29 00:48:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 10314305 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 9CB5660467 for ; Thu, 29 Mar 2018 00:48:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9195B28EE0 for ; Thu, 29 Mar 2018 00:48:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85D4928EC6; Thu, 29 Mar 2018 00:48:36 +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 3ABF528EC6 for ; Thu, 29 Mar 2018 00:48:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751341AbeC2AsV (ORCPT ); Wed, 28 Mar 2018 20:48:21 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:43703 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751325AbeC2AsT (ORCPT ); Wed, 28 Mar 2018 20:48:19 -0400 Received: by mail-pf0-f193.google.com with SMTP id j2so2022776pff.10 for ; Wed, 28 Mar 2018 17:48:18 -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=94LC5C+hJfRMi2VuTkchYkhVSmR1732/dtOk4CP83wA=; b=Uo7VW0iixjANHvf+l+hA32xbpIp07OjErP3/GbyBcfkuI4zpT64KsporpZ712lVtDF 9eOt8fHcUoKJuaXsfNI2dZlVjk0IJiNAZPCxyV10ixBMyZFBppmAdeOV4IMvrUP3bhB2 no9lr1eX5KR3kAm9XSEioDj4QmnMN76hfgQwVOr/54AHprJleXT0EoWAMpLSkhybz+Ky khH8AfPvtCMy36EzihMVAsQgBmQd+iD58EfCi+lvJ6tFNCt+/DHnf3ixMH6f4hYgOcWg WrZSodHQQGNDmsrzjzvuS9IRTTvpydRtWbSrtuGhgA+sx4WYLYfvQjjC2baYQGNYtPRA QJNg== X-Gm-Message-State: AElRT7GecnCYrC6CEKcQHFhSpYfoxV5Po19MAl0y+1BG8yMPLrAr62zV XQf+cjVHOGhMKGs+l9ZOEgL+xA== X-Google-Smtp-Source: AIpwx49H+sknc9Yr3AfF1bpBfCnw2sWYNr7ynpI/4JBTnjeVFrCYzMVVCf2QBKn85Pw6GBG66OLbMA== X-Received: by 2002:a17:902:ac96:: with SMTP id h22-v6mr5833882plr.93.1522284498460; Wed, 28 Mar 2018 17:48:18 -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.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Mar 2018 17:48:17 -0700 (PDT) From: Laura Abbott To: Masahiro Yamada , Michal Marek Cc: Laura Abbott , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Poimboeuf Subject: [PATCH 3/3] kbuild: Allow passing additional HOSTCFLAGS and HOSTLDFLAGS Date: Wed, 28 Mar 2018 17:48:05 -0700 Message-Id: <20180329004805.7278-4-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 Similar to AFLAGS_KBUILD, there may be uses (e.g. hardening) for passing in additional flags to host programs. Allow these to be passed in from the environment. Signed-off-by: Laura Abbott --- Documentation/kbuild/kbuild.txt | 9 +++++++++ Makefile | 3 +++ 2 files changed, 12 insertions(+) diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt index ac2363ea05c5..3751a4bc8596 100644 --- a/Documentation/kbuild/kbuild.txt +++ b/Documentation/kbuild/kbuild.txt @@ -24,6 +24,15 @@ KAFLAGS -------------------------------------------------- Additional options to the assembler (for built-in and modules). +AFLAGS_HOSTCFLAGS +-------------------------------------------------- +Additional options passed to the compiler when building host programs. + +AFLAGS_HOSTLDFLAGS +-------------------------------------------------- +Additional options passed to the linker (through the compiler) when buidling +host programs. + AFLAGS_MODULE -------------------------------------------------- Additional module specific options to use for $(AS). diff --git a/Makefile b/Makefile index 7ba478ab8c82..2cab3f8d489c 100644 --- a/Makefile +++ b/Makefile @@ -367,6 +367,9 @@ HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) HOST_LOADLIBES := $(HOST_LFS_LIBS) +HOSTCFLAGS += $(AFLAGS_HOSTCFLAGS) +HOSTLDFLAGS += $(AFLAGS_HOSTLDFLAGS) + # Make variables (CC, etc...) AS = $(CROSS_COMPILE)as LD = $(CROSS_COMPILE)ld