From a48f266cbda5dcbddc770eef925a75927e97a214 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 21 Feb 2020 23:27:21 +0000 Subject: Only use -fstack-protector-all if it is supported --- .../patches/conditional-stack-protector-all.patch | 27 ++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 28 insertions(+) create mode 100644 debian/patches/conditional-stack-protector-all.patch create mode 100644 debian/patches/series 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 @@ +From: Colin Watson +Date: Fri, 21 Feb 2020 23:23:49 +0000 +Subject: Only use -fstack-protector-all if it is supported + +This flag isn't available on all Debian ports. + +Last-Update: 2020-02-21 +--- + CMakeLists.txt | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c7c5991..07ca5e1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -114,7 +114,10 @@ else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wbad-function-cast") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic-errors") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all") ++ check_c_compiler_flag("-fstack-protector-all" HAVE_STACK_PROTECTOR_ALL) ++ if(HAVE_STACK_PROTECTOR_ALL) ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all") ++ endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") + + 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 -- cgit v1.2.3 From 9483147049d84ef447d9df8b755680639ca7bd8b Mon Sep 17 00:00:00 2001 From: nicoo Date: Sun, 23 Feb 2020 15:19:41 +0100 Subject: debian/patches: Update metadata (reviewed and forwarded upstream) Used `patchedit -f -o` to generate DEP3-compliant metadata --- debian/patches/conditional-stack-protector-all.patch | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/debian/patches/conditional-stack-protector-all.patch b/debian/patches/conditional-stack-protector-all.patch index d58f7ee..99fa85e 100644 --- a/debian/patches/conditional-stack-protector-all.patch +++ b/debian/patches/conditional-stack-protector-all.patch @@ -1,10 +1,14 @@ -From: Colin Watson -Date: Fri, 21 Feb 2020 23:23:49 +0000 Subject: Only use -fstack-protector-all if it is supported This flag isn't available on all Debian ports. -Last-Update: 2020-02-21 +Origin: vendor +From: Colin Watson +Reviewed-by: nicoo +Forwarded: https://github.com/Yubico/libfido2/pull/130 +Applied-Upstream: not-yet +Last-Update: 2020-02-23 + --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- cgit v1.2.3