All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] selftests/powerpc/ptrace: Fix out-of-tree build
@ 2018-10-29 11:23 Michael Ellerman
  2018-10-29 11:23 ` [PATCH 2/5] selftests/powerpc/signal: " Michael Ellerman
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Michael Ellerman @ 2018-10-29 11:23 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: joel

From: Joel Stanley <joel@jms.id.au>

We should use TEST_GEN_PROGS, not TEST_PROGS. That tells the selftests
makefile (lib.mk) that those tests are generated (built), and so it
adds the $(OUTPUT) prefix for us, making the out-of-tree build work
correctly.

It also means we don't need our own clean rule, lib.mk does it.

We also have to update the ptrace-pkey and core-pkey rules to use
$(OUTPUT).

Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 tools/testing/selftests/powerpc/ptrace/Makefile | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/tools/testing/selftests/powerpc/ptrace/Makefile b/tools/testing/selftests/powerpc/ptrace/Makefile
index 9b35ca8e8f13..8d3f006c98cc 100644
--- a/tools/testing/selftests/powerpc/ptrace/Makefile
+++ b/tools/testing/selftests/powerpc/ptrace/Makefile
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
-TEST_PROGS := ptrace-gpr ptrace-tm-gpr ptrace-tm-spd-gpr \
+TEST_GEN_PROGS := ptrace-gpr ptrace-tm-gpr ptrace-tm-spd-gpr \
               ptrace-tar ptrace-tm-tar ptrace-tm-spd-tar ptrace-vsx ptrace-tm-vsx \
               ptrace-tm-spd-vsx ptrace-tm-spr ptrace-hwbreak ptrace-pkey core-pkey \
               perf-hwbreak ptrace-syscall
@@ -7,14 +7,9 @@ TEST_PROGS := ptrace-gpr ptrace-tm-gpr ptrace-tm-spd-gpr \
 top_srcdir = ../../../../..
 include ../../lib.mk
 
-all: $(TEST_PROGS)
-
 CFLAGS += -m64 -I../../../../../usr/include -I../tm -mhtm -fno-pie
 
-ptrace-pkey core-pkey: child.h
-ptrace-pkey core-pkey: LDLIBS += -pthread
-
-$(TEST_PROGS): ../harness.c ../utils.c ../lib/reg.S ptrace.h
+$(OUTPUT)/ptrace-pkey $(OUTPUT)/core-pkey: child.h
+$(OUTPUT)/ptrace-pkey $(OUTPUT)/core-pkey: LDLIBS += -pthread
 
-clean:
-	rm -f $(TEST_PROGS) *.o
+$(TEST_GEN_PROGS): ../harness.c ../utils.c ../lib/reg.S ptrace.h
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/5] selftests/powerpc/signal: Fix out-of-tree build
  2018-10-29 11:23 [PATCH 1/5] selftests/powerpc/ptrace: Fix out-of-tree build Michael Ellerman
@ 2018-10-29 11:23 ` Michael Ellerman
  2018-10-29 11:23 ` [PATCH 3/5] selftests/powerpc/pmu: Link ebb tests with -no-pie Michael Ellerman
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2018-10-29 11:23 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: joel

From: Joel Stanley <joel@jms.id.au>

We should use TEST_GEN_PROGS, not TEST_PROGS. That tells the selftests
makefile (lib.mk) that those tests are generated (built), and so it
adds the $(OUTPUT) prefix for us, making the out-of-tree build work
correctly.

It also means we don't need our own clean rule, lib.mk does it.

We also have to update the signal_tm rule to use $(OUTPUT).

Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 tools/testing/selftests/powerpc/signal/Makefile | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/powerpc/signal/Makefile b/tools/testing/selftests/powerpc/signal/Makefile
index 1fca25c6ace0..209a958dca12 100644
--- a/tools/testing/selftests/powerpc/signal/Makefile
+++ b/tools/testing/selftests/powerpc/signal/Makefile
@@ -1,15 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0
-TEST_PROGS := signal signal_tm
-
-all: $(TEST_PROGS)
-
-$(TEST_PROGS): ../harness.c ../utils.c signal.S
+TEST_GEN_PROGS := signal signal_tm
 
 CFLAGS += -maltivec
-signal_tm: CFLAGS += -mhtm
+$(OUTPUT)/signal_tm: CFLAGS += -mhtm
 
 top_srcdir = ../../../../..
 include ../../lib.mk
 
-clean:
-	rm -f $(TEST_PROGS) *.o
+$(TEST_GEN_PROGS): ../harness.c ../utils.c signal.S
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/5] selftests/powerpc/pmu: Link ebb tests with -no-pie
  2018-10-29 11:23 [PATCH 1/5] selftests/powerpc/ptrace: Fix out-of-tree build Michael Ellerman
  2018-10-29 11:23 ` [PATCH 2/5] selftests/powerpc/signal: " Michael Ellerman
