Skip to content

Commit

Permalink
selftests/powerpc: Handle Makefile for unrecognized option
Browse files Browse the repository at this point in the history
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: Harish <harish@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191113094219.14946-1-harish@linux.ibm.com
  • Loading branch information
Harish authored and Michael Ellerman committed Nov 14, 2019
1 parent 3df1911 commit 0695f8b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/testing/selftests/powerpc/pmu/ebb/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# SPDX-License-Identifier: GPL-2.0
include ../../../../../../scripts/Kbuild.include

noarg:
$(MAKE) -C ../../

# The EBB handler is 64-bit code and everything links against it
CFLAGS += -m64

# 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 \
cycles_with_freeze_test pmc56_overflow_test \
Expand Down

0 comments on commit 0695f8b

Please sign in to comment.