* [fsverity-utils PATCH] Makefile check: use LD_LIBRARY_PATH with USE_SHARED_LIB
@ 2020-10-20 17:11 luca.boccassi
2020-10-21 18:46 ` Eric Biggers
0 siblings, 1 reply; 2+ messages in thread
From: luca.boccassi @ 2020-10-20 17:11 UTC (permalink / raw)
To: linux-fscrypt
From: Luca Boccassi <luca.boccassi@microsoft.com>
When USE_SHARED_LIB is set, the fsverity binary is dynamically linked,
so the check rule fails. Set LD_LIBRARY_PATH to the working directory.
Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
---
Makefile | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index deffe8b..5edb54b 100644
--- a/Makefile
+++ b/Makefile
@@ -71,6 +71,14 @@ DEFAULT_TARGETS :=
COMMON_HEADERS := $(wildcard common/*.h)
LDLIBS := -lcrypto
+# If we are dynamically linking, when running tests we need to override
+# LD_LIBRARY_PATH as no RPATH is set
+ifdef USE_SHARED_LIB
+RUN_FSVERITY = LD_LIBRARY_PATH=./ ./fsverity
+else
+RUN_FSVERITY = ./fsverity
+endif
+
##############################################################################
#### Library
@@ -166,11 +174,11 @@ check:fsverity test_programs
for prog in $(TEST_PROGRAMS); do \
$(TEST_WRAPPER_PROG) ./$$prog || exit 1; \
done
- ./fsverity --help > /dev/null
- ./fsverity --version > /dev/null
- ./fsverity sign fsverity fsverity.sig \
+ $(RUN_FSVERITY) --help > /dev/null
+ $(RUN_FSVERITY) --version > /dev/null
+ $(RUN_FSVERITY) sign fsverity fsverity.sig \
--key=testdata/key.pem --cert=testdata/cert.pem > /dev/null
- ./fsverity sign fsverity fsverity.sig --hash=sha512 --block-size=512 \
+ $(RUN_FSVERITY) sign fsverity fsverity.sig --hash=sha512 --block-size=512 \
--salt=12345678 \
--key=testdata/key.pem --cert=testdata/cert.pem > /dev/null
rm -f fsverity.sig
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [fsverity-utils PATCH] Makefile check: use LD_LIBRARY_PATH with USE_SHARED_LIB
2020-10-20 17:11 [fsverity-utils PATCH] Makefile check: use LD_LIBRARY_PATH with USE_SHARED_LIB luca.boccassi
@ 2020-10-21 18:46 ` Eric Biggers
0 siblings, 0 replies; 2+ messages in thread
From: Eric Biggers @ 2020-10-21 18:46 UTC (permalink / raw)
To: luca.boccassi; +Cc: linux-fscrypt
On Tue, Oct 20, 2020 at 06:11:10PM +0100, luca.boccassi@gmail.com wrote:
> From: Luca Boccassi <luca.boccassi@microsoft.com>
>
> When USE_SHARED_LIB is set, the fsverity binary is dynamically linked,
> so the check rule fails. Set LD_LIBRARY_PATH to the working directory.
>
> Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
Applied, thanks.
- Eric
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-21 18:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 17:11 [fsverity-utils PATCH] Makefile check: use LD_LIBRARY_PATH with USE_SHARED_LIB luca.boccassi
2020-10-21 18:46 ` Eric Biggers
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.