@ 2018-10-29 11:23 ` Michael Ellerman
  2018-10-29 11:23 ` [PATCH 4/5] selftests/powerpc/switch_endian: Fix out-of-tree build Michael Ellerman
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2018-10-29 11:23 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: joel

From: Joel Stanley <joel@jms.id.au>

When running the ebb tests after building on a ppc64le Ubuntu machine:

 $ pmu/ebb/reg_access_test: error while loading shared libraries:
 R_PPC64_ADDR16_HI reloc at 0x000000013a965130 for symbol `' out of
 range

This is because the Ubuntu toolchain builds has PIE enabled by default.
Change it to be always off instead.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 tools/testing/selftests/powerpc/pmu/ebb/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/testing/selftests/powerpc/pmu/ebb/Makefile b/tools/testing/selftests/powerpc/pmu/ebb/Makefile
index bd5dfa509272..23f4caf48ffc 100644
--- a/tools/testing/selftests/powerpc/pmu/ebb/Makefile
+++ b/tools/testing/selftests/powerpc/pmu/ebb/Makefile
@@ -5,6 +5,9 @@ noarg:
 # 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
+
 TEST_GEN_PROGS := reg_access_test event_attributes_test cycles_test	\
 	 cycles_with_freeze_test pmc56_overflow_test		\
 	 ebb_vs_cpu_event_test cpu_event_vs_ebb_test		\
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/5] selftests/powerpc/switch_endian: Fix out-of-tree build
  2018-10-29 11:23 [PATCH 1/5] selftests/powerpc/ptrace: Fix out-of-tree build Michael Ellerman
  2018-10-29 11:23 ` [PATCH 2/5] selftests/powerpc/signal: " Michael Ellerman
  2018-10-29 11:23 ` [PATCH 3/5] selftests/powerpc/pmu: Link ebb tests with -no-pie Michael Ellerman
@ 2018-10-29 11:23 ` Michael Ellerman
  2018-10-29 11:23 ` [PATCH 5/5] selftests/powerpc/cache_shape: " Michael Ellerman
  2018-11-01 12:46 ` [1/5] selftests/powerpc/ptrace: " Michael Ellerman
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2018-10-29 11:23 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: joel

