Blame SOURCES/0013-RHBZ-883981-cleanup-rpmdiff-issues.patch

4728c8
---
4728c8
 Makefile.inc                       |    9 +++++----
4728c8
 kpartx/Makefile                    |    2 +-
4728c8
 libmpathpersist/Makefile           |    4 ++--
4728c8
 libmultipath/Makefile              |    1 +
4728c8
 libmultipath/checkers/Makefile     |    2 +-
4728c8
 libmultipath/prioritizers/Makefile |    2 +-
4728c8
 multipath/Makefile                 |    2 +-
4728c8
 multipathd/Makefile                |    5 +++--
4728c8
 8 files changed, 15 insertions(+), 12 deletions(-)
4728c8
4728c8
Index: multipath-tools-130222/Makefile.inc
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/Makefile.inc
4728c8
+++ multipath-tools-130222/Makefile.inc
4728c8
@@ -23,15 +23,15 @@ endif
4728c8
 
4728c8
 prefix      = 
4728c8
 exec_prefix = $(prefix)
4728c8
-bindir      = $(exec_prefix)/sbin
4728c8
+bindir      = $(exec_prefix)/usr/sbin
4728c8
 libudevdir  = ${prefix}/lib/udev
4728c8
 multipathdir = $(TOPDIR)/libmultipath
4728c8
 mandir      = $(prefix)/usr/share/man/man8
4728c8
 man5dir     = $(prefix)/usr/share/man/man5
4728c8
 man3dir      = $(prefix)/usr/share/man/man3
4728c8
 rcdir	    = $(prefix)/etc/rc.d/init.d
4728c8
-syslibdir   = $(prefix)/$(LIB)
4728c8
-libdir	    = $(prefix)/$(LIB)/multipath
4728c8
+syslibdir   = $(prefix)/usr/$(LIB)
4728c8
+libdir	    = $(prefix)/usr/$(LIB)/multipath
4728c8
 unitdir     = $(prefix)/lib/systemd/system
4728c8
 mpathpersistdir = $(TOPDIR)/libmpathpersist
4728c8
 
4728c8
@@ -42,8 +42,9 @@ ifndef RPM_OPT_FLAGS
4728c8
 	RPM_OPT_FLAGS = -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4
4728c8
 endif
4728c8
 
4728c8
+LDFLAGS     += -Wl,-z,relro
4728c8
 OPTFLAGS     = $(RPM_OPT_FLAGS) -Wunused -Wstrict-prototypes
4728c8
-CFLAGS	     = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\"
4728c8
+CFLAGS	     = $(OPTFLAGS) -DLIB_STRING=\"${LIB}\"
4728c8
 SHARED_FLAGS = -shared
4728c8
 
4728c8
 %.o:	%.c
4728c8
Index: multipath-tools-130222/multipathd/Makefile
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/multipathd/Makefile
4728c8
+++ multipath-tools-130222/multipathd/Makefile
4728c8
@@ -5,9 +5,10 @@ include ../Makefile.inc
4728c8
 #
4728c8
 # basic flags setting
4728c8
 #
4728c8
-CFLAGS += -I$(multipathdir) -I$(mpathpersistdir)
4728c8
+CFLAGS += -fPIE -DPIE -I$(multipathdir) -I$(mpathpersistdir)
4728c8
 LDFLAGS += -lpthread -ldevmapper -lreadline -ludev -ldl \
4728c8
-	   -L$(multipathdir) -lmultipath -L$(mpathpersistdir) -lmpathpersist
4728c8
+	   -L$(multipathdir) -lmultipath -L$(mpathpersistdir) -lmpathpersist \
4728c8
+	   -Wl,-z,now -pie
4728c8
 
4728c8
 #
4728c8
 # debuging stuff
4728c8
Index: multipath-tools-130222/kpartx/Makefile
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/kpartx/Makefile
4728c8
+++ multipath-tools-130222/kpartx/Makefile
4728c8
@@ -4,7 +4,7 @@
4728c8
 #
4728c8
 include ../Makefile.inc
4728c8
 
4728c8
-CFLAGS += -I. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
4728c8
+CFLAGS += -fPIC -I. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
4728c8
 
