btrfs-progs: preload libbtrfs for libbtrfs-test
The libbtrfs-test simulated build happens outside of the source repository, but sometimes the system library is used instead of the repo one. When -rpath does not work, force the correct library by LD_PRELOAD. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
c15c559f54
commit
075f147cef
3
Makefile
3
Makefile
|
@ -624,9 +624,10 @@ library-test: library-test.c libbtrfs.so
|
|||
@echo " [TEST PREP] $@"$(eval TMPD=$(shell mktemp -d))
|
||||
$(Q)mkdir -p $(TMPD)/include/btrfs && \
|
||||
cp $(libbtrfs_headers) $(TMPD)/include/btrfs && \
|
||||
cp libbtrfs.so.0.1 $(TMPD) && \
|
||||
cd $(TMPD) && $(CC) -I$(TMPD)/include -o $@ $(addprefix $(ABSTOPDIR)/,$^) -Wl,-rpath=$(ABSTOPDIR) -lbtrfs
|
||||
@echo " [TEST RUN] $@"
|
||||
$(Q)cd $(TMPD) && ./$@
|
||||
$(Q)cd $(TMPD) && LD_PRELOAD=libbtrfs.so.0.1 ./$@
|
||||
@echo " [TEST CLEAN] $@"
|
||||
$(Q)$(RM) -rf -- $(TMPD)
|
||||
|
||||
|
|
Loading…
Reference in New Issue