From c8ae0761900c5ec036f4a2792f74aab0808654c2 Mon Sep 17 00:00:00 2001 From: sunguoshuai Date: Fri, 30 Jul 2021 14:53:04 +0800 Subject: [PATCH] compile with fcommon to support gcc 10 --- compile-with-fcommon-to-support-gcc-10.patch | 25 ++++++++++++++++++++ ocaml.spec | 8 +++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 compile-with-fcommon-to-support-gcc-10.patch diff --git a/compile-with-fcommon-to-support-gcc-10.patch b/compile-with-fcommon-to-support-gcc-10.patch new file mode 100644 index 0000000..95ed40e --- /dev/null +++ b/compile-with-fcommon-to-support-gcc-10.patch @@ -0,0 +1,25 @@ +commit e312163ad1349cb767cb38e64908d0dc6247b8f9 +Author: Anil Madhavapeddy +Date: Sun Jun 21 19:06:50 2020 +0100 +Subject: [PATCH] ocaml compile with fcommon to support gcc 10 + + Add `-fcommon` unconditionally to CFLAGS to fix gcc10 build + + Signed-off-by: Anil Madhavapeddy + +diff --git a/configure b/configure +index 53f45f8..0609069 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 -fcommon"; + internal_cflags="$gcc_warnings";; + *) + common_cflags="-O";; +-- +2.30.0 + diff --git a/ocaml.spec b/ocaml.spec index e461591..d9f9b2d 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -1,13 +1,14 @@ Name: ocaml Version: 4.07.0 -Release: 6 +Release: 7 Summary: OCaml compiler and programming environment -License: QPL and (LGPLv2+ with exceptions) +License: GPL-2.0-or-later and LGPL-2.1-only URL: http://www.ocaml.org Source0: http://caml.inria.fr/pub/distrib/ocaml-4.07/ocaml-%{version}.tar.xz Patch0002: 0002-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch Patch0003: 0003-configure-Allow-user-defined-C-compiler-flags.patch +Patch0004: compile-with-fcommon-to-support-gcc-10.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 +* Fri 30 Jul 2021 sunguoshuai - 4.07.0-7 +- compile with -fcommon to support gcc 10 + * Thu Jan 22 2020 yanzhihua - 4.07.0-6 - modify patching method -- Gitee