]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/rseq: Fix out-of-tree compilation
authorMichael Ellerman <mpe@ellerman.id.au>
Thu, 20 Feb 2020 11:37:48 +0000 (22:37 +1100)
committerShuah Khan <skhan@linuxfoundation.org>
Thu, 20 Feb 2020 15:57:12 +0000 (08:57 -0700)
commitf1f639ca8d5139d21e5b0d0ab1ea70c5cab294b5
tree91d710cac7e3841c1db16ec7ec7ccb367a7678f7
parente0001dbc4bedc1f9184d734cc1a6c7538f70c6cc
selftests/rseq: Fix out-of-tree compilation

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).

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/rseq/Makefile