From d23b65a4468b19b48d58793b872ef60ac8d455d2 Mon Sep 17 00:00:00 2001 From: Andrew Bower Date: Fri, 13 Sep 2024 12:41:43 +0100 Subject: [PATCH] SWPTP-1517: build RPM using gcc with sufficient C11 support on EL7, EL6 --- scripts/rpm/el6/sfptpd.spec | 3 ++- scripts/rpm/el7/sfptpd.spec | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/rpm/el6/sfptpd.spec b/scripts/rpm/el6/sfptpd.spec index 7865d239..7fc0e1d5 100644 --- a/scripts/rpm/el6/sfptpd.spec +++ b/scripts/rpm/el6/sfptpd.spec @@ -15,6 +15,7 @@ BuildRequires: gcc BuildRequires: make BuildRequires: libmnl-devel BuildRequires: libcap-devel +BuildRequires: devtoolset-7-gcc BuildRoot: %{_tmppath}/%{name}-%{version}-root %define _pkgdocdir %{_defaultdocdir}/%{name}-%{version} @@ -45,7 +46,7 @@ find -iregex '.*\.py' | xargs sed -i -r -e '1s,^(#!).*python3,\1/usr/bin/python, sed -i 's,.*\(SFPTPD_USER=\).*",#\1"",g' scripts/sfptpd.env %build -make %{?_smp_mflags} sfptpd sfptpdctl sfptpd_priv_helper GLIBC_COMPAT=1 +scl enable devtoolset-7 'make %{?_smp_mflags} sfptpd sfptpdctl sfptpd_priv_helper GLIBC_COMPAT=1' %install export CC='false # no compilation at installation stage #' diff --git a/scripts/rpm/el7/sfptpd.spec b/scripts/rpm/el7/sfptpd.spec index 73390576..5e52dc7f 100644 --- a/scripts/rpm/el7/sfptpd.spec +++ b/scripts/rpm/el7/sfptpd.spec @@ -16,6 +16,7 @@ BuildRequires: make BuildRequires: systemd BuildRequires: libmnl-devel BuildRequires: libcap-devel +BuildRequires: devtoolset-8-gcc %description Use multiple PTP an PPS sources and sync local clocks together in one @@ -42,7 +43,7 @@ scripts/sfptpd_versioning write %{version} sed -i 's,.*\(SFPTPD_USER=\).*",#\1"",g' scripts/sfptpd.env %build -%make_build +scl enable devtoolset-8 '%make_build' %install export CC='false # no compilation at installation stage #'