import libmpc-1.1.0-9.1.el8

This commit is contained in:
CentOS Sources 2021-05-18 02:56:20 -04:00 committed by Andrew Lukoshko
parent 15c0fd7a6e
commit 5c0487b660
4 changed files with 111 additions and 58 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
SOURCES/mpc-0.9.tar.gz
SOURCES/mpc-1.0.2.tar.gz
SOURCES/mpc-1.1.0.tar.gz

View File

@ -1,2 +1,2 @@
229722d553030734d49731844abfef7617b64f1a SOURCES/mpc-0.9.tar.gz
5072d82ab50ec36cc8c0e320b5c377adb48abe70 SOURCES/mpc-1.0.2.tar.gz
b019d9e1d27ec5fb99497159d43a3164995de2d0 SOURCES/mpc-1.1.0.tar.gz

View File

@ -0,0 +1,37 @@
From aed9d68b2a7e6622a7d0037d25d69d486a33825c Mon Sep 17 00:00:00 2001
From: Marek Polacek <polacek@redhat.com>
Date: Thu, 8 Oct 2020 16:27:55 -0400
Subject: [PATCH] Fix reading uninitialized value. Remove dead assignment.
* src/atan.c (mpc_atan): Initialize OK to zero.
* src/pow.c (mpc_pow): Remove dead assignment.
---
src/atan.c | 2 +-
src/pow.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/atan.c b/src/atan.c
index cc1922b..4e71f6f 100644
--- a/src/atan.c
+++ b/src/atan.c
@@ -143,7 +143,7 @@ mpc_atan (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
mpfr_rnd_t rnd_im, rnd_away;
mpfr_t y, z;
mpfr_prec_t p, p_im;
- int ok;
+ int ok = 0;
rnd_im = MPC_RND_IM (rnd);
mpfr_init (y);
diff --git a/src/pow.c b/src/pow.c
index 4fc90ae..0fc6932 100644
--- a/src/pow.c
+++ b/src/pow.c
@@ -685,7 +685,6 @@ mpc_pow (mpc_ptr z, mpc_srcptr x, mpc_sr
int inex_re, inex_im;
/* under- and overflow flags are set by mpc_exp */
mpc_set (z, u, MPC_RNDNN);
- ret = ret_exp;
inex_re = MPC_INEX_RE(ret_exp);
inex_im = MPC_INEX_IM(ret_exp);
if (mpfr_inf_p (mpc_realref (z)))

View File

@ -1,24 +1,24 @@
# build compat-libmpc for bootstrapping purposes
%define bootstrap 1
%global bootstrap 1
%global bootstrap_version 0.9
Summary: C library for multiple precision complex arithmetic
Name: libmpc
Version: 1.0.2
Release: 9%{?dist}
License: LGPLv3+ and GFDL
Group: Development/Tools
URL: http://www.multiprecision.org/
Source0: http://www.multiprecision.org/mpc/download/mpc-%{version}.tar.gz
BuildRequires: gmp-devel >= 4.3.2
BuildRequires: mpfr-devel >= 2.4.2
BuildRequires: texinfo
Version: 1.1.0
Release: 9.1%{?dist}
License: LGPLv3+
URL: http://www.multiprecision.org/mpc/
Source0: https://ftp.gnu.org/gnu/mpc/mpc-%{version}.tar.gz
%if 0%{?bootstrap}
Source1: http://www.multiprecision.org/mpc/download/mpc-0.9.tar.gz
Source1: http://www.multiprecision.org/downloads/mpc-%{bootstrap_version}.tar.gz
%endif
BuildRequires: gcc
BuildRequires: gmp-devel >= 5.0.0
BuildRequires: mpfr-devel
Patch0: libmpc-fix-uninit-var.patch
%description
MPC is a C library for the arithmetic of complex numbers with
@ -26,69 +26,77 @@ arbitrarily high precision and correct rounding of the result. It is
built upon and follows the same principles as Mpfr.
%package devel
Summary: Header and shared development libraries for MPC
Group: Development/Libraries
Summary: Headers and shared development libraries for MPC
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: mpfr-devel gmp-devel
Requires: gmp-devel%{?_isa}
Requires: mpfr-devel%{?_isa}
%description devel
Header files and shared object symlinks for MPC is a C library.
Header files and shared library symlinks for the MPC library.
%package doc
Summary: Documentation for the MPC library
License: GFDL
BuildArch: noarch
%description doc
Documentation for the MPC library.
%if 0%{?bootstrap}
%package -n compat-libmpc
Summary: compat/bootstrap mpc-0.9 library
%description -n compat-libmpc
%{summary}.
Summary: compat/bootstrap mpc-%{bootstrap_version} library
%description -n compat-libmpc
Contains the .so files for mpc version %{bootstrap-version}.
%endif
%prep
%setup -q -n mpc-%{version} %{?bootstrap:-a 1}
%setup -q -n mpc-%{version}
%if 0%{?bootstrap}
%setup -q -n mpc-%{version} -a 1
%endif
%patch0 -p1 -b .uninit~
%build
%configure --disable-static
# Get rid of undesirable hardcoded rpaths; workaround libtool reordering
# -Wl,--as-needed after all the libraries.
sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
-e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
-e 's|CC="\(g..\)"|CC="\1 -Wl,--as-needed"|' \
-i libtool
%make_build
%if 0%{?bootstrap}
export CPPFLAGS="%{optflags} -std=gnu99"
export CFLAGS="%{optflags} -std=gnu99"
export EGREP=egrep
%if 0%{?bootstrap}
pushd mpc-0.9/
pushd mpc-%{bootstrap_version}
%configure --disable-static
make %{?_smp_mflags}
%make_build
popd
%endif
%configure --disable-static
make %{?_smp_mflags}
%check
make check
%install
%if 0%{?bootstrap}
make install DESTDIR=$RPM_BUILD_ROOT -C mpc-0.9/
%make_install -C mpc-%{bootstrap_version}
## remove everything but shlib
rm -fv $RPM_BUILD_ROOT%{_libdir}/libmpc.so
rm -fv $RPM_BUILD_ROOT%{_includedir}/*
rm -fv $RPM_BUILD_ROOT%{_infodir}/*
rm -fv %{buildroot}%{_libdir}/libmpc.so
rm -fv %{buildroot}%{_includedir}/*
rm -fv %{buildroot}%{_infodir}/*
%endif
make install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT/%{_libdir}/libmpc.la
rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir
%make_install
rm -f %{buildroot}/%{_libdir}/*.la
rm -f %{buildroot}/%{_infodir}/dir
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post devel
if [ -f %{_infodir}/mpc.info.gz ]; then # for --excludedocs
/sbin/install-info %{_infodir}/mpc.info.gz %{_infodir}/dir || :
fi
%preun devel
if [ $1 = 0 ]; then
if [ -f %{_infodir}/mpc.info.gz ]; then # for --excludedocs
/sbin/install-info --delete %{_infodir}/mpc.info.gz %{_infodir}/dir || :
fi
fi
%check
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
make check
%files
%license COPYING.LESSER
@ -98,16 +106,24 @@ fi
%files devel
%{_libdir}/libmpc.so
%{_includedir}/mpc.h
%files doc
%doc AUTHORS
%{_infodir}/*.info*
%post -n compat-libmpc -p /sbin/ldconfig
%postun -n compat-libmpc -p /sbin/ldconfig
%if 0%{?bootstrap}
%files -n compat-libmpc
%{_libdir}/libmpc.so.2*
%endif
%changelog
* Fri Oct 09 2020 Marek Polacek <polacek@redhat.com> - 1.1.0-9.1
- apply my upstream patch to fix using an uninitialized value
* Thu Oct 08 2020 Marek Polacek <polacek@redhat.com> - 1.1.0-9
- mpc-1.1.0 (#1835193)
- update the specfile from Fedora
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild