diff mbox series

powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh

Message ID 20230530093821.298590-1-naveen@kernel.org (mailing list archive)
State Accepted
Commit d42f55e8ae741540d0d2ebab8ff02f68fb0c802f
Headers show
Series powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh | expand

Commit Message

Naveen N Rao May 30, 2023, 9:38 a.m. UTC
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(-)


base-commit: 7b2f56d76feff3b494d6e77950ab97987323d3c5
prerequisite-patch-id: 502430fc318f92c1fe5f3b482ca8d798232b0516
prerequisite-patch-id: 3862cf6dc646260228e50b70c316cf15b1d7f384
prerequisite-patch-id: 859f60071f4e425c806fc7fe6c59e268232050a4
prerequisite-patch-id: ef23f712e50f106d689a550dae0f816285c1db3b
prerequisite-patch-id: 8c6d31bb6ac4e4bef086fe502efa660ae99a96ca

Comments

Michael Ellerman Oct. 27, 2023, 9:59 a.m. UTC | #1
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
diff mbox series

Patch

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