summaryrefslogtreecommitdiff
path: root/debian/patches/conditional-stack-protector-all.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/conditional-stack-protector-all.patch')
-rw-r--r--debian/patches/conditional-stack-protector-all.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/debian/patches/conditional-stack-protector-all.patch b/debian/patches/conditional-stack-protector-all.patch
new file mode 100644
index 0000000..d58f7ee
--- /dev/null
+++ b/debian/patches/conditional-stack-protector-all.patch
@@ -0,0 +1,27 @@
1From: Colin Watson <cjwatson@debian.org>
2Date: Fri, 21 Feb 2020 23:23:49 +0000
3Subject: Only use -fstack-protector-all if it is supported
4
5This flag isn't available on all Debian ports.
6
7Last-Update: 2020-02-21
8---
9 CMakeLists.txt | 5 ++++-
10 1 file changed, 4 insertions(+), 1 deletion(-)
11
12diff --git a/CMakeLists.txt b/CMakeLists.txt
13index c7c5991..07ca5e1 100644
14--- a/CMakeLists.txt
15+++ b/CMakeLists.txt
16@@ -114,7 +114,10 @@ else()
17 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wbad-function-cast")
18 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic")
19 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic-errors")
20- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all")
21+ check_c_compiler_flag("-fstack-protector-all" HAVE_STACK_PROTECTOR_ALL)
22+ if(HAVE_STACK_PROTECTOR_ALL)
23+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all")
24+ endif()
25 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
26
27 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g2")