All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: fix unavoidable GCC call in Clang builds
@ 2022-02-17  3:36 Adrian Ratiu
  2022-02-17 18:10 ` Nathan Chancellor
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian Ratiu @ 2022-02-17  3:36 UTC (permalink / raw)
  To: llvm; +Cc: linux-kernel, Nick Desaulniers, Nathan Chancellor, Manoj Gupta

In ChromeOS and Gentoo we catch any unwanted mixed Clang/LLVM
and GCC/binutils usage via toolchain wrappers which fail builds.
This has revealed that GCC is called unconditionally in Clang
configured builds to populate GCC_TOOLCHAIN_DIR.

Allow overriding the variable to avoid the GCC call - in our
case we can set GCC_TOOLCHAIN_DIR directly in the ebuild recipe.

Suggested-by: Manoj Gupta <manojgupta@chromium.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
---
 tools/scripts/Makefile.include | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index 79d102304470..98c098c064dd 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -90,7 +90,7 @@ EXTRA_WARNINGS += -Wstrict-aliasing=3
 
 else ifneq ($(CROSS_COMPILE),)
 CLANG_CROSS_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%))
-GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)gcc 2>/dev/null))
+GCC_TOOLCHAIN_DIR ?= $(dir $(shell which $(CROSS_COMPILE)gcc 2>/dev/null))
 ifneq ($(GCC_TOOLCHAIN_DIR),)
 CLANG_CROSS_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
 CLANG_CROSS_FLAGS += --sysroot=$(shell $(CROSS_COMPILE)gcc -print-sysroot)
-- 
2.35.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-18  7:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-17  3:36 [PATCH] tools: fix unavoidable GCC call in Clang builds Adrian Ratiu
2022-02-17 18:10 ` Nathan Chancellor
2022-02-18  7:27   ` Adrian Ratiu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.