Received: by 10.213.65.68 with SMTP id h4csp996900imn; Wed, 28 Mar 2018 17:49:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/9NNqkX8hfIXG9wULoWRVmoV/1l+hmK8cmQqsfba5VDLnIbnQ+jh4r2PcbAkLOHc9crkfp X-Received: by 2002:a17:902:744c:: with SMTP id e12-v6mr3954771plt.382.1522284573483; Wed, 28 Mar 2018 17:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522284573; cv=none; d=google.com; s=arc-20160816; b=dpO6YK1KcP/BpnyWJ640WpehOSXU+8arXKdZETvFPfClj5nhfRKVuwYMAChT9JmgSo jeRyyJLYzMbQQjzmthd3t86s+SNBK2kwMkzB1R18sgkuU+oFVgKeGdMUp9svY5/sNcEQ 9NozcYie6B+HNwT8/Nzy/Lw2R3HRMxP+dRA0uyaBnkwVQ+2UByBg6ekDmO/a4MgFYGSy 9ShrDeaFJJJlbRHg2AFOknw4KvRqJLa/POMp4ljH8MhYLB9Eikv2SQiNIZzgRbXxEZs+ X+LdEsnSFAnsM0femwCmOjPTQ8xPxW+M1j1RXxGt1UuWz9fnHj4kD6z2uxrWJm9bAv/r W9GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=94LC5C+hJfRMi2VuTkchYkhVSmR1732/dtOk4CP83wA=; b=AsvnK8TUDh2WuyTggAZt+R7ALrC0+AWLqyNwvP9VpH+DrlxQ7Dc9ivrM7ByP78fWBB m+WyxPp2zGG7z+s/0eslNWXCW1Ae79axhipdW4rzZn3Ym2yEXpOKxRXoxx4KtdjFCvu7 qGTgRawzU5Ad5zBVuczQqy5Z0Ij8inee7mXqvUmmJclFpA5RZXLhuUsDOyW9n6yFg8FZ tnhEwGDIej9rBtNiiVRsfRT2Z13/xwsdKluC+lBiuK1G1gFlObXDR0xvTbYFvKtUvrTr +/+s5hAm0xg5sAa/u/5GnIp1Z9Gjf2tJ4NzsbxRPtY8eImrRzBm+basTT8HsZb4OlSPT ce8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1-v6si3833549pld.222.2018.03.28.17.49.19; Wed, 28 Mar 2018 17:49:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751865AbeC2AsW (ORCPT + 99 others); Wed, 28 Mar 2018 20:48:22 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:37288 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751205AbeC2AsT (ORCPT ); Wed, 28 Mar 2018 20:48:19 -0400 Received: by mail-pf0-f196.google.com with SMTP id t16so2029785pfh.4 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=Z5yVueVxvym37l/ljiE1/dv/rkDFiQDMoMcQMbWh9bcfZ93TnZz0PF8MYDqTib18zt 744qv2/GCR5hHeJ6TBQKUk2AAqoHbhyuw32qyzASYSL2idcVVKAvA8EQFO4jpGbpp7Iq VdydVT1mX2tlq3bRComVnWG/FeGjdgymRWE+cLmEcZKTREAwsAOHOVyRz85b9epzRIUg PNg+h/0pjR5O/PM88vDLEZeXQxVvjUl8cxNcdIwXpI5S6/InK7Q4nHSbCcfzfTWu2iO6 61inYcrNJVwaCjIucStVZ/zjdJmKrPMD/x0Rc9+41tAyY0qE+6ckJuiPDJLSF/hCNCXC 8L1g== X-Gm-Message-State: AElRT7E6gZiBKaWX3w1QHrLDr+ESFBRlncOSOJ2rqGBgXQ+Ns1PXOLCr ScHTseRMKRFi4GvSUsZBVycn/w== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.16.2