From 35698aed0021a015f5d5f3e23a1e1a7c43af5b4f Mon Sep 17 00:00:00 2001 From: wangxiao65 <287608437@qq.com> Date: Sat, 20 Mar 2021 16:46:54 +0800 Subject: [PATCH] add fstack-protector-strong cflags --- add-fstack-protector-strong-cflags.patch | 25 ++++++++++++++++++++++++ ocaml.spec | 6 +++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 add-fstack-protector-strong-cflags.patch diff --git a/add-fstack-protector-strong-cflags.patch b/add-fstack-protector-strong-cflags.patch new file mode 100644 index 0000000..0b2d3f3 --- /dev/null +++ b/add-fstack-protector-strong-cflags.patch @@ -0,0 +1,25 @@ +From 6dd26df181bcef6044c3adab9762c50595ae6418 Mon Sep 17 00:00:00 2001 +From: wangxiao65 <287608437@qq.com> +Date: Sat, 20 Mar 2021 17:16:39 +0800 +Subject: [PATCH] add fstack-protector-strong cflags + +--- + configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure b/configure +index 53f45f8..4dec03e 100755 +--- a/configure ++++ b/configure +@@ -474,7 +474,7 @@ case "$ccfamily" in + -fno-builtin-memcmp"; + internal_cflags="$gcc_warnings";; + gcc-*) +- common_cflags="-O2 -fno-strict-aliasing -fwrapv"; ++ common_cflags="-O2 -fno-strict-aliasing -fwrapv -fstack-protector-strong"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; +-- +2.23.0 + diff --git a/ocaml.spec b/ocaml.spec index e461591..323622d 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -1,6 +1,6 @@ Name: ocaml Version: 4.07.0 -Release: 6 +Release: 7 Summary: OCaml compiler and programming environment License: QPL and (LGPLv2+ with exceptions) URL: http://www.ocaml.org @@ -8,6 +8,7 @@ Source0: http://caml.inria.fr/pub/distrib/ocaml-4.07/ocaml-%{version}.tar Patch0002: 0002-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch Patch0003: 0003-configure-Allow-user-defined-C-compiler-flags.patch +Patch0004: add-fstack-protector-strong-cflags.patch BuildRequires: gcc binutils-devel ncurses-devel gdbm-devel emacs gawk perl-interpreter BuildRequires: util-linux libICE-devel libSM-devel libX11-devel libXaw-devel libXext-devel @@ -237,6 +238,9 @@ find %{buildroot} \( -name '*.cmt' -o -name '*.cmti' \) -a -delete %{_mandir}/man3/* %changelog +* Sat Mar 20 2021 wangxiao - 4.07.0-7 +- Add fstack-protector-strong cflags + * Thu Jan 22 2020 yanzhihua - 4.07.0-6 - modify patching method -- Gitee