4728c8
 LIBDM_API_COOKIE = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_set_cookie' /usr/include/libdevmapper.h)
4728c8
 
4728c8
Index: multipath-tools-130222/libmpathpersist/Makefile
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/libmpathpersist/Makefile
4728c8
+++ multipath-tools-130222/libmpathpersist/Makefile
4728c8
@@ -10,7 +10,7 @@ DEVLIB = libmpathpersist.so
4728c8
 LIBS = $(DEVLIB).$(SONAME)
4728c8
 
4728c8
 
4728c8
-CFLAGS += -I$(multipathdir) -I$(mpathpersistdir) 
4728c8
+CFLAGS += -fPIC -I$(multipathdir) -I$(mpathpersistdir)
4728c8
 LIBDEPS +=  -lpthread -ldevmapper -ldl -L$(multipathdir) -lmultipath
4728c8
 
4728c8
 OBJS = mpath_persist.o mpath_updatepr.o mpath_pr_ioctl.o 
4728c8
@@ -19,7 +19,7 @@ all: $(LIBS)
4728c8
 
4728c8
 
4728c8
 $(LIBS): 
4728c8
-	$(CC) -Wall -fPIC -c $(CFLAGS) *.c 
4728c8
+	$(CC) -Wall -c $(CFLAGS) *.c
4728c8
 	$(CC)  -shared $(LIBDEPS) -Wl,-soname=$@ $(CFLAGS) -o $@ $(OBJS)
4728c8
 	ln -s $(LIBS) $(DEVLIB)
4728c8
 	$(GZIP) mpath_persistent_reserve_in.3 > mpath_persistent_reserve_in.3.gz	
4728c8
Index: multipath-tools-130222/libmultipath/Makefile
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/libmultipath/Makefile
4728c8
+++ multipath-tools-130222/libmultipath/Makefile
4728c8
@@ -8,6 +8,7 @@ SONAME=0
4728c8
 DEVLIB = libmultipath.so
4728c8
 LIBS = $(DEVLIB).$(SONAME)
4728c8
 LIBDEPS = -lpthread -ldl -ldevmapper -ludev
4728c8
+CFLAGS += -fPIC
4728c8
 
4728c8
 OBJS = memory.o parser.o vector.o devmapper.o \
4728c8
        hwtable.o blacklist.o util.o dmparser.o config.o \
4728c8
Index: multipath-tools-130222/libmultipath/checkers/Makefile
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/libmultipath/checkers/Makefile
4728c8
+++ multipath-tools-130222/libmultipath/checkers/Makefile
4728c8
@@ -14,7 +14,7 @@ LIBS= \
4728c8
 	libcheckhp_sw.so \
4728c8
 	libcheckrdac.so
4728c8
 
4728c8
-CFLAGS += -I..
4728c8
+CFLAGS += -fPIC -I..
4728c8
 
4728c8
 all: $(LIBS)
4728c8
 
4728c8
Index: multipath-tools-130222/libmultipath/prioritizers/Makefile
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/libmultipath/prioritizers/Makefile
4728c8
+++ multipath-tools-130222/libmultipath/prioritizers/Makefile
4728c8
@@ -17,7 +17,7 @@ LIBS = \
4728c8
 	libprioweightedpath.so \
4728c8
 	libprioiet.so
4728c8
 
4728c8
-CFLAGS += -I..
4728c8
+CFLAGS += -fPIC -I..
4728c8
 
4728c8
 all: $(LIBS)
4728c8
 
4728c8
Index: multipath-tools-130222/multipath/Makefile
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/multipath/Makefile
4728c8
+++ multipath-tools-130222/multipath/Makefile
4728c8
@@ -6,7 +6,7 @@ include ../Makefile.inc
4728c8
 
4728c8
 OBJS = main.o
4728c8
 
4728c8
-CFLAGS += -I$(multipathdir)
4728c8
+CFLAGS += -fPIC -I$(multipathdir)
4728c8
 LDFLAGS += -lpthread -ldevmapper -ldl -L$(multipathdir) -lmultipath
4728c8
 
4728c8
 EXEC = multipath