public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* CONFIG_CC_IS_CLANG
@ 2019-02-07 21:03 Nick Desaulniers
  2019-02-07 21:21 ` CONFIG_CC_IS_CLANG Nathan Chancellor
  2019-02-11 15:05 ` CONFIG_CC_IS_CLANG Masahiro Yamada
  0 siblings, 2 replies; 3+ messages in thread
From: Nick Desaulniers @ 2019-02-07 21:03 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Nathan Chancellor, Linux Kbuild mailing list

Masahiro,
I was looking into sprucing up Kbuild for improved LLD support.  One
thing I was curious about was the different checks for clang in the
top level Makefile.

How come a change like:
diff --git a/Makefile b/Makefile
index 3142e67d03f1..525b3fef7d27 100644
--- a/Makefile
+++ b/Makefile
@@ -489,7 +489,7 @@ ifneq ($(KBUILD_SRC),)
  $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)
 endif

-ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
+ifdef CONFIG_CC_IS_CLANG
 ifneq ($(CROSS_COMPILE),)
 CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%))
 GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))


doesn't work?  It's odd that later on in the top level Makefile, we
have that kind of check.  I was hoping to do something similar for
LLD, but it seems that the config options are not defined for that
particular make target?  Does this have to do with config-targets?

-- 
Thanks,
~Nick Desaulniers

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

* Re: CONFIG_CC_IS_CLANG
  2019-02-07 21:03 CONFIG_CC_IS_CLANG Nick Desaulniers
@ 2019-02-07 21:21 ` Nathan Chancellor
  2019-02-11 15:05 ` CONFIG_CC_IS_CLANG Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Nathan Chancellor @ 2019-02-07 21:21 UTC (permalink / raw)
  To: Nick Desaulniers; +Cc: Masahiro Yamada, Linux Kbuild mailing list

On Thu, Feb 07, 2019 at 01:03:01PM -0800, Nick Desaulniers wrote:
> Masahiro,
> I was looking into sprucing up Kbuild for improved LLD support.  One
> thing I was curious about was the different checks for clang in the
> top level Makefile.
> 
> How come a change like:
> diff --git a/Makefile b/Makefile
> index 3142e67d03f1..525b3fef7d27 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -489,7 +489,7 @@ ifneq ($(KBUILD_SRC),)
>   $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)
>  endif
> 
> -ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
> +ifdef CONFIG_CC_IS_CLANG
>  ifneq ($(CROSS_COMPILE),)
>  CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%))
>  GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))
> 
> 
> doesn't work?  It's odd that later on in the top level Makefile, we
> have that kind of check.  I was hoping to do something similar for
> LLD, but it seems that the config options are not defined for that
> particular make target?  Does this have to do with config-targets?
> 
> -- 
> Thanks,
> ~Nick Desaulniers

According to commit 995167420797 ("kbuild: remove cc-name variable"), it
says that this section of the Makefile runs before Kconfig. Masahiro can
obviously give more context and explanation.

Nathan

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

* Re: CONFIG_CC_IS_CLANG
  2019-02-07 21:03 CONFIG_CC_IS_CLANG Nick Desaulniers
  2019-02-07 21:21 ` CONFIG_CC_IS_CLANG Nathan Chancellor
@ 2019-02-11 15:05 ` Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-02-11 15:05 UTC (permalink / raw)
  To: Nick Desaulniers; +Cc: Nathan Chancellor, Linux Kbuild mailing list

On Fri, Feb 8, 2019 at 6:04 AM Nick Desaulniers <ndesaulniers@google.com> wrote:
>
> Masahiro,
> I was looking into sprucing up Kbuild for improved LLD support.  One
> thing I was curious about was the different checks for clang in the
> top level Makefile.
>
> How come a change like:
> diff --git a/Makefile b/Makefile
> index 3142e67d03f1..525b3fef7d27 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -489,7 +489,7 @@ ifneq ($(KBUILD_SRC),)
>   $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)
>  endif
>
> -ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
> +ifdef CONFIG_CC_IS_CLANG
>  ifneq ($(CROSS_COMPILE),)
>  CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%))
>  GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))
>
>
> doesn't work?  It's odd that later on in the top level Makefile, we
> have that kind of check.  I was hoping to do something similar for
> LLD, but it seems that the config options are not defined for that
> particular make target?  Does this have to do with config-targets?

include/config/auto.conf is included at line 594 of top Makefile.

'ifdef CONFIG_CC_IS_CLANG' is always false here.




-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2019-02-11 15:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-07 21:03 CONFIG_CC_IS_CLANG Nick Desaulniers
2019-02-07 21:21 ` CONFIG_CC_IS_CLANG Nathan Chancellor
2019-02-11 15:05 ` CONFIG_CC_IS_CLANG Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox