Skip to content

Commit d42f55e

Browse files
rnavmpe
authored andcommitted
powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh
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 <[email protected]> [mpe: Tweak comment wording] Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent 269d79f commit d42f55e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

arch/powerpc/tools/gcc-check-mprofile-kernel.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,20 @@ set -o pipefail
77
# To debug, uncomment the following line
88
# set -x
99

10-
# -mprofile-kernel is only supported on 64-bit, so this should not be invoked
11-
# for 32-bit. We pass in -m64 explicitly, and -mbig-endian and -mlittle-endian
12-
# are passed in from Kconfig, which takes care of toolchains defaulting to
13-
# other targets.
10+
# -mprofile-kernel is only supported on 64-bit with ELFv2, so this should not
11+
# be invoked for other targets. Therefore we can pass in -m64 and -mabi
12+
# explicitly, to take care of toolchains defaulting to other targets.
1413

1514
# Test whether the compile option -mprofile-kernel exists and generates
1615
# profiling code (ie. a call to _mcount()).
1716
echo "int func() { return 0; }" | \
18-
$* -m64 -S -x c -O2 -p -mprofile-kernel - -o - \
17+
$* -m64 -mabi=elfv2 -S -x c -O2 -p -mprofile-kernel - -o - \
1918
2> /dev/null | grep -q "_mcount"
2019

2120
# Test whether the notrace attribute correctly suppresses calls to _mcount().
2221

2322
echo -e "#include <linux/compiler.h>\nnotrace int func() { return 0; }" | \
24-
$* -m64 -S -x c -O2 -p -mprofile-kernel - -o - \
23+
$* -m64 -mabi=elfv2 -S -x c -O2 -p -mprofile-kernel - -o - \
2524
2> /dev/null | grep -q "_mcount" && \
2625
exit 1
2726

0 commit comments

Comments
 (0)