diff mbox series

[1/1] kbuild: Do not re-quote string values when invoking shell commands

Message ID AS8PR10MB4952A8D70F9AC76F7C2EB4809D259@AS8PR10MB4952.EURPRD10.PROD.OUTLOOK.COM (mailing list archive)
State New, archived
Headers show
Series [1/1] kbuild: Do not re-quote string values when invoking shell commands | expand

Commit Message

Chesnokov Gleb Jan. 31, 2022, 8:48 a.m. UTC
Fix the following shell errors during compilation of external module:
/bin/sh: -c: line 1: syntax error near unexpected token `('
/bin/sh: -c: line 1: `if [ "gcc (GCC) 11.2.1 20211203 (Red Hat 11.2.1-7)" != ""gcc (GCC) 11.2.1 20211203 (Red Hat 11.2.1-7)"" ]; then \'

Fixes: 129ab0d2d9f3 ("kbuild: do not quote string values in include/config/auto.conf")
Signed-off-by: Gleb Chesnokov <Chesnokov.G@raidix.com>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Masahiro Yamada Feb. 7, 2022, 2:35 p.m. UTC | #1
On Mon, Jan 31, 2022 at 5:54 PM Chesnokov Gleb <Chesnokov.G@raidix.com> wrote:
>
> Fix the following shell errors during compilation of external module:
> /bin/sh: -c: line 1: syntax error near unexpected token `('
> /bin/sh: -c: line 1: `if [ "gcc (GCC) 11.2.1 20211203 (Red Hat 11.2.1-7)" != ""gcc (GCC) 11.2.1 20211203 (Red Hat 11.2.1-7)"" ]; then \'
>
> Fixes: 129ab0d2d9f3 ("kbuild: do not quote string values in include/config/auto.conf")
> Signed-off-by: Gleb Chesnokov <Chesnokov.G@raidix.com>


The current code works fine.
Maybe, you are using a stale auto.conf





> ---
>  Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 1fc3491096cb..72205c83a339 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1714,9 +1714,9 @@ PHONY += prepare
>  # now expand this into a simple variable to reduce the cost of shell evaluations
>  prepare: CC_VERSION_TEXT := $(CC_VERSION_TEXT)
>  prepare:
> -       @if [ "$(CC_VERSION_TEXT)" != "$(CONFIG_CC_VERSION_TEXT)" ]; then \
> +       @if [ "$(CC_VERSION_TEXT)" != $(CONFIG_CC_VERSION_TEXT) ]; then \
>                 echo >&2 "warning: the compiler differs from the one used to build the kernel"; \
> -               echo >&2 "  The kernel was built by: $(CONFIG_CC_VERSION_TEXT)"; \
> +               echo >&2 "  The kernel was built by: "$(CONFIG_CC_VERSION_TEXT); \
>                 echo >&2 "  You are using:           $(CC_VERSION_TEXT)"; \
>         fi
>
> --
> 2.35.0



--
Best Regards
Masahiro Yamada
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 1fc3491096cb..72205c83a339 100644
--- a/Makefile
+++ b/Makefile
@@ -1714,9 +1714,9 @@  PHONY += prepare
 # now expand this into a simple variable to reduce the cost of shell evaluations
 prepare: CC_VERSION_TEXT := $(CC_VERSION_TEXT)
 prepare:
-	@if [ "$(CC_VERSION_TEXT)" != "$(CONFIG_CC_VERSION_TEXT)" ]; then \
+	@if [ "$(CC_VERSION_TEXT)" != $(CONFIG_CC_VERSION_TEXT) ]; then \
 		echo >&2 "warning: the compiler differs from the one used to build the kernel"; \
-		echo >&2 "  The kernel was built by: $(CONFIG_CC_VERSION_TEXT)"; \
+		echo >&2 "  The kernel was built by: "$(CONFIG_CC_VERSION_TEXT); \
 		echo >&2 "  You are using:           $(CC_VERSION_TEXT)"; \
 	fi