* [PATCH] powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh
@ 2023-05-30 9:38 Naveen N Rao
2023-10-27 9:59 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Naveen N Rao @ 2023-05-30 9:38 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, Nicholas Piggin
Toolchains don't always default to the ELFv2 ABI. This is true with at
least the kernel.org toolchains. As such, pass -mabi=elfv2 explicitly to
ensure that we are testing against the correct compiler output.
Signed-off-by: Naveen N Rao <naveen@kernel.org>
---
The script works fine without this change, so this is not a fix per se.
I felt it is better to be explicit about the ABI here to be sure about
what we are testing against.
This applies atop Nick's patch to enable -mprofile-kernel for ELFv2 BE:
http://lore.kernel.org/20230506011814.8766-1-npiggin@gmail.com
- Naveen
arch/powerpc/tools/gcc-check-mprofile-kernel.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/tools/gcc-check-mprofile-kernel.sh b/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
index e78c599251ff35..abd6b9b8f07e3e 100755
--- a/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
+++ b/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
@@ -7,20 +7,20 @@ set -o pipefail
# To debug, uncomment the following line
# set -x
-# -mprofile-kernel is only supported on 64le, so this should not be invoked
-# for other targets. Therefore we can pass in -m64 and -mlittle-endian
-# explicitly, to take care of toolchains defaulting to other targets.
+# -mprofile-kernel is only supported on ppc64, so this should not be invoked
+# for other targets. Therefore we can pass in -m64 and -mabi explicitly, to
+# take care of toolchains defaulting to other targets.
# Test whether the compile option -mprofile-kernel exists and generates
# profiling code (ie. a call to _mcount()).
echo "int func() { return 0; }" | \
- $* -m64 -S -x c -O2 -p -mprofile-kernel - -o - \
+ $* -m64 -mabi=elfv2 -S -x c -O2 -p -mprofile-kernel - -o - \
2> /dev/null | grep -q "_mcount"
# Test whether the notrace attribute correctly suppresses calls to _mcount().
echo -e "#include <linux/compiler.h>\nnotrace int func() { return 0; }" | \
- $* -m64 -S -x c -O2 -p -mprofile-kernel - -o - \
+ $* -m64 -mabi=elfv2 -S -x c -O2 -p -mprofile-kernel - -o - \
2> /dev/null | grep -q "_mcount" && \
exit 1
base-commit: 7b2f56d76feff3b494d6e77950ab97987323d3c5
prerequisite-patch-id: 502430fc318f92c1fe5f3b482ca8d798232b0516
prerequisite-patch-id: 3862cf6dc646260228e50b70c316cf15b1d7f384
prerequisite-patch-id: 859f60071f4e425c806fc7fe6c59e268232050a4
prerequisite-patch-id: ef23f712e50f106d689a550dae0f816285c1db3b
prerequisite-patch-id: 8c6d31bb6ac4e4bef086fe502efa660ae99a96ca
--
2.40.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh
2023-05-30 9:38 [PATCH] powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh Naveen N Rao
@ 2023-10-27 9:59 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2023-10-27 9:59 UTC (permalink / raw)
To: Naveen N Rao; +Cc: linuxppc-dev, Nicholas Piggin
On Tue, 30 May 2023 15:08:21 +0530, Naveen N Rao wrote:
> Toolchains don't always default to the ELFv2 ABI. This is true with at
> least the kernel.org toolchains. As such, pass -mabi=elfv2 explicitly to
> ensure that we are testing against the correct compiler output.
>
>
Applied to powerpc/next.
[1/1] powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh
https://git.kernel.org/powerpc/c/d42f55e8ae741540d0d2ebab8ff02f68fb0c802f
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-10-27 10:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-30 9:38 [PATCH] powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh Naveen N Rao
2023-10-27 9:59 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).