This patch adds fcf-protection=full to CFLAGS as annocheck gave a
warning about it and the recommended way to fix it is by adding this as
compiler flag.

https://sourceware.org/annobin/annobin.html/Test-cf-protection.html
---
 dlm_controld/Makefile | 2 +-
 dlm_tool/Makefile     | 2 +-
 fence/Makefile        | 2 +-
 libdlm/Makefile       | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dlm_controld/Makefile b/dlm_controld/Makefile
index 9cf7152f..ec8c360c 100644
--- a/dlm_controld/Makefile
+++ b/dlm_controld/Makefile
@@ -43,7 +43,7 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
        -Wno-sign-compare -Wno-unused-parameter -Wp,-D_FORTIFY_SOURCE=2 \
        -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option \
        -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong \
-       -fstack-clash-protection
+       -fstack-clash-protection -fcf-protection=full
 
 BIN_CFLAGS += $(CFLAGS) -fPIE -DPIE
 BIN_CFLAGS += -I../include -I../libdlm
diff --git a/dlm_tool/Makefile b/dlm_tool/Makefile
index 1c3d61d5..57629c73 100644
--- a/dlm_tool/Makefile
+++ b/dlm_tool/Makefile
@@ -15,7 +15,7 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
        -Wno-sign-compare -Wno-unused-parameter -Wp,-D_FORTIFY_SOURCE=2 \
        -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option \
        -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong \
-       -fstack-clash-protection
+       -fstack-clash-protection -fcf-protection=full
 
 CFLAGS += -fPIE -DPIE
 CFLAGS += -I../include -I../libdlm -I../dlm_controld
diff --git a/fence/Makefile b/fence/Makefile
index ee4dfb88..446f4eaa 100644
--- a/fence/Makefile
+++ b/fence/Makefile
@@ -15,7 +15,7 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
        -Wno-sign-compare -Wno-unused-parameter -Wp,-D_FORTIFY_SOURCE=2 \
        -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option \
        -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong \
-       -fstack-clash-protection
+       -fstack-clash-protection -fcf-protection=full
 
 CFLAGS += -fPIE -DPIE
 CFLAGS += -I../include
diff --git a/libdlm/Makefile b/libdlm/Makefile
index 5069ccf1..823fdaa9 100644
--- a/libdlm/Makefile
+++ b/libdlm/Makefile
@@ -80,8 +80,8 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
        -fdiagnostics-show-option \
        -fPIC
 
-LIB_CFLAGS += $(CFLAGS) -D_REENTRANT
-LLT_CFLAGS += $(CFLAGS)
+LIB_CFLAGS += $(CFLAGS) -D_REENTRANT -fcf-protection=full
+LLT_CFLAGS += $(CFLAGS) -fcf-protection=full
 
 LIB_LDFLAGS += $(LDFLAGS) -lpthread -Wl,-z,now
 LLT_LDFLAGS += $(LDFLAGS) -Wl,-z,now
-- 
2.31.1

Reply via email to