Re: [PATCH] selftests/rseq: Fix out-of-tree compilation
From: Shuah Khan
Date:  Thu Feb 20 2020 - 11:17:54 EST
On 2/20/20 9:16 AM, Mathieu Desnoyers wrote:
----- On Feb 20, 2020, at 6:37 AM, Michael Ellerman mpe@xxxxxxxxxxxxxx wrote:
Currently if you build with O=... the rseq tests don't build:
  $ make O=$PWD/output -C tools/testing/selftests/ TARGETS=rseq
  make: Entering directory '/linux/tools/testing/selftests'
  ...
  make[1]: Entering directory '/linux/tools/testing/selftests/rseq'
  gcc -O2 -Wall -g -I./ -I../../../../usr/include/ -L./ -Wl,-rpath=./  -shared
  -fPIC rseq.c -lpthread -o /linux/output/rseq/librseq.so
  gcc -O2 -Wall -g -I./ -I../../../../usr/include/ -L./ -Wl,-rpath=./
  basic_test.c -lpthread -lrseq -o /linux/output/rseq/basic_test
  /usr/bin/ld: cannot find -lrseq
  collect2: error: ld returned 1 exit status
This is because the library search path points to the source
directory, not the output.
We can fix it by changing the library search path to $(OUTPUT).
Good catch!
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
Shuah, can you pick this up please ?
I applied it to linux-kselftest fixes just a little while ago.
I will send this in for rc4.
thanks,
-- Shuah