Makefile check: use LD_LIBRARY_PATH with USE_SHARED_LIB
Subsystems (2)
PATCH 1/1 Makefile check: use LD_LIBRARY_PATH with USE_SHARED_LIB
From: Luca Boccassi <[email protected]>
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 <[email protected]>
--- Makefile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
Makefile +12 -4
@@ -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
Signature · 1 line
2.20.1
Quoted 6 lines · On Tue, Oct 20, 2020 at 06:11:10PM +0100, [email protected] wrote:
From: Luca Boccassi <[email protected]>
When
USE_SHARED_LIBis set, the fsverity binary is dynamically linked, so the check rule fails. SetLD_LIBRARY_PATHto the working directory.Signed-off-by Luca Boccassi <[email protected]>
Applied, thanks.
- Eric