summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
Diffstat (limited to 'debian')
-rw-r--r--debian/patches/conditional-stack-protector-all.patch31
-rw-r--r--debian/patches/series1
2 files changed, 32 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..99fa85e
--- /dev/null
+++ b/debian/patches/conditional-stack-protector-all.patch
@@ -0,0 +1,31 @@
1Subject: Only use -fstack-protector-all if it is supported
2
3This flag isn't available on all Debian ports.
4
5Origin: vendor
6From: Colin Watson <cjwatson@debian.org>
7Reviewed-by: nicoo <nicoo@debian.org>
8Forwarded: https://github.com/Yubico/libfido2/pull/130
9Applied-Upstream: not-yet
10Last-Update: 2020-02-23
11
12---
13 CMakeLists.txt | 5 ++++-
14 1 file changed, 4 insertions(+), 1 deletion(-)
15
16diff --git a/CMakeLists.txt b/CMakeLists.txt
17index c7c5991..07ca5e1 100644
18--- a/CMakeLists.txt
19+++ b/CMakeLists.txt
20@@ -114,7 +114,10 @@ else()
21 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wbad-function-cast")
22 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic")
23 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic-errors")
24- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all")
25+ check_c_compiler_flag("-fstack-protector-all" HAVE_STACK_PROTECTOR_ALL)
26+ if(HAVE_STACK_PROTECTOR_ALL)
27+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all")
28+ endif()
29 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
30
31 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g2")
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..d5d2276
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
conditional-stack-protector-all.patch