change makefile flags

This commit is contained in:
David Teigland 2018-03-14 11:55:23 -05:00
parent e8d9439ff1
commit e6c322124b
2 changed files with 91 additions and 3 deletions

View File

@ -0,0 +1,85 @@
From cf1a6ed9116187305b4592b1b2d7c5e246dac301 Mon Sep 17 00:00:00 2001
From: David Teigland <teigland@redhat.com>
Date: Wed, 14 Mar 2018 11:49:35 -0500
Subject: [PATCH] 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 1ef6852aedf7..1d03784edf1e 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -99,24 +99,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

View File

@ -6,7 +6,7 @@
Name: sanlock
Version: 3.6.0
Release: 3%{?dist}
Release: 4%{?dist}
Summary: A shared storage lock manager
Group: System Environment/Base
@ -27,14 +27,14 @@ Requires(postun): systemd-units
%endif
Source0: https://releases.pagure.org/sanlock/%{name}-%{version}.tar.gz
# Patch0: 0001-foo.patch
Patch0: 0001-fix-makefile-flags.patch
%description
The sanlock daemon manages leases for applications on hosts using shared storage.
%prep
%setup -q
# %patch0 -p1 -b .0001-foo.patch
%patch0 -p1 -b .0001-fix-makefile-flags.patch
%build
%set_build_flags
@ -219,6 +219,9 @@ common sanlock lockspace.
%changelog
* Wed Mar 14 2018 David Teigland <teigland@redhat.com> - 3.6.0-4
- change makefile flags
* Wed Mar 14 2018 David Teigland <teigland@redhat.com> - 3.6.0-3
- rebuild with set_build_flags