From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
Masahiro Yamada <masahiroy@kernel.org>,
Adam Bratschi-Kaye <ark.email@gmail.com>,
Alex Gaynor <alex.gaynor@gmail.com>, Finn Behrens <me@kloenk.de>,
Geoffrey Thomas <geofft@ldpreload.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>,
Miguel Ojeda <ojeda@kernel.org>,
Wedson Almeida Filho <wedsonaf@google.com>,
Randy Dunlap <rdunlap@infradead.org>
Subject: Re: linux-next: manual merge of the rust tree with the kbuild tree
Date: Thu, 12 Aug 2021 16:34:58 +1000 [thread overview]
Message-ID: <20210812163458.37ba7ed3@canb.auug.org.au> (raw)
In-Reply-To: <CAKwvOdkv+L6LQO2NPr7EmGS3mp3AN=5CBfFkS0v6YU4j4YAm6A@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3628 bytes --]
Hi Nick,
On Wed, 11 Aug 2021 10:04:36 -0700 Nick Desaulniers <ndesaulniers@google.com> wrote:
>
> Thanks Stephen for taking the time to resolve this and send a patch.
> We owe you one. We knew this conflict was coming.
>
> Miguel, would you mind rolling this patch into your tree, then
> crediting Stephen if possible (on the patch that adds
> TENTATIVE_CLANG_FLAGS)?
>
> I think the above `ifneq ($(findstring clang,$(CC_VERSION_TEXT)),)`
> should stay in the top level Makefile though. It does look nicer to
> bury it in scripts/Makefile.clang, but I worry that someone doing a
> GCC build might trip the $(error) in that file (if CROSS_COMPILE was
> set and we're building a non-llvm-supported target).
OK, I have changed the patch today to be this:
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 11 Aug 2021 17:18:36 +1000
Subject: [PATCH] fixup for rust integration with Makefile.clang creation
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
Makefile | 17 -----------------
scripts/Makefile.clang | 19 +++++++++++++------
2 files changed, 13 insertions(+), 23 deletions(-)
diff --git a/Makefile b/Makefile
index 5d504a1dcb06..3638ce07f208 100644
--- a/Makefile
+++ b/Makefile
@@ -625,22 +625,7 @@ endif
# and from include/config/auto.conf.cmd to detect the compiler upgrade.
CC_VERSION_TEXT = $(subst $(pound),,$(shell LC_ALL=C $(CC) --version 2>/dev/null | head -n 1))
-TENTATIVE_CLANG_FLAGS := -Werror=unknown-warning-option
-
-ifneq ($(CROSS_COMPILE),)
-TENTATIVE_CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
-endif
-ifeq ($(LLVM_IAS),1)
-TENTATIVE_CLANG_FLAGS += -integrated-as
-else
-TENTATIVE_CLANG_FLAGS += -no-integrated-as
-GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
-TENTATIVE_CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
-endif
-
-export TENTATIVE_CLANG_FLAGS
-
ifneq ($(findstring clang,$(CC_VERSION_TEXT)),)
include $(srctree)/scripts/Makefile.clang
endif
diff --git a/scripts/Makefile.clang b/scripts/Makefile.clang
index 3ae63bd35582..555b5255d9b3 100644
--- a/scripts/Makefile.clang
+++ b/scripts/Makefile.clang
@@ -12,24 +12,29 @@ CLANG_TARGET_FLAGS_s390 := s390x-linux-gnu
CLANG_TARGET_FLAGS_x86 := x86_64-linux-gnu
CLANG_TARGET_FLAGS := $(CLANG_TARGET_FLAGS_$(SRCARCH))
+TENTATIVE_CLANG_FLAGS := -Werror=unknown-warning-option
+
ifeq ($(CROSS_COMPILE),)
ifeq ($(CLANG_TARGET_FLAGS),)
$(error Specify CROSS_COMPILE or add '--target=' option to scripts/Makefile.clang)
else
-CLANG_FLAGS += --target=$(CLANG_TARGET_FLAGS)
+TENTATIVE_CLANG_FLAGS += --target=$(CLANG_TARGET_FLAGS)
endif # CLANG_TARGET_FLAGS
else
-CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
+TENTATIVE_CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
endif # CROSS_COMPILE
ifeq ($(LLVM_IAS),0)
-CLANG_FLAGS += -no-integrated-as
+TENTATIVE_CLANG_FLAGS += -no-integrated-as
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
-CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
+TENTATIVE_CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
else
-CLANG_FLAGS += -integrated-as
+TENTATIVE_CLANG_FLAGS += -integrated-as
endif
-CLANG_FLAGS += -Werror=unknown-warning-option
+
+export TENTATIVE_CLANG_FLAGS
+
+CLANG_FLAGS += $(TENTATIVE_CLANG_FLAGS)
KBUILD_CFLAGS += $(CLANG_FLAGS)
KBUILD_AFLAGS += $(CLANG_FLAGS)
export CLANG_FLAGS
--
2.30.2
Please give it a spin when linux-next has been released.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2021-08-12 6:35 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-11 7:26 linux-next: manual merge of the rust tree with the kbuild tree Stephen Rothwell
2021-08-11 17:04 ` Nick Desaulniers
2021-08-12 6:34 ` Stephen Rothwell [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-03-17 9:38 Stephen Rothwell
2025-03-17 19:36 ` Miguel Ojeda
2025-03-31 23:58 ` Stephen Rothwell
2024-05-06 5:33 Stephen Rothwell
2024-05-06 10:19 ` Miguel Ojeda
2024-05-14 0:20 ` Stephen Rothwell
2022-09-27 18:16 broonie
2022-09-28 17:16 ` Miguel Ojeda
2022-10-04 22:23 ` Stephen Rothwell
2022-09-26 23:12 broonie
2022-09-27 12:47 ` Miguel Ojeda
2022-09-12 7:41 Stephen Rothwell
2022-08-02 23:38 broonie
2022-08-03 9:28 ` Miguel Ojeda
2022-08-14 23:08 ` Stephen Rothwell
2022-04-05 3:14 Stephen Rothwell
2022-04-05 8:33 ` Miguel Ojeda
2022-03-17 6:02 Stephen Rothwell
2022-03-17 7:11 ` Miguel Ojeda
2022-01-17 23:51 Stephen Rothwell
2021-12-07 5:13 Stephen Rothwell
2021-12-03 5:20 Stephen Rothwell
2021-12-03 9:05 ` Miguel Ojeda
2021-10-15 7:24 Stephen Rothwell
2021-10-15 12:24 ` Miguel Ojeda
2021-10-28 9:09 ` Stephen Rothwell
2021-10-28 11:06 ` Miguel Ojeda
2021-10-06 5:46 Stephen Rothwell
2021-03-29 7:32 Stephen Rothwell
2021-03-18 4:37 Stephen Rothwell
2021-03-18 5:04 ` Miguel Ojeda
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=20210812163458.37ba7ed3@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=alex.gaynor@gmail.com \
--cc=ark.email@gmail.com \
--cc=geofft@ldpreload.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=me@kloenk.de \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=ndesaulniers@google.com \
--cc=ojeda@kernel.org \
--cc=rdunlap@infradead.org \
--cc=wedsonaf@google.com \
/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