Skip to contentSkip to conversation

tools/xenstore: fix linking libxenstore with ldl

PATCH In review Juergen Gross 3 participants 3 messages Mar 23, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/xenstore: fix linking libxenstore with ldl

Commit 448c03b3cbe1487 ("tools/xenstore: try to get minimum thread stack size for watch thread") added a dependency to libdl to libxenstore. Unfortunately the way it was added requires now all users of libxenstore to specify "-ldl" when linking. This can be avoided by linking libxenstore.so specifying "-ldl" as a trailing option. So use APPEND_LDFLAGS instead of LDFLAGS for adding the "-ldl" option when linking libxenstore.so.

---
 tools/xenstore/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/xenstore/Makefile +1 -1
index 69e55e73e5..445e9911b2 100644
@@ -104,7 +104,7 @@ libxenstore.so.$(MAJOR): libxenstore.so.$(MAJOR).$(MINOR)
 xs.opic: CFLAGS += -DUSE_PTHREAD
 ifeq ($(CONFIG_Linux),y)
 xs.opic: CFLAGS += -DUSE_DLSYM
-libxenstore.so.$(MAJOR).$(MINOR): LDFLAGS += -ldl
+libxenstore.so.$(MAJOR).$(MINOR): APPEND_LDFLAGS += -ldl
 else
 PKG_CONFIG_REMOVE += -ldl
 endif
Signature · 7 lines
2.13.6


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 9 lines · Juergen Gross

Commit 448c03b3cbe1487 ("tools/xenstore: try to get minimum thread stack size for watch thread") added a dependency to libdl to libxenstore. Unfortunately the way it was added requires now all users of libxenstore to specify "-ldl" when linking. This can be avoided by linking libxenstore.so specifying "-ldl" as a trailing option. So use APPEND_LDFLAGS instead of LDFLAGS for adding the "-ldl" option when linking libxenstore.so.

Signature · 6 lines
Doug Goldstein

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v1 1/1
#2 lore raw
In reply to Juergen Gross
Quoted 9 lines · Juergen Gross

Commit 448c03b3cbe1487 ("tools/xenstore: try to get minimum thread stack size for watch thread") added a dependency to libdl to libxenstore. Unfortunately the way it was added requires now all users of libxenstore to specify "-ldl" when linking. This can be avoided by linking libxenstore.so specifying "-ldl" as a trailing option. So use APPEND_LDFLAGS instead of LDFLAGS for adding the "-ldl" option when linking libxenstore.so.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel