Skip to contentSkip to conversation

kbuild: simplify GCC_PLUGINS enablement in dummy-tools/gcc

PATCH In review Masahiro Yamada 1 participant 2 messages Jan 23, 2021 – Jan 25, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: simplify GCC_PLUGINS enablement in dummy-tools/gcc

With commit 1e860048c53e ("gcc-plugins: simplify GCC plugin-dev capability test") applied, this check can be way simpler because now scripts/gcc-plugins/Kconfig only checks plugin-version.h

---

 scripts/dummy-tools/gcc | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
scripts/dummy-tools/gcc +3 -7
index 33487e99d83e..5c113cad5601 100755
@@ -75,16 +75,12 @@ if arg_contain -S "$@"; then
 	fi
 fi
 
-# For scripts/gcc-plugin.sh
+# To set GCC_PLUGINS
 if arg_contain -print-file-name=plugin "$@"; then
 	plugin_dir=$(mktemp -d)
 
-	sed -n 's/.*#include "\(.*\)"/\1/p' $(dirname $0)/../gcc-plugins/gcc-common.h |
-	while read header
-	do
-		mkdir -p $plugin_dir/include/$(dirname $header)
-		touch $plugin_dir/include/$header
-	done
+	mkdir -p $plugin_dir/include
+	touch $plugin_dir/include/plugin-version.h
 
 	echo $plugin_dir
 	exit 0
Signature · 1 line
2.27.0
#1 lore raw
Quoted 36 lines · Masahiro Yamada

With commit 1e860048c53e ("gcc-plugins: simplify GCC plugin-dev capability test") applied, this check can be way simpler because now scripts/gcc-plugins/Kconfig only checks plugin-version.h

---

 scripts/dummy-tools/gcc | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
scripts/dummy-tools/gcc +3 -8
index 33487e99d83e..5c113cad5601 100755
@@ -75,16 +75,12 @@ if arg_contain -S "$@"; then
        fi
 fi
 
-# For scripts/gcc-plugin.sh
+# To set GCC_PLUGINS
 if arg_contain -print-file-name=plugin "$@"; then
        plugin_dir=$(mktemp -d)
 
-       sed -n 's/.*#include "\(.*\)"/\1/p' $(dirname $0)/../gcc-plugins/gcc-common.h |
-       while read header
-       do
-               mkdir -p $plugin_dir/include/$(dirname $header)
-               touch $plugin_dir/include/$header
-       done
+       mkdir -p $plugin_dir/include
+       touch $plugin_dir/include/plugin-version.h
 
        echo $plugin_dir
        exit 0
--
Quoted 2 lines

2.27.0

Applied to linux-kbuild.

Signature · 2 lines
Best Regards
Masahiro Yamada