mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ross Burton <ross.burton@arm.com>
To: linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: keescook@chromium.org
Subject: [PATCH] scripts/gcc-plugins: consistently use HOSTCC
Date: Thu, 23 Sep 2021 16:28:11 +0100	[thread overview]
Message-ID: <20210923152811.406516-1-ross.burton@arm.com> (raw)

The GCC plugins are built using HOSTCC, but the path to the GCC plugins
headers is obtained using CC.  This can lead to interesting failures if
the host compiler and cross compiler are different versions, and the
host compiler uses the cross headers.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 scripts/gcc-plugins/Kconfig  | 2 +-
 scripts/gcc-plugins/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/gcc-plugins/Kconfig b/scripts/gcc-plugins/Kconfig
index ab9eb4cbe33a..5dad6d780138 100644
--- a/scripts/gcc-plugins/Kconfig
+++ b/scripts/gcc-plugins/Kconfig
@@ -9,7 +9,7 @@ menuconfig GCC_PLUGINS
 	bool "GCC plugins"
 	depends on HAVE_GCC_PLUGINS
 	depends on CC_IS_GCC
-	depends on $(success,test -e $(shell,$(CC) -print-file-name=plugin)/include/plugin-version.h)
+	depends on $(success,test -e $(shell,$(HOSTCC) -print-file-name=plugin)/include/plugin-version.h)
 	default y
 	help
 	  GCC plugins are loadable modules that provide extra features to the
diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile
index 1952d3bb80c6..a55363f84e19 100644
--- a/scripts/gcc-plugins/Makefile
+++ b/scripts/gcc-plugins/Makefile
@@ -19,7 +19,7 @@ targets += randomize_layout_seed.h randomize_layout_hash.h
 
 always-y += $(GCC_PLUGIN)
 
-GCC_PLUGINS_DIR = $(shell $(CC) -print-file-name=plugin)
+GCC_PLUGINS_DIR = $(shell $(HOSTCC) -print-file-name=plugin)
 
 plugin_cxxflags	= -Wp,-MMD,$(depfile) $(KBUILD_HOSTCXXFLAGS) -fPIC \
 		  -include $(srctree)/include/linux/compiler-version.h \
-- 
2.25.1


             reply	other threads:[~2021-09-23 15:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23 15:28 Ross Burton [this message]
2021-09-23 21:28 ` Kees Cook
2021-09-27 15:10   ` Dmitry Osipenko
2021-09-27 15:30     ` Ross Burton
     [not found]     ` <DB9PR08MB6460E4643AB5AE8932C1AF94E8A79@DB9PR08MB6460.eurprd08.prod.outlook.com>
2021-09-27 16:12       ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210923152811.406516-1-ross.burton@arm.com \
    --to=ross.burton@arm.com \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®