Commit 0695f8bc authored by Harish's avatar Harish Committed by Michael Ellerman

selftests/powerpc: Handle Makefile for unrecognized option

On older distributions like Sles12SP5 gcc does not recognize
-no-pie option making the powerpc selftests build to fail

Fixes the following:
gcc: error: unrecognized command line option ‘-no-pie’
Signed-off-by: default avatarHarish <harish@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191113094219.14946-1-harish@linux.ibm.com
parent 3df19111
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
include ../../../../../../scripts/Kbuild.include
noarg: noarg:
$(MAKE) -C ../../ $(MAKE) -C ../../
...@@ -6,7 +8,10 @@ noarg: ...@@ -6,7 +8,10 @@ noarg:
CFLAGS += -m64 CFLAGS += -m64
# Toolchains may build PIE by default which breaks the assembly # Toolchains may build PIE by default which breaks the assembly
LDFLAGS += -no-pie no-pie-option := $(call try-run, echo 'int main() { return 0; }' | \
$(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -no-pie -x c - -o "$$TMP", -no-pie)
LDFLAGS += $(no-pie-option)
TEST_GEN_PROGS := reg_access_test event_attributes_test cycles_test \ TEST_GEN_PROGS := reg_access_test event_attributes_test cycles_test \
cycles_with_freeze_test pmc56_overflow_test \ cycles_with_freeze_test pmc56_overflow_test \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment