Skip to content

Commit

Permalink
kbuild: dummy-tools: support MPROFILE_KERNEL checks for ppc
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
  • Loading branch information
Jiri Slaby authored and masahir0y committed Mar 11, 2021
1 parent ce6ed1c commit 2eab791
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/dummy-tools/gcc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2eab791

Please sign in to comment.