* [PATCH] Makefile: Remove # characters from compiler string
@ 2021-02-16 21:33 Nathan Chancellor
2021-02-17 7:02 ` Masahiro Yamada
0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2021-02-16 21:33 UTC (permalink / raw)
To: Masahiro Yamada, Michal Marek
Cc: Nick Desaulniers, linux-kbuild, linux-kernel, clang-built-linux,
Nathan Chancellor, Michael Fuckner
When using AMD's Optimizing C/C++ Compiler (AOCC), the build fails due
to a # character in the version string, which is interpreted as a
comment:
$ make CC=clang defconfig init/main.o
include/config/auto.conf.cmd:1374: *** invalid syntax in conditional. Stop.
$ sed -n 1374p include/config/auto.conf.cmd
ifneq "$(CC_VERSION_TEXT)" "AMD clang version 11.0.0 (CLANG: AOCC_2.3.0-Build#85 2020_11_10) (based on LLVM Mirror.Version.11.0.0)"
Remove all # characters in the version string so that the build does not
fail unexpectedly.
Link: https://github.com/ClangBuiltLinux/linux/issues/1298
Reported-by: Michael Fuckner <michael@fuckner.net>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index de1acaefe87e..9bfe1307447e 100644
--- a/Makefile
+++ b/Makefile
@@ -581,7 +581,7 @@ endif
# Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile.
# CC_VERSION_TEXT is referenced from Kconfig (so it needs export),
# and from include/config/auto.conf.cmd to detect the compiler upgrade.
-CC_VERSION_TEXT = $(shell $(CC) --version 2>/dev/null | head -n 1)
+CC_VERSION_TEXT = $(shell $(CC) --version 2>/dev/null | head -n 1 | sed 's/\#//g')
ifdef config-build
# ===========================================================================
base-commit: f40ddce88593482919761f74910f42f4b84c004b
--
2.30.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Makefile: Remove # characters from compiler string
2021-02-16 21:33 [PATCH] Makefile: Remove # characters from compiler string Nathan Chancellor
@ 2021-02-17 7:02 ` Masahiro Yamada
0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2021-02-17 7:02 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Michal Marek, Nick Desaulniers, Linux Kbuild mailing list,
Linux Kernel Mailing List, clang-built-linux, Michael Fuckner
On Wed, Feb 17, 2021 at 6:33 AM Nathan Chancellor <nathan@kernel.org> wrote:
>
> When using AMD's Optimizing C/C++ Compiler (AOCC), the build fails due
> to a # character in the version string, which is interpreted as a
> comment:
>
> $ make CC=clang defconfig init/main.o
> include/config/auto.conf.cmd:1374: *** invalid syntax in conditional. Stop.
>
> $ sed -n 1374p include/config/auto.conf.cmd
> ifneq "$(CC_VERSION_TEXT)" "AMD clang version 11.0.0 (CLANG: AOCC_2.3.0-Build#85 2020_11_10) (based on LLVM Mirror.Version.11.0.0)"
>
> Remove all # characters in the version string so that the build does not
> fail unexpectedly.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1298
> Reported-by: Michael Fuckner <michael@fuckner.net>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
After some thoughts, I decided to apply this as-is for now.
Ideally, the part "AOCC_2.3.0-Build#85"
could be escaped like "AOCC_2.3.0-Build\#85"
so that the original version string is preserved.
I know it is impossible because escape sequence
handling in Kconfig is buggy.
So, I accept dropping problematic '#' characters entirely,
and I agree this is the safest fix.
When I have time, I might want to revisit this with a Kconfig fix.
Applied to linux-kbuild. Thanks.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-17 7:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 21:33 [PATCH] Makefile: Remove # characters from compiler string Nathan Chancellor
2021-02-17 7:02 ` Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).