Skip to contentSkip to conversation

kbuild: dummy-tools, support MPROFILE_KERNEL checks for ppc

PATCH In review Jiri Slaby 2 participants 2 messages Mar 8, 2021 – Mar 9, 2021 Kbuild

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/1 kbuild: dummy-tools, support MPROFILE_KERNEL checks for ppc

ppc64le checks for -mprofile-kernel to define MPROFILE_KERNEL Kconfig. Kconfig calls arch/powerpc/tools/gcc-check-mprofile-kernel.sh for that purpose. This script performs two checks:
1) build with -mprofile-kernel should contain "_mcount"
2) build with -mprofile-kernel with a function marked as "notrace" should not produce "_mcount"

So support this in dummy-tools' gcc, so that we have MPROFILE_KERNEL always true.

Cc Masahiro Yamada <[email protected]>
---
 scripts/dummy-tools/gcc | 9 +++++++++
 1 file changed, 9 insertions(+)
scripts/dummy-tools/gcc +9 -0
index 0d0589cf8184..7b10332b23ba 100755
@@ -73,6 +73,15 @@ if arg_contain -S "$@"; then
 		echo "%gs"
 		exit 0
 	fi
+
+	# For arch/powerpc/tools/gcc-check-mprofile-kernel.sh
+	if arg_contain -m64 "$@" && arg_contain -mlittle-endian "$@" &&
+		arg_contain -mprofile-kernel "$@"; then
+		if ! test -t 0 && ! grep -q notrace; then
+			echo "_mcount"
+		fi
+		exit 0
+	fi
 fi
 
 # To set GCC_PLUGINS
Signature · 1 line
2.30.1
#1 lore raw
Quoted 8 lines · Jiri Slaby

ppc64le checks for -mprofile-kernel to define MPROFILE_KERNEL Kconfig. Kconfig calls arch/powerpc/tools/gcc-check-mprofile-kernel.sh for that purpose. This script performs two checks:
1) build with -mprofile-kernel should contain "_mcount"
2) build with -mprofile-kernel with a function marked as "notrace" should not produce "_mcount"

Quoted 5 lines

So support this in dummy-tools' gcc, so that we have MPROFILE_KERNEL always true.

Cc Masahiro Yamada <[email protected]>

Applied to linux-kbuild/fixes. Thanks.

Quoted 27 lines
---
 scripts/dummy-tools/gcc | 9 +++++++++
 1 file changed, 9 insertions(+)
scripts/dummy-tools/gcc +9 -1
index 0d0589cf8184..7b10332b23ba 100755
@@ -73,6 +73,15 @@ if arg_contain -S "$@"; then
                echo "%gs"
                exit 0
        fi
+
+       # For arch/powerpc/tools/gcc-check-mprofile-kernel.sh
+       if arg_contain -m64 "$@" && arg_contain -mlittle-endian "$@" &&
+               arg_contain -mprofile-kernel "$@"; then
+               if ! test -t 0 && ! grep -q notrace; then
+                       echo "_mcount"
+               fi
+               exit 0
+       fi
 fi
 
 # To set GCC_PLUGINS
--

2.30.1

Signature · 2 lines
Best Regards
Masahiro Yamada