sanlock/0002-fix-makefile-flags.patch
2018-03-14 12:10:10 -05:00

86 lines
3.0 KiB
Diff

From fa6d48a7c8991b2251e50469a7e57058be226ab0 Mon Sep 17 00:00:00 2001
From: David Teigland <teigland@redhat.com>
Date: Wed, 14 Mar 2018 11:49:35 -0500
Subject: [PATCH 2/2] fix makefile flags
should let the fedora build flags work
---
reset/Makefile | 2 +-
src/Makefile | 15 +++++++--------
wdmd/Makefile | 8 ++++----
3 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/reset/Makefile b/reset/Makefile
index c61348a2b9c3..04a23032614a 100644
--- a/reset/Makefile
+++ b/reset/Makefile
@@ -34,7 +34,7 @@ VER=$(shell cat ../VERSION)
CFLAGS += -DVERSION=\"$(VER)\" -I../src -I../wdmd
CFLAGS += -fPIE -DPIE
-LDFLAGS = -Wl,-z,now -Wl,-z,relro -pie
+LDFLAGS += -Wl,-z,now -Wl,-z,relro
LDADD = -lsanlock -lwdmd
all: $(TARGET1) $(TARGET2)
diff --git a/src/Makefile b/src/Makefile
index 73a2b3498475..14c0a53e6aeb 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -94,24 +94,23 @@ VER=$(shell cat ../VERSION)
CFLAGS += -DVERSION=\"$(VER)\"
CMD_CFLAGS = $(CFLAGS) -fPIE -DPIE
+CMD_LDFLAGS = $(LDFLAGS) -Wl,-z,now -Wl,-z,relro
+CMD_LDADD = -lpthread -luuid -lrt -laio -lblkid -lsanlock -L../wdmd -lwdmd
-CMD_LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
-CMD_LDADD += -lpthread -luuid -lrt -laio -lblkid -lsanlock -L../wdmd -lwdmd
+LIB_ENTIRE_LDFLAGS = $(LDFLAGS) -Wl,-z,relro
+LIB_ENTIRE_LDADD = -lpthread -lrt -laio -lblkid -L../wdmd -lwdmd
-LIB_ENTIRE_LDFLAGS += -Wl,-z,relro -pie
-LIB_ENTIRE_LDADD += -lpthread -lrt -laio -lblkid -L../wdmd -lwdmd
-
-LIB_CLIENT_LDFLAGS += -Wl,-z,relro -pie
+LIB_CLIENT_LDFLAGS = $(LDFLAGS) -Wl,-z,relro
all: $(LIBSO_ENTIRE_TARGET) $(LIBSO_CLIENT_TARGET) $(CMD_TARGET) $(LIBPC_ENTIRE_TARGET) $(LIBPC_CLIENT_TARGET)
$(LIBSO_ENTIRE_TARGET): $(LIB_ENTIRE_SOURCE)
- $(CC) $(CFLAGS) $(LIB_ENTIRE_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_ENTIRE_TARGET).so.$(SOMAJOR) $^ $(LIB_ENTIRE_LDADD)
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LIB_ENTIRE_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_ENTIRE_TARGET).so.$(SOMAJOR) $^ $(LIB_ENTIRE_LDADD)
ln -sf $(LIBSO_ENTIRE_TARGET) $(LIB_ENTIRE_TARGET).so
ln -sf $(LIBSO_ENTIRE_TARGET) $(LIB_ENTIRE_TARGET).so.$(SOMAJOR)
$(LIBSO_CLIENT_TARGET): $(LIB_CLIENT_SOURCE)
- $(CC) $(CFLAGS) $(LIB_CLIENT_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_CLIENT_TARGET).so.$(SOMAJOR) $^
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LIB_CLIENT_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_CLIENT_TARGET).so.$(SOMAJOR) $^
ln -sf $(LIBSO_CLIENT_TARGET) $(LIB_CLIENT_TARGET).so
ln -sf $(LIBSO_CLIENT_TARGET) $(LIB_CLIENT_TARGET).so.$(SOMAJOR)
diff --git a/wdmd/Makefile b/wdmd/Makefile
index bf871c591943..0c4438950d6e 100644
--- a/wdmd/Makefile
+++ b/wdmd/Makefile
@@ -45,12 +45,12 @@ CFLAGS += -D_GNU_SOURCE -g -O2 \
VER=$(shell cat ../VERSION)
CFLAGS += -DVERSION=\"$(VER)\"
-CMD_LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
-CMD_LDADD += -lwdmd -lrt
+CMD_LDFLAGS = $(LDFLAGS) -Wl,-z,now -Wl,-z,relro
+CMD_LDADD = -lwdmd -lrt
-LIB_LDFLAGS += -Wl,-z,relro -pie
+LIB_LDFLAGS = $(LDFLAGS) -Wl,-z,relro
-TEST_LDFLAGS = -lwdmd
+TEST_LDFLAGS = $(LDFLAGS) -lwdmd
all: $(SHLIB_TARGET) $(CMD_TARGET) $(TEST_TARGET)
--
2.7.5