summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-07-15 23:37:21 -0700
committerKhem Raj <raj.khem@gmail.com>2023-07-15 23:40:20 -0700
commit98c86616dbf082c977c9b9f16f5bddea23f7629c (patch)
treeb8818a0c15ca21e6ca09fe0251c0dfde3d0729e0
parent225e5848415e5f79811563b748f3d49e3ebefca5 (diff)
downloadmeta-openembedded-98c86616dbf082c977c9b9f16f5bddea23f7629c.tar.gz
dlm: Do not pass -fcf-protection=full via Makefile
Pass it via cflags from environment, so it can be controlled for platforms where it is not supported Pass -fstack-clash-protection for clang too, it is available now a days Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-networking/recipes-extended/dlm/dlm/0001-Remove-fcf-protection-full.patch64
-rw-r--r--meta-networking/recipes-extended/dlm/dlm_4.2.0.bb11
2 files changed, 70 insertions, 5 deletions
diff --git a/meta-networking/recipes-extended/dlm/dlm/0001-Remove-fcf-protection-full.patch b/meta-networking/recipes-extended/dlm/dlm/0001-Remove-fcf-protection-full.patch
new file mode 100644
index 0000000000..6290aa4c7a
--- /dev/null
+++ b/meta-networking/recipes-extended/dlm/dlm/0001-Remove-fcf-protection-full.patch
@@ -0,0 +1,64 @@
1From e4ae70ae71f88d48cf1ab63810c9f7b4177af3a5 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 15 Jul 2023 19:05:54 -0700
4Subject: [PATCH] Remove -fcf-protection=full
5
6This option is not available on all architectures e.g. RISC-V
7Fixes
8| cc1: error: '-fcf-protection=full' is not supported for this target
9
10Upstream-Status: Pending
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 dlm_controld/Makefile | 1 -
14 dlm_tool/Makefile | 1 -
15 fence/Makefile | 1 -
16 libdlm/Makefile | 4 ++--
17 4 files changed, 2 insertions(+), 5 deletions(-)
18
19--- a/dlm_controld/Makefile
20+++ b/dlm_controld/Makefile
21@@ -43,7 +43,7 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
22 -Wno-sign-compare -Wno-unused-parameter -Wp,-D_FORTIFY_SOURCE=2 \
23 -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option \
24 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong \
25- -fstack-clash-protection -fcf-protection=full
26+ -fstack-clash-protection
27
28 BIN_CFLAGS += $(CFLAGS) -fPIE -DPIE
29 BIN_CFLAGS += -I../include -I../libdlm
30--- a/dlm_tool/Makefile
31+++ b/dlm_tool/Makefile
32@@ -15,7 +15,7 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
33 -Wno-sign-compare -Wno-unused-parameter -Wp,-D_FORTIFY_SOURCE=2 \
34 -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option \
35 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong \
36- -fstack-clash-protection -fcf-protection=full
37+ -fstack-clash-protection
38
39 CFLAGS += -fPIE -DPIE
40 CFLAGS += -I../include -I../libdlm -I../dlm_controld
41--- a/fence/Makefile
42+++ b/fence/Makefile
43@@ -15,7 +15,7 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
44 -Wno-sign-compare -Wno-unused-parameter -Wp,-D_FORTIFY_SOURCE=2 \
45 -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option \
46 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong \
47- -fstack-clash-protection -fcf-protection=full
48+ -fstack-clash-protection
49
50 CFLAGS += -fPIE -DPIE
51 CFLAGS += -I../include
52--- a/libdlm/Makefile
53+++ b/libdlm/Makefile
54@@ -80,8 +80,8 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
55 -fdiagnostics-show-option \
56 -fPIC
57
58-LIB_CFLAGS += $(CFLAGS) -D_REENTRANT -fcf-protection=full
59-LLT_CFLAGS += $(CFLAGS) -fcf-protection=full
60+LIB_CFLAGS += $(CFLAGS) -D_REENTRANT
61+LLT_CFLAGS += $(CFLAGS)
62
63 LIB_LDFLAGS += $(LDFLAGS) -lpthread -Wl,-z,now
64 LLT_LDFLAGS += $(LDFLAGS) -Wl,-z,now
diff --git a/meta-networking/recipes-extended/dlm/dlm_4.2.0.bb b/meta-networking/recipes-extended/dlm/dlm_4.2.0.bb
index 5073192763..bd71f70e3c 100644
--- a/meta-networking/recipes-extended/dlm/dlm_4.2.0.bb
+++ b/meta-networking/recipes-extended/dlm/dlm_4.2.0.bb
@@ -10,6 +10,7 @@ SRC_URI = "https://pagure.io/dlm/archive/dlm-${PV}/dlm-dlm-${PV}.tar.gz \
10 file://0001-make-Replace-cp-a-with-mode-preserving-options.patch \ 10 file://0001-make-Replace-cp-a-with-mode-preserving-options.patch \
11 file://0001-dlm_controld-remove-unnecessary-header-include.patch \ 11 file://0001-dlm_controld-remove-unnecessary-header-include.patch \
12 file://0001-Disable-annobin-plugin.patch \ 12 file://0001-Disable-annobin-plugin.patch \
13 file://0001-Remove-fcf-protection-full.patch \
13 " 14 "
14 15
15SRC_URI[sha256sum] = "90237e18af7422ac15fc756899b3bb6932597b13342296de8e0e120e6d8729ab" 16SRC_URI[sha256sum] = "90237e18af7422ac15fc756899b3bb6932597b13342296de8e0e120e6d8729ab"
@@ -35,14 +36,15 @@ SYSTEMD_AUTO_ENABLE = "enable"
35 36
36export EXTRA_OEMAKE = "" 37export EXTRA_OEMAKE = ""
37 38
39CFPROTECTION ?= "-fcf-protection=full"
40CFPROTECTION:riscv64 = ""
41
42CFLAGS += "${CFPROTECTION}"
43
38PARALLEL_MAKE = "" 44PARALLEL_MAKE = ""
39 45
40DONTBUILD = "${@bb.utils.contains('PACKAGECONFIG', 'pacemaker', '', 'fence', d)}" 46DONTBUILD = "${@bb.utils.contains('PACKAGECONFIG', 'pacemaker', '', 'fence', d)}"
41 47
42do_compile:prepend:toolchain-clang() {
43 sed -i -e "s/-fstack-clash-protection//g" ${S}/*/Makefile
44}
45
46do_compile() { 48do_compile() {
47 sed -i "s/libsystemd-daemon/libsystemd/g" ${S}/dlm_controld/Makefile 49 sed -i "s/libsystemd-daemon/libsystemd/g" ${S}/dlm_controld/Makefile
48 sed -i -e "s/ ${DONTBUILD}//g" ${S}/Makefile 50 sed -i -e "s/ ${DONTBUILD}//g" ${S}/Makefile
@@ -59,4 +61,3 @@ do_install() {
59 install -Dm 0644 ${S}/init/dlm.service ${D}${systemd_unitdir}/system/dlm.service 61 install -Dm 0644 ${S}/init/dlm.service ${D}${systemd_unitdir}/system/dlm.service
60 fi 62 fi
61} 63}
62