summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicoo <nicoo@debian.org>2020-02-23 14:29:45 +0000
committernicoo <nicoo@debian.org>2020-02-23 14:29:45 +0000
commit28215e6c161c70cb1bcae7d01195fefcffb09d32 (patch)
tree9ac45dce216a9a3182073b0d099411c0fe19d644
parentdd6879395a03ab2008866c0a8149e33d1c72de8a (diff)
parent9483147049d84ef447d9df8b755680639ca7bd8b (diff)
Merge branch 'conditional-stack-protector-all' into 'debian/sid'
Only use -fstack-protector-all if it is supported See merge request auth-team/libfido2!2
-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