From: Alexander Aring <aahringo@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH dlm/tool 1/2] treewide: try to resolve symbols at linking time
Date: Tue, 7 Sep 2021 12:21:48 -0400 [thread overview]
Message-ID: <20210907162149.1442293-1-aahringo@redhat.com> (raw)
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
next reply other threads:[~2021-09-07 16:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-07 16:21 Alexander Aring [this message]
2021-09-07 16:21 ` [Cluster-devel] [PATCH dlm/tool 2/2] dlm_controld: add version check for libquorum Alexander Aring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210907162149.1442293-1-aahringo@redhat.com \
--to=aahringo@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).