Skip to contentSkip to conversation

ndctl: fix ndctl linking with libkeyutils

PATCH In review Vishal Verma 2 participants 2 messages Feb 5, 2019 libnvdimm: non-volatile memory device

lore
Share & tools
lore

Vishal Verma

author maintainer
#0 lore raw

PATCH 1/1 ndctl: fix ndctl linking with libkeyutils

From: Piotr Balcer <[email protected]>

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.

Cc Dave Jiang <[email protected]>
Fixes 86b078b44275 ("ndctl: add passphrase management commands")
---
 ndctl/Makefile.am     | 4 ++++
 ndctl/lib/Makefile.am | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)
ndctl/Makefile.am +4 -0
index 3287dbb..502271e 100644
@@ -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 \
ndctl/lib/Makefile.am +0 -4
index 99eaae0..7797039 100644
@@ -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) \
Signature · 6 lines
2.20.1

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Vishal Verma

From: Piotr Balcer <[email protected]>

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

Quoted 7 lines

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

Cc Dave Jiang <[email protected]>
Fixes 86b078b44275 ("ndctl: add passphrase management commands")

Ah yeah it used to be in libndctl, but in the last round of changes it was moved to ndctl/utils.

Quoted 26 lines
---
 ndctl/Makefile.am     | 4 ++++
 ndctl/lib/Makefile.am | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)
ndctl/Makefile.am +4 -0
index 3287dbb..502271e 100644
@@ -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 \
ndctl/lib/Makefile.am +0 -0
index 99eaae0..7797039 100644

ndctl/lib/Makefile.am libndctl_la_LIBADD =\ · line 35

Quoted 10 lines
ndctl/lib/Makefile.am +0 -4
@@ -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) \

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm