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