summaryrefslogtreecommitdiffstats
path: root/scripts/dummy-tools
diff options
context:
space:
mode:
authorOndrej Mosnacek <omosnace@redhat.com>2022-07-11 14:09:23 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2022-07-27 14:17:59 +0200
commitaac289653fa5adf9e9985e4912c1d24a3e8cbab2 (patch)
tree52d8b55b3d0355983464ae574f3dc3ad6a8aa289 /scripts/dummy-tools
parentRevert "scripts/mod/modpost.c: permit '.cranges' secton for sh64 architecture." (diff)
downloadlinux-aac289653fa5adf9e9985e4912c1d24a3e8cbab2.tar.xz
linux-aac289653fa5adf9e9985e4912c1d24a3e8cbab2.zip
kbuild: dummy-tools: avoid tmpdir leak in dummy gcc
When passed -print-file-name=plugin, the dummy gcc script creates a temporary directory that is never cleaned up. To avoid cluttering $TMPDIR, instead use a static directory included in the source tree. Fixes: 76426e238834 ("kbuild: add dummy toolchains to enable all cc-option etc. in Kconfig") Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/dummy-tools')
-rw-r--r--scripts/dummy-tools/dummy-plugin-dir/include/plugin-version.h0
-rwxr-xr-xscripts/dummy-tools/gcc8
2 files changed, 2 insertions, 6 deletions
diff --git a/scripts/dummy-tools/dummy-plugin-dir/include/plugin-version.h b/scripts/dummy-tools/dummy-plugin-dir/include/plugin-version.h
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/scripts/dummy-tools/dummy-plugin-dir/include/plugin-version.h
diff --git a/scripts/dummy-tools/gcc b/scripts/dummy-tools/gcc
index b2483149bbe5..7db825843435 100755
--- a/scripts/dummy-tools/gcc
+++ b/scripts/dummy-tools/gcc
@@ -96,12 +96,8 @@ fi
# To set GCC_PLUGINS
if arg_contain -print-file-name=plugin "$@"; then
- plugin_dir=$(mktemp -d)
-
- mkdir -p $plugin_dir/include
- touch $plugin_dir/include/plugin-version.h
-
- echo $plugin_dir
+ # Use $0 to find the in-tree dummy directory
+ echo "$(dirname "$(readlink -f "$0")")/dummy-plugin-dir"
exit 0
fi