diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2020-02-20 22:37:48 +1100 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2020-02-20 08:57:12 -0700 |
commit | ef89d0545132d685f73da6f58b7e7fe002536f91 (patch) | |
tree | 91d710cac7e3841c1db16ec7ec7ccb367a7678f7 /tools | |
parent | b9167c8078c3527de6da241c8a1a75a9224ed90a (diff) | |
download | linux-ef89d0545132d685f73da6f58b7e7fe002536f91.tar.gz linux-ef89d0545132d685f73da6f58b7e7fe002536f91.tar.bz2 linux-ef89d0545132d685f73da6f58b7e7fe002536f91.zip |
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/rseq/Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/rseq/Makefile b/tools/testing/selftests/rseq/Makefile index f1053630bb6f..2af9d39a9716 100644 --- a/tools/testing/selftests/rseq/Makefile +++ b/tools/testing/selftests/rseq/Makefile @@ -4,7 +4,7 @@ ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),) CLANG_FLAGS += -no-integrated-as endif -CFLAGS += -O2 -Wall -g -I./ -I../../../../usr/include/ -L./ -Wl,-rpath=./ \ +CFLAGS += -O2 -Wall -g -I./ -I../../../../usr/include/ -L$(OUTPUT) -Wl,-rpath=./ \ $(CLANG_FLAGS) LDLIBS += -lpthread |