Skip to content

Commit

Permalink
kbuild: dummy-tools: avoid tmpdir leak in dummy gcc
Browse files Browse the repository at this point in the history
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: 76426e2 ("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>
  • Loading branch information
Ondrej Mosnacek authored and Masahiro Yamada committed Jul 27, 2022
1 parent 028062e commit aac2896
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Empty file.
8 changes: 2 additions & 6 deletions scripts/dummy-tools/gcc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit aac2896

Please sign in to comment.