From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: Masahiro Yamada <masahiroy@kernel.org>, linux-kernel@vger.kernel.org
Subject: [PATCH] kconfig: shorten the temporary directory name for cc-option
Date: Tue, 19 Jul 2022 11:35:39 +0900 [thread overview]
Message-ID: <20220719023539.2199045-1-masahiroy@kernel.org> (raw)
The cc-option macro creates the temporary directory, .tmp_$$$$, which
is expanded into .tmp_<PID><PID>, but the second <PID> is redundant.
(<PID> is the process ID of the sub-shell)
If it were the Makefile code, .tmp_$$$$ would be the correct code.
(see the TMPOUT macro in scripts/Malefile.compiler)
In Makefile, '$$' is an escape sequence of '$'. Make expands '$$$$'
into '$$', then shell expands it into the process ID.
This does not apply to Kconfig because Kconfig requires variable
references to be enclosed by curly braces, like ${variable}.
The '$' that is not followed by '{' loses its special function.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/Kconfig.include | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include
index 0496efd6e117..c1f4222d223d 100644
--- a/scripts/Kconfig.include
+++ b/scripts/Kconfig.include
@@ -25,7 +25,7 @@ failure = $(if-success,$(1),n,y)
# $(cc-option,<flag>)
# Return y if the compiler supports <flag>, n otherwise
-cc-option = $(success,mkdir .tmp_$$$$; trap "rm -rf .tmp_$$$$" EXIT; $(CC) -Werror $(CLANG_FLAGS) $(1) -c -x c /dev/null -o .tmp_$$$$/tmp.o)
+cc-option = $(success,mkdir .tmp_$$; trap "rm -rf .tmp_$$" EXIT; $(CC) -Werror $(CLANG_FLAGS) $(1) -c -x c /dev/null -o .tmp_$$/tmp.o)
# $(ld-option,<flag>)
# Return y if the linker supports <flag>, n otherwise
--
2.34.1
next reply other threads:[~2022-07-19 2:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-19 2:35 Masahiro Yamada [this message]
2022-07-19 3:59 ` [PATCH] kconfig: shorten the temporary directory name for cc-option Nicolas Schier
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=20220719023539.2199045-1-masahiroy@kernel.org \
--to=masahiroy@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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