1 Star 0 Fork 8

Ren Zhijie/fence-virt

forked from src-openEuler/fence-virt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bz1624110-1-harden-fPIE.patch 4.69 KB
一键复制 编辑 原始数据 按行查看 历史
jiangxinyu 提交于 2020-11-17 16:13 . add ExclusiveArch: aarch64 to SPEC
diff -uNr a/client/Makefile.in b/client/Makefile.in
--- a/client/Makefile.in 2017-06-05 20:24:36.000000000 +0200
+++ b/client/Makefile.in 2019-04-09 15:04:01.910270557 +0200
@@ -24,7 +24,7 @@
`xml2-config --cflags`
# nss sucks in way too much stuff
-LIBS+=-lnss3 `xml2-config --libs`
+LIBS+=-lnss3 `xml2-config --libs` -Wl,-z,now
TARGETS=${TARGET}
@@ -40,7 +40,16 @@
ln -snf $^ $@
fence_virt: ${fence_virt_SOURCES:.c=.o}
- $(CC) -o $@ $^ $(LIBS) -L../common -lfence_virt
+ $(CC) $(CFLAGS) -o $@ $^ -shared $(LIBS) -L../common -lfence_virt
+
+mcast.o: mcast.c
+ $(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
+
+options.o: options.c
+ $(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
+
+serial.o: serial.c
+ $(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $^ $(INCLUDES)
diff -uNr a/common/Makefile.in b/common/Makefile.in
--- a/common/Makefile.in 2017-06-05 20:24:36.000000000 +0200
+++ b/common/Makefile.in 2019-04-09 15:07:17.456815023 +0200
@@ -24,6 +24,18 @@
libfence_virt.a: ${libfence_virt_a_SOURCE:.c=.o}
ar rc $@ $^
+fdops.o: fdops.c
+ $(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
+
+ip_lookup.o: ip_lookup.c
+ $(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
+
+mcast.o: mcast.c
+ $(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
+
+tcp.o: tcp.c
+ $(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
+
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $^ $(INCLUDES)
diff -uNr a/config/Makefile.in b/config/Makefile.in
--- a/config/Makefile.in 2017-06-05 20:24:36.000000000 +0200
+++ b/config/Makefile.in 2019-04-09 13:53:38.538444645 +0200
@@ -42,7 +42,7 @@
$(LEX) -oconfig.c config.l
%.o: %.c
- $(CC) $(CFLAGS) -c -o $@ $^ $(INCLUDES)
+ $(CC) $(CFLAGS) -fPIE -c -o $@ $^ $(INCLUDES)
clean:
rm -f ${TARGETS} *~ *.o testprog config.tab.c config.tab.h config.c
diff -uNr a/Makefile.top.in b/Makefile.top.in
--- a/Makefile.top.in 2017-06-05 20:24:36.000000000 +0200
+++ b/Makefile.top.in 2019-04-09 15:17:52.488438333 +0200
@@ -2,7 +2,9 @@
CXX=@CXX@
CFLAGS=@CFLAGS@
-CFLAGS+=-fPIC -Wall -Wformat=2 -Wstrict-prototypes -Wshadow -D_GNU_SOURCE
+CFLAGS+=-Wall -Wformat=2 -Wstrict-prototypes -Wshadow -D_GNU_SOURCE
+CXXFLAGS=@CXXFLAGS@
+CXXFLAGS+=-Wall -Wformat=2 -Wstrict-prototypes -Wshadow -D_GNU_SOURCE
LEX=@LEX@
YACC=@YACC@
diff -uNr a/server/Makefile.in b/server/Makefile.in
--- a/server/Makefile.in 2017-06-05 20:24:36.000000000 +0200
+++ b/server/Makefile.in 2019-04-09 15:11:51.692932810 +0200
@@ -32,7 +32,7 @@
XML_LIBS=`xml2-config --libs`
INCLUDES=-I../include `nss-config --cflags` `nspr-config --cflags` `xml2-config --cflags`
-LIBS+=-L../common -lfence_virt -Wl,-wrap,syslog,-wrap,closelog -lpthread -luuid
+LIBS+=-L../common -lfence_virt -Wl,-z,now,-wrap,syslog,-wrap,closelog -lpthread -luuid
MODULE_PATH=${libdir}/${PACKAGE_NAME}
@@ -150,37 +150,46 @@
all: ${TARGETS} ${MODULES}
fence_virtd: ${fence_virtd_SOURCES:.c=.o} ${fence_virtd_cxx_SOURCES:.cpp=.opp}
- $(CXX) -o $@ $^ $(MAIN_LIBS) $(LIBS)
+ $(CXX) $(CXXFLAGS) -o $@ $^ $(MAIN_LIBS) $(LIBS)
multicast.so: ${multicast_so_SOURCES:.c=.o}
- $(CC) -o $@ $^ $(LIBS) -shared $(NSS_LIBS)
+ $(CC) $(CFLAGS) -o $@ $^ $(LIBS) -shared $(NSS_LIBS)
libvirt.so: ${libvirt_so_SOURCES:.c=.o}
- $(CC) -o $@ $^ $(LIBS) -shared $(VIRT_LIBS) $(UUID_LIBS)
+ $(CC) $(CFLAGS) -o $@ $^ $(LIBS) -shared $(VIRT_LIBS) $(UUID_LIBS)
libvirt-qmf.so: ${libvirt_qmf_so_SOURCES:.c=.o} ${libvirt_qmf_cxx_so_SOURCES:.cpp=.opp}
- $(CXX) -o $@ $^ $(LIBS) -shared $(VIRT_QPID)
+ $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS) -shared $(VIRT_QPID)
pm-fence.so: ${pm_fence_so_SOURCES:.c=.o}
- $(CC) -o $@ $^ $(LIBS) -shared $(PACEMAKER_LIBS)
+ $(CC) $(CFLAGS) -o $@ $^ $(LIBS) -shared $(PACEMAKER_LIBS)
cpg.so: ${cpg_so_SOURCES:.c=.o}
- $(CC) -o $@ $^ $(LIBS) -shared $(VIRT_LIBS) $(UUID_LIBS) $(XML_LIBS) $(COROSYNC_LIBS)
+ $(CC) $(CFLAGS) -o $@ $^ $(LIBS) -shared $(VIRT_LIBS) $(UUID_LIBS) $(XML_LIBS) $(COROSYNC_LIBS)
null.so: ${null_so_SOURCES:.c=.o}
- $(CC) -o $@ $^ $(LIBS) -shared
+ $(CC) $(CFLAGS) -o $@ $^ $(LIBS) -shared
serial.so: ${serial_so_SOURCES:.c=.o}
- $(CC) -o $@ $^ $(LIBS) -shared $(VIRT_LIBS) $(UUID_LIBS) $(XML_LIBS)
+ $(CC) $(CFLAGS) -o $@ $^ $(LIBS) -shared $(VIRT_LIBS) $(UUID_LIBS) $(XML_LIBS)
tcp.so: ${tcp_so_SOURCES:.c=.o}
- $(CC) -o $@ $^ $(LIBS) -shared $(NSS_LIBS)
+ $(CC) $(CFLAGS) -o $@ $^ $(LIBS) -shared $(NSS_LIBS)
+
+cpg-virt.o: cpg-virt.c
+ $(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
+
+virt.o: virt.c
+ $(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
+
+virt-serial.o: virt-serial.c
+ $(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $^ $(INCLUDES)
%.opp: %.cpp
- $(CXX) $(CFLAGS) -c -o $@ $^ $(INCLUDES)
+ $(CXX) $(CXXFLAGS) -c -o $@ $^ $(INCLUDES)
install: all
if [ ! -d ${DESTDIR}/${sbindir} ]; then \
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/byterzj/fence-virt.git
git@gitee.com:byterzj/fence-virt.git
byterzj
fence-virt
fence-virt
master

搜索帮助