cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH dlm/tool 1/2] treewide: try to resolve symbols at linking time
@ 2021-09-07 16:21 Alexander Aring
  2021-09-07 16:21 ` [Cluster-devel] [PATCH dlm/tool 2/2] dlm_controld: add version check for libquorum Alexander Aring
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Aring @ 2021-09-07 16:21 UTC (permalink / raw)
  To: cluster-devel.redhat.com

This patch passes linker flags to the linker that all symbols should be
resolved at linking time. If this is not possible the linker will fail
to link.
---
 dlm_controld/Makefile | 4 ++--
 dlm_tool/Makefile     | 2 +-
 fence/Makefile        | 2 +-
 libdlm/Makefile       | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlm_controld/Makefile b/dlm_controld/Makefile
index fbc8926c..66799807 100644
--- a/dlm_controld/Makefile
+++ b/dlm_controld/Makefile
@@ -49,9 +49,9 @@ BIN_CFLAGS += $(CFLAGS) -fPIE -DPIE
 BIN_CFLAGS += -I../include -I../libdlm
 LIB_CFLAGS += $(CFLAGS) -fPIC
 
-BIN_LDFLAGS += $(LDFLAGS) -Wl,-z,relro -pie
+BIN_LDFLAGS += $(LDFLAGS) -Wl,-z,relro -Wl,-z,defs -pie
 BIN_LDFLAGS += -lpthread -lrt -lcpg -lcmap -lcfg -lquorum -luuid
-LIB_LDFLAGS += $(LDFLAGS) -Wl,-z,relro -pie
+LIB_LDFLAGS += $(LDFLAGS) -Wl,-z,relro -Wl,-z,defs -pie
 
 PKG_CONFIG ?= pkg-config
 ifeq ($(USE_SD_NOTIFY),yes)
diff --git a/dlm_tool/Makefile b/dlm_tool/Makefile
index 80d77257..7b42638c 100644
--- a/dlm_tool/Makefile
+++ b/dlm_tool/Makefile
@@ -20,7 +20,7 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
 CFLAGS += -fPIE -DPIE
 CFLAGS += -I../include -I../libdlm -I../dlm_controld
 
-LDFLAGS += -Wl,-z,relro -pie
+LDFLAGS += -Wl,-z,relro -Wl,-z,defs -pie
 LDFLAGS += -L../libdlm -L../dlm_controld
 LDFLAGS += -lpthread -ldlm -ldlmcontrol
 
diff --git a/fence/Makefile b/fence/Makefile
index 1f6dd6b2..2b080468 100644
--- a/fence/Makefile
+++ b/fence/Makefile
@@ -22,7 +22,7 @@ CFLAGS += `xml2-config --cflags`
 CFLAGS += -I../include
 CFLAGS += $(shell pkg-config --cflags pacemaker-fencing)
 
-LDFLAGS += -Wl,-z,relro -pie
+LDFLAGS += -Wl,-z,relro -Wl,-z,defs -pie
 LDFLAGS += `xml2-config --libs`
 LDFLAGS += -ldl
 
diff --git a/libdlm/Makefile b/libdlm/Makefile
index ab327619..313c2a08 100644
--- a/libdlm/Makefile
+++ b/libdlm/Makefile
@@ -84,8 +84,8 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
 LIB_CFLAGS += $(CFLAGS) -D_REENTRANT
 LLT_CFLAGS += $(CFLAGS)
 
-LIB_LDFLAGS += $(LDFLAGS) -lpthread
-LLT_LDFLAGS += $(LDFLAGS)
+LIB_LDFLAGS += $(LDFLAGS) -lpthread -Wl,-z,defs
+LLT_LDFLAGS += $(LDFLAGS) -Wl,-z,defs
 
 all: $(LIB_TARGET) $(LLT_TARGET) $(LIB_PC) $(LLT_PC)
 
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Cluster-devel] [PATCH dlm/tool 2/2] dlm_controld: add version check for libquorum
  2021-09-07 16:21 [Cluster-devel] [PATCH dlm/tool 1/2] treewide: try to resolve symbols at linking time Alexander Aring
@ 2021-09-07 16:21 ` Alexander Aring
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Aring @ 2021-09-07 16:21 UTC (permalink / raw)
  To: cluster-devel.redhat.com

This patch adds a simple version check for libquorum. Since commit
2e893b98 ("dlm_controld: use new quorum api to detect missed failures")
dlm_controld uses functionality which is only available in libquorum
3.1.0 and upwards.
---
 dlm_controld/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlm_controld/Makefile b/dlm_controld/Makefile
index 66799807..8cfc97e6 100644
--- a/dlm_controld/Makefile
+++ b/dlm_controld/Makefile
@@ -60,6 +60,10 @@ ifeq ($(USE_SD_NOTIFY),yes)
 	BIN_LDFLAGS += $(shell $(PKG_CONFIG) --libs libsystemd)
 endif
 
+ifeq (, $(shell $(PKG_CONFIG) --libs "libquorum >= 3.1.0"))
+	 $(error "Requires libquorum at least version 3.1.0")
+endif
+
 all: $(LIB_TARGET) $(BIN_TARGET) $(LIB_PC)
 
 $(BIN_TARGET): $(BIN_SOURCE)
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-07 16:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-07 16:21 [Cluster-devel] [PATCH dlm/tool 1/2] treewide: try to resolve symbols at linking time Alexander Aring
2021-09-07 16:21 ` [Cluster-devel] [PATCH dlm/tool 2/2] dlm_controld: add version check for libquorum Alexander Aring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).