From 601fe503aabd0aeb45589b153b8c23819966dfa6 Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Thu, 20 Jan 2022 12:33:32 -0500 Subject: [PATCH] fix compilation on EL7 Git now requires C99 support and a zlib with uncompress2 by default. On EL7, gcc-4.8.5 requires a flag to enable C99 support. Compilation also fails without -fPIC on EL7, for reasons of which I am not entirely clear. (I do not like making a change I cannot justify or explain properly, but it is better than dropping EL7 support until I have time to learn the reason(s).) Update the %build_cflags macro when building on EL7 to enable C99 support and set -fPIC. Define NO_UNCOMPRESS2 to use compat/zlib-uncompress2.c. --- git.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/git.spec b/git.spec index 7f280db..778e231 100644 --- a/git.spec +++ b/git.spec @@ -39,6 +39,7 @@ %else %bcond_without python2 %bcond_with python3 +%global build_cflags %{build_cflags} -fPIC -std=gnu99 %global gitweb_httpd_conf git.conf %global use_glibc_langpacks 0 %global use_perl_generators 0 @@ -80,7 +81,7 @@ Name: git Version: 2.35.0 -Release: 0.2%{?rcrev}%{?dist}.1 +Release: 0.2%{?rcrev}%{?dist}.2 Summary: Fast Version Control System License: GPLv2 URL: https://git-scm.com/ @@ -548,6 +549,9 @@ INSTALL_SYMLINKS = 1 GITWEB_PROJECTROOT = %{_localstatedir}/lib/git GNU_ROFF = 1 NO_PERL_CPAN_FALLBACKS = 1 +%if 0%{?rhel} && 0%{?rhel} < 8 +NO_UNCOMPRESS2 = 1 +%endif %if %{with python3} PYTHON_PATH = %{__python3} %else @@ -1012,6 +1016,9 @@ rmdir --ignore-fail-on-non-empty "$testdir" %{?with_docs:%{_pkgdocdir}/git-svn.html} %changelog +* Fri Jan 21 2022 Todd Zullinger - 2.35.0-0.2.rc2.2 +- fix compilation on EL7 + * Thu Jan 20 2022 Todd Zullinger - 2.35.0-0.2.rc2.1 - checkout: avoid BUG() when hitting a broken repository (rhbz#2042920)