Skip to content

Commit

Permalink
ndctl: fix ndctl linking with libkeyutils
Browse files Browse the repository at this point in the history
Compilation on Ubuntu 18.04 fails with:

  /usr/bin/ld: util/keys.o: undefined reference to symbol 'keyctl_read_alloc@@KEYUTILS_0.3'
  /lib/x86_64-linux-gnu/libkeyutils.so.1: error adding symbols: DSO missing from command line

Seems like libkeyutils is incorrectly linked against libndctl,
where in reality it's the ndctl application that uses keyutils.

Fixes: 86b078b ("ndctl: add passphrase management commands")
Cc: Dave Jiang <[email protected]>
Signed-off-by: Piotr Balcer <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
Signed-off-by: Vishal Verma <[email protected]>
  • Loading branch information
pbalcer authored and stellarhopper committed Feb 5, 2019
1 parent 8ca46ad commit d1cc2b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ndctl/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ ndctl_LDADD =\
$(KMOD_LIBS) \
$(JSON_LIBS)

if ENABLE_KEYUTILS
ndctl_LDADD += -lkeyutils
endif

if ENABLE_TEST
ndctl_SOURCES += ../test/libndctl.c \
../test/dsm-fail.c \
Expand Down
4 changes: 0 additions & 4 deletions ndctl/lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ libndctl_la_LIBADD =\
$(UUID_LIBS) \
$(KMOD_LIBS)

if ENABLE_KEYUTILS
libndctl_la_LIBADD += -lkeyutils
endif

EXTRA_DIST += libndctl.sym

libndctl_la_LDFLAGS = $(AM_LDFLAGS) \
Expand Down

0 comments on commit d1cc2b6

Please sign in to comment.