For the out-of-tree build to work we need to tell switch_endian_test
to look for check-reversed.S in $(OUTPUT).

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 tools/testing/selftests/powerpc/switch_endian/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/powerpc/switch_endian/Makefile b/tools/testing/selftests/powerpc/switch_endian/Makefile
index fcd2dcb8972b..bdc081afedb0 100644
--- a/tools/testing/selftests/powerpc/switch_endian/Makefile
+++ b/tools/testing/selftests/powerpc/switch_endian/Makefile
@@ -8,6 +8,7 @@ EXTRA_CLEAN = $(OUTPUT)/*.o $(OUTPUT)/check-reversed.S
 top_srcdir = ../../../../..
 include ../../lib.mk
 
+$(OUTPUT)/switch_endian_test: ASFLAGS += -I $(OUTPUT)
 $(OUTPUT)/switch_endian_test: $(OUTPUT)/check-reversed.S
 
 $(OUTPUT)/check-reversed.o: $(OUTPUT)/check.o
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 5/5] selftests/powerpc/cache_shape: Fix out-of-tree build
  2018-10-29 11:23 [PATCH 1/5] selftests/powerpc/ptrace: Fix out-of-tree build Michael Ellerman
                   ` (2 preceding siblings ...)
  2018-10-29 11:23 ` [PATCH 4/5] selftests/powerpc/switch_endian: Fix out-of-tree build Michael Ellerman
@ 2018-10-29 11:23 ` Michael Ellerman
  2018-11-01 12:46 ` [1/5] selftests/powerpc/ptrace: " Michael Ellerman
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2018-10-29 11:23 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: joel

Use TEST_GEN_PROGS and don't redefine all, this makes the out-of-tree
build work. We need to move the extra dependencies below the include
of lib.mk, because it adds the $(OUTPUT) prefix if it's defined.

We can also drop the clean rule, lib.mk does it for us.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 tools/testing/selftests/powerpc/cache_shape/Makefile | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/tools/testing/selftests/powerpc/cache_shape/Makefile b/tools/testing/selftests/powerpc/cache_shape/Makefile
index ede4d3dae750..689f6c8ebcd8 100644
--- a/tools/testing/selftests/powerpc/cache_shape/Makefile
+++ b/tools/testing/selftests/powerpc/cache_shape/Makefile
@@ -1,12 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
-TEST_PROGS := cache_shape
-
-all: $(TEST_PROGS)
-
-$(TEST_PROGS): ../harness.c ../utils.c
+TEST_GEN_PROGS := cache_shape
 
 top_srcdir = ../../../../..
 include ../../lib.mk
 
-clean:
-	rm -f $(TEST_PROGS) *.o
+$(TEST_GEN_PROGS): ../harness.c ../utils.c
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [1/5] selftests/powerpc/ptrace: Fix out-of-tree build
  2018-10-29 11:23 [PATCH 1/5] selftests/powerpc/ptrace: Fix out-of-tree build Michael Ellerman
                   ` (3 preceding siblings ...)
  2018-10-29 11:23 ` [PATCH 5/5] selftests/powerpc/cache_shape: " Michael Ellerman
@ 2018-11-01 12:46 ` Michael Ellerman
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2018-11-01 12:46 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: joel

On Mon, 2018-10-29 at 11:23:49 UTC, Michael Ellerman wrote:
> From: Joel Stanley <joel@jms.id.au>
> 
> We should use TEST_GEN_PROGS, not TEST_PROGS. That tells the selftests
> makefile (lib.mk) that those tests are generated (built), and so it
> adds the $(OUTPUT) prefix for us, making the out-of-tree build work
> correctly.
> 
> It also means we don't need our own clean rule, lib.mk does it.
> 
> We also have to update the ptrace-pkey and core-pkey rules to use
> $(OUTPUT).
> 
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Series applied to powerpc next.

https://git.kernel.org/powerpc/c/c39b79082a38a4f8c801790edecbbb

cheers

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-11-01 12:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-29 11:23 [PATCH 1/5] selftests/powerpc/ptrace: Fix out-of-tree build Michael Ellerman
2018-10-29 11:23 ` [PATCH 2/5] selftests/powerpc/signal: " Michael Ellerman
2018-10-29 11:23 ` [PATCH 3/5] selftests/powerpc/pmu: Link ebb tests with -no-pie Michael Ellerman
2018-10-29 11:23 ` [PATCH 4/5] selftests/powerpc/switch_endian: Fix out-of-tree build Michael Ellerman
2018-10-29 11:23 ` [PATCH 5/5] selftests/powerpc/cache_shape: " Michael Ellerman
2018-11-01 12:46 ` [1/5] selftests/powerpc/ptrace: " Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.