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

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