From b00eb29af8ede50cd30a516afcfc922757b23027 Mon Sep 17 00:00:00 2001 From: Deji Akingunola Date: Wed, 24 Jul 2013 00:03:22 -0400 Subject: [PATCH 01/16] Rename mpich2 sub-packages to mpich and rebuild for mpich-3.0 --- hdf5.spec | 114 +++++++++++++++++++++++++++++------------------------- 1 file changed, 62 insertions(+), 52 deletions(-) diff --git a/hdf5.spec b/hdf5.spec index 4ce2023..99a4ae4 100644 --- a/hdf5.spec +++ b/hdf5.spec @@ -4,7 +4,7 @@ # You need to recompile all users of HDF5 for each version change Name: hdf5 Version: 1.8.10 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A general purpose library and file format for storing scientific data License: BSD Group: System Environment/Libraries @@ -19,12 +19,12 @@ BuildRequires: krb5-devel, openssl-devel, zlib-devel, gcc-gfortran, time # Needed for mpi tests BuildRequires: openssh-clients -%global with_mpich2 1 +%global with_mpich 1 %global with_openmpi 1 %if 0%{?rhel} %ifarch ppc64 # No mpich2 on ppc64 in EL -%global with_mpich2 0 +%global with_mpich 0 %endif %endif %ifarch s390 s390x @@ -32,8 +32,8 @@ BuildRequires: openssh-clients %global with_openmpi 0 %endif -%if %{with_mpich2} -%global mpi_list mpich2 +%if %{with_mpich} +%global mpi_list mpich %endif %if %{with_openmpi} %global mpi_list %{?mpi_list} openmpi @@ -68,34 +68,40 @@ Requires: %{name}-devel = %{version}-%{release} HDF5 static libraries. -%if %{with_mpich2} -%package mpich2 -Summary: HDF5 mpich2 libraries +%if %{with_mpich} +%package mpich +Summary: HDF5 mpich libraries Group: Development/Libraries -Requires: mpich2 -BuildRequires: mpich2-devel +Requires: mpich +BuildRequires: mpich-devel +Provides: %{name}-mpich2 = %{version}-%{release} +Obsoletes: %{name}-mpich2 < 1.8.10-4 -%description mpich2 -HDF5 parallel mpich2 libraries +%description mpich +HDF5 parallel mpich libraries -%package mpich2-devel -Summary: HDF5 mpich2 development files +%package mpich-devel +Summary: HDF5 mpich development files Group: Development/Libraries -Requires: %{name}-mpich2%{?_isa} = %{version}-%{release} -Requires: mpich2 +Requires: %{name}-mpich%{?_isa} = %{version}-%{release} +Requires: mpich +Provides: %{name}-mpich2-devel = %{version}-%{release} +Obsoletes: %{name}-mpich2-devel < 1.8.10-4 -%description mpich2-devel -HDF5 parallel mpich2 development files +%description mpich-devel +HDF5 parallel mpich development files -%package mpich2-static -Summary: HDF5 mpich2 static libraries +%package mpich-static +Summary: HDF5 mpich static libraries Group: Development/Libraries -Requires: %{name}-mpich2-devel%{?_isa} = %{version}-%{release} +Requires: %{name}-mpich-devel%{?_isa} = %{version}-%{release} +Provides: %{name}-mpich2-static = %{version}-%{release} +Obsoletes: %{name}-mpich2-static < 1.8.10-4 -%description mpich2-static -HDF5 parallel mpich2 static libraries +%description mpich-static +HDF5 parallel mpich static libraries %endif @@ -302,42 +308,42 @@ done %defattr(-,root,root,-) %{_libdir}/*.a -%if %{with_mpich2} -%files mpich2 +%if %{with_mpich} +%files mpich %defattr(-,root,root,-) %doc COPYING MANIFEST README.txt release_docs/RELEASE.txt %doc release_docs/HISTORY*.txt -%{_libdir}/mpich2/bin/gif2h5 -%{_libdir}/mpich2/bin/h52gif -%{_libdir}/mpich2/bin/h5copy -%{_libdir}/mpich2/bin/h5debug -%{_libdir}/mpich2/bin/h5diff -%{_libdir}/mpich2/bin/h5dump -%{_libdir}/mpich2/bin/h5import -%{_libdir}/mpich2/bin/h5jam -%{_libdir}/mpich2/bin/h5ls -%{_libdir}/mpich2/bin/h5mkgrp -%{_libdir}/mpich2/bin/h5redeploy -%{_libdir}/mpich2/bin/h5repack -%{_libdir}/mpich2/bin/h5perf -%{_libdir}/mpich2/bin/h5perf_serial -%{_libdir}/mpich2/bin/h5repart -%{_libdir}/mpich2/bin/h5stat -%{_libdir}/mpich2/bin/h5unjam -%{_libdir}/mpich2/bin/ph5diff -%{_libdir}/mpich2/lib/*.so.* +%{_libdir}/mpich/bin/gif2h5 +%{_libdir}/mpich/bin/h52gif +%{_libdir}/mpich/bin/h5copy +%{_libdir}/mpich/bin/h5debug +%{_libdir}/mpich/bin/h5diff +%{_libdir}/mpich/bin/h5dump +%{_libdir}/mpich/bin/h5import +%{_libdir}/mpich/bin/h5jam +%{_libdir}/mpich/bin/h5ls +%{_libdir}/mpich/bin/h5mkgrp +%{_libdir}/mpich/bin/h5redeploy +%{_libdir}/mpich/bin/h5repack +%{_libdir}/mpich/bin/h5perf +%{_libdir}/mpich/bin/h5perf_serial +%{_libdir}/mpich/bin/h5repart +%{_libdir}/mpich/bin/h5stat +%{_libdir}/mpich/bin/h5unjam +%{_libdir}/mpich/bin/ph5diff +%{_libdir}/mpich/lib/*.so.* -%files mpich2-devel +%files mpich-devel %defattr(-,root,root,-) -%{_includedir}/mpich2-%{_arch} -%{_libdir}/mpich2/bin/h5pcc -%{_libdir}/mpich2/bin/h5pfc -%{_libdir}/mpich2/lib/lib*.so -%{_libdir}/mpich2/lib/lib*.settings +%{_includedir}/mpich-%{_arch} +%{_libdir}/mpich/bin/h5pcc +%{_libdir}/mpich/bin/h5pfc +%{_libdir}/mpich/lib/lib*.so +%{_libdir}/mpich/lib/lib*.settings -%files mpich2-static +%files mpich-static %defattr(-,root,root,-) -%{_libdir}/mpich2/lib/*.a +%{_libdir}/mpich/lib/*.a %endif %if %{with_openmpi} @@ -380,6 +386,10 @@ done %changelog +* Wed Jul 24 2013 Deji Akingunola - 1.8.10-4 +- Rename mpich2 sub-packages to mpich and rebuild for mpich-3.0 + + * Mon Mar 11 2013 Ralf Corsépius - 1.8.10-3 - Remove %%config from %%{_sysconfdir}/rpm/macros.* (https://fedorahosted.org/fpc/ticket/259). From 62bdcc0c86db1fcfe2d85dcddbf6ae7a24441ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Fri, 30 Aug 2013 16:14:28 +0200 Subject: [PATCH 02/16] - disable parallel tests on s390(x) --- hdf5.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hdf5.spec b/hdf5.spec index 99a4ae4..c3251af 100644 --- a/hdf5.spec +++ b/hdf5.spec @@ -4,7 +4,7 @@ # You need to recompile all users of HDF5 for each version change Name: hdf5 Version: 1.8.10 -Release: 4%{?dist} +Release: 5%{?dist} Summary: A general purpose library and file format for storing scientific data License: BSD Group: System Environment/Libraries @@ -256,6 +256,9 @@ EOF %check make -C build check +# disable parallel tests on s390(x) - something gets wrong in DNS resolver in glibc +# they are passed when run manually in mock +%ifnarch s390 s390x export HDF5_Make_Ignore=yes for mpi in %{mpi_list} do @@ -263,6 +266,7 @@ do make -C $mpi check module purge done +%endif %post -p /sbin/ldconfig @@ -386,6 +390,9 @@ done %changelog +* Fri Aug 30 2013 Dan Horák - 1.8.10-5 +- disable parallel tests on s390(x) + * Wed Jul 24 2013 Deji Akingunola - 1.8.10-4 - Rename mpich2 sub-packages to mpich and rebuild for mpich-3.0 From 286a97d467fc8f72182c66026f5cc1f857d6167f Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Tue, 4 Feb 2014 14:28:49 -0700 Subject: [PATCH 03/16] - Use parallel make - Limit number of processors to 4 in parallel tests to avoid mpich issue with oversubscription --- hdf5.spec | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hdf5.spec b/hdf5.spec index 862404f..1f3d190 100644 --- a/hdf5.spec +++ b/hdf5.spec @@ -7,7 +7,7 @@ # You need to recompile all users of HDF5 for each version change Name: hdf5 Version: 1.8.12 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A general purpose library and file format for storing scientific data License: BSD Group: System Environment/Libraries @@ -181,7 +181,7 @@ ln -s ../configure . %configure \ %{configure_opts} \ --enable-cxx -make +make %{?_smp_mflags} popd #MPI builds @@ -203,7 +203,7 @@ do --includedir=%{_includedir}/$mpi-%{_arch} \ --datarootdir=%{_libdir}/$mpi/share \ --mandir=%{_libdir}/$mpi/share/man - make + make %{?_smp_mflags} module purge popd done @@ -261,6 +261,8 @@ cp -p debian/man/*.1 ${RPM_BUILD_ROOT}%{_mandir}/man1/ %check make -C build check +# Limit to 4 processors to try to avoid oversubscribing +export NPROCS=4 # disable parallel tests on s390(x) - something gets wrong in DNS resolver in glibc # they are passed when run manually in mock %ifnarch s390 s390x @@ -404,6 +406,11 @@ done %changelog +* Tue Feb 4 2014 Orion Poplawski 1.8.12-5 +- Use parallel make +- Limit number of processors to 4 in parallel tests to avoid mpich issue with + oversubscription + * Fri Jan 31 2014 Orion Poplawski 1.8.12-4 - Fix rpm macros install dir From c96d985588b68f6e7628a0672ff48cb22181d4eb Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 5 Feb 2014 11:11:24 -0700 Subject: [PATCH 04/16] Enable mpich on RHEL7 --- hdf5.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hdf5.spec b/hdf5.spec index 1f3d190..1efba98 100644 --- a/hdf5.spec +++ b/hdf5.spec @@ -28,9 +28,9 @@ BuildRequires: openssh-clients %global with_mpich 1 %global with_openmpi 1 -%if 0%{?rhel} +%if 0%{?rhel} <= 6 %ifarch ppc64 -# No mpich2 on ppc64 in EL +% No mpich2 on ppc64 in EL6 %global with_mpich 0 %endif %endif From 149f02baf0b8ff02d7ba790e1ef8f2c45a631080 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Thu, 6 Feb 2014 18:15:30 -0700 Subject: [PATCH 05/16] Work around a bug in mpich when hostname is not resovable --- hdf5.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hdf5.spec b/hdf5.spec index 1efba98..422f983 100644 --- a/hdf5.spec +++ b/hdf5.spec @@ -188,6 +188,8 @@ popd export CC=mpicc export CXX=mpicxx export F9X=mpif90 +# Work around a bug in mpich when hostname is not resovable +export RUNPARALLEL="mpiexec -np 4 -host localhost" for mpi in %{mpi_list} do mkdir $mpi From 0d21f90329cbee5e1095d2c5c78aaaee8e1e0331 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 4 Mar 2015 13:25:47 -0700 Subject: [PATCH 06/16] Change LD_LIBRARY_PATH patch to change configure.ac/Makefile.am since we are running autoreconf now --- hdf5-LD_LIBRARY_PATH.patch | 41 ++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/hdf5-LD_LIBRARY_PATH.patch b/hdf5-LD_LIBRARY_PATH.patch index f34ea69..e4025c1 100644 --- a/hdf5-LD_LIBRARY_PATH.patch +++ b/hdf5-LD_LIBRARY_PATH.patch @@ -1,20 +1,28 @@ -diff -up hdf5-1.8.10/configure.LD_LIBRARY_PATH hdf5-1.8.10/configure ---- hdf5-1.8.10/configure.LD_LIBRARY_PATH 2012-10-26 18:14:59.000000000 -0600 -+++ hdf5-1.8.10/configure 2012-11-14 08:56:52.695024834 -0700 -@@ -27496,9 +27496,6 @@ if ${hdf5_cv_printf_ll+:} false; then : - $as_echo_n "(cached) " >&6 - else - +--- hdf5-1.8.12/configure.ac.LD_LIBRARY_PATH 2015-03-04 13:20:53.164831682 -0700 ++++ hdf5-1.8.12/configure.ac 2015-03-04 13:23:17.852904172 -0700 +@@ -2342,14 +2342,9 @@ + ## Try to figure out how to print `long long'. Some machines use `%lld' + ## and others use `%qd'. There may be more! The final `l' is a + ## default in case none of the others work. +-## Need to patch up LD_LIBRARY_PATH so that the execution can find all +-## the dynamic library. The correct way to do it should be updating +-## LD_LIBRARY_PATH along with LDFLAGS or do it with the AC_TRY_RUN macro. + ## + AC_MSG_CHECKING([how to print long long]) + AC_CACHE_VAL([hdf5_cv_printf_ll], [ -LD_LIBRARY_PATH="$LD_LIBRARY_PATH`echo $AM_LDFLAGS $LDFLAGS | sed -e 's/-L/:/g' -e 's/ //g'`" -export LD_LIBRARY_PATH -- + for hdf5_cv_printf_ll in l ll L q unknown; do - if test "$cross_compiling" = yes; then : - continue -diff -up hdf5-1.8.10/src/Makefile.in.LD_LIBRARY_PATH hdf5-1.8.10/src/Makefile.in ---- hdf5-1.8.10/src/Makefile.in.LD_LIBRARY_PATH 2012-10-26 18:14:55.000000000 -0600 -+++ hdf5-1.8.10/src/Makefile.in 2012-11-14 08:55:35.197476914 -0700 -@@ -1327,8 +1327,6 @@ help: + AC_TRY_RUN([ +--- hdf5-1.8.12/src/Makefile.am.LD_LIBRARY_PATH 2013-11-21 08:13:52.000000000 -0700 ++++ hdf5-1.8.12/src/Makefile.am 2015-03-04 13:22:19.355266916 -0700 +@@ -122,25 +122,17 @@ + settings_DATA=libhdf5.settings + + # Number format detection +-# The LD_LIBRARY_PATH setting is a kludge. +-# Things should have been all set during H5detect making. # Remove the generated .c file if errors occur unless HDF5_Make_Ignore # is set to ignore the error. H5Tinit.c: H5detect$(EXEEXT) @@ -23,7 +31,10 @@ diff -up hdf5-1.8.10/src/Makefile.in.LD_LIBRARY_PATH hdf5-1.8.10/src/Makefile.in $(RUNSERIAL) ./H5detect$(EXEEXT) > $@ || \ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ ($(RM) $@ ; exit 1) -@@ -1339,8 +1337,6 @@ H5Tinit.c: H5detect$(EXEEXT) + + # Build configuration header file generation +-# The LD_LIBRARY_PATH setting is a kludge. +-# Things should have been all set during H5make_libsettings making. # Remove the generated .c file if errors occur unless HDF5_Make_Ignore # is set to ignore the error. H5lib_settings.c: H5make_libsettings$(EXEEXT) libhdf5.settings From ba659edf4a537d394bc753ce33babc537ee75e13 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 9 Dec 2015 21:45:25 -0700 Subject: [PATCH 07/16] Rebuild with openmpi 1.10.0 --- hdf5.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hdf5.spec b/hdf5.spec index 236ceb2..241cd1c 100644 --- a/hdf5.spec +++ b/hdf5.spec @@ -7,7 +7,7 @@ # You need to recompile all users of HDF5 for each version change Name: hdf5 Version: 1.8.12 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A general purpose library and file format for storing scientific data License: BSD Group: System Environment/Libraries @@ -419,6 +419,9 @@ done %changelog +* Wed Dec 9 2015 Orion Poplawski - 1.8.12-7 +- Rebuild with openmpi 1.10.0 + * Wed Mar 4 2015 Orion Poplawski - 1.8.12-6 - Add patch to add ppc64le to config.guess (bug #1080122) - Add patch to fix long double conversions on ppc64le (bug #1078173) From 8e69ef8615774ff2abb26eb4c0d693d0353287f9 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 9 Dec 2015 21:46:17 -0700 Subject: [PATCH 08/16] Add bug # --- hdf5.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hdf5.spec b/hdf5.spec index 241cd1c..3a2fc2b 100644 --- a/hdf5.spec +++ b/hdf5.spec @@ -420,7 +420,7 @@ done %changelog * Wed Dec 9 2015 Orion Poplawski - 1.8.12-7 -- Rebuild with openmpi 1.10.0 +- Rebuild with openmpi 1.10.0 (bug #1290286) * Wed Mar 4 2015 Orion Poplawski - 1.8.12-6 - Add patch to add ppc64le to config.guess (bug #1080122) From 92a96b1f666d72abb0127d07bc14c07f2763687f Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Thu, 15 Dec 2016 11:04:44 -0700 Subject: [PATCH 09/16] Add upstream patch to fix various Talos CVEs (bug #1397715) Conflicts: hdf5.spec --- hdf5.spec | 8 +- hdf51.8-CVE2016.patch | 280 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 287 insertions(+), 1 deletion(-) create mode 100644 hdf51.8-CVE2016.patch diff --git a/hdf5.spec b/hdf5.spec index 3a2fc2b..bc04847 100644 --- a/hdf5.spec +++ b/hdf5.spec @@ -7,7 +7,7 @@ # You need to recompile all users of HDF5 for each version change Name: hdf5 Version: 1.8.12 -Release: 7%{?dist} +Release: 8%{?dist} Summary: A general purpose library and file format for storing scientific data License: BSD Group: System Environment/Libraries @@ -26,6 +26,8 @@ Patch2: hdf5-aarch64.patch Patch3: hdf5-ldouble-ppc64le.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1080122 Patch4: hdf5-ppc64le.patch +# Upstream patch for various Talos CVEs +Patch5: https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/talospatch/hdf51.8-CVE2016.patch BuildRequires: krb5-devel, openssl-devel, zlib-devel, gcc-gfortran, time # For patches/rpath @@ -161,6 +163,7 @@ HDF5 parallel openmpi static libraries %patch2 -p1 -b .aarch64 %patch3 -p1 -b .ldouble-ppc64le %patch4 -p1 -b .ppc64le +%patch5 -p0 -b .CVE #This should be fixed in 1.8.7 find \( -name '*.[ch]*' -o -name '*.f90' -o -name '*.txt' \) -exec chmod -x {} + autoreconf -f -i @@ -419,6 +422,9 @@ done %changelog +* Thu Dec 15 2016 Orion Poplawski - 1.8.12-8 +- Add upstream patch to fix various Talos CVEs (bug #1397716) + * Wed Dec 9 2015 Orion Poplawski - 1.8.12-7 - Rebuild with openmpi 1.10.0 (bug #1290286) diff --git a/hdf51.8-CVE2016.patch b/hdf51.8-CVE2016.patch new file mode 100644 index 0000000..da34e62 --- /dev/null +++ b/hdf51.8-CVE2016.patch @@ -0,0 +1,280 @@ +diff --git src/H5Ocache.c src/H5Ocache.c +index 9057223..2aaf933 100644 +--- src/H5Ocache.c ++++ src/H5Ocache.c +@@ -1134,6 +1134,10 @@ H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image, + HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "bad flag combination for message") + if((flags & H5O_MSG_FLAG_WAS_UNKNOWN) && !(flags & H5O_MSG_FLAG_MARK_IF_UNKNOWN)) + HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "bad flag combination for message") ++ if((flags & H5O_MSG_FLAG_SHAREABLE) ++ && H5O_msg_class_g[id] ++ && !(H5O_msg_class_g[id]->share_flags & H5O_SHARE_IS_SHARABLE)) ++ HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "message of unsharable class flagged as sharable") + + /* Reserved bytes/creation index */ + if(oh->version == H5O_VERSION_1) +diff --git src/H5Odtype.c src/H5Odtype.c +index 622a18e..67f2fca 100644 +--- src/H5Odtype.c ++++ src/H5Odtype.c +@@ -310,7 +310,11 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p + if(version == H5O_DTYPE_VERSION_1) { + /* Decode the number of dimensions */ + ndims = *(*pp)++; +- HDassert(ndims <= 4); ++ ++ /* Check that ndims is valid */ ++ if(ndims > 4) ++ HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "invalid number of dimensions for array") ++ + *pp += 3; /*reserved bytes */ + + /* Skip dimension permutation */ +@@ -518,7 +522,8 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p + dt->shared->u.array.ndims = *(*pp)++; + + /* Double-check the number of dimensions */ +- HDassert(dt->shared->u.array.ndims <= H5S_MAX_RANK); ++ if(dt->shared->u.array.ndims > H5S_MAX_RANK) ++ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "too many dimensions for array datatype") + + /* Skip reserved bytes, if version has them */ + if(version < H5O_DTYPE_VERSION_3) +diff --git src/H5Opkg.h src/H5Opkg.h +index ff52537..2c8c5a0 100644 +--- src/H5Opkg.h ++++ src/H5Opkg.h +@@ -201,6 +201,7 @@ + \ + /* Set the message's "shared info", if it's shareable */ \ + if((MSG)->flags & H5O_MSG_FLAG_SHAREABLE) { \ ++ HDassert(msg_type->share_flags & H5O_SHARE_IS_SHARABLE); \ + H5O_UPDATE_SHARED((H5O_shared_t *)(MSG)->native, H5O_SHARE_TYPE_HERE, (F), msg_type->id, (MSG)->crt_idx, (OH)->chunk[0].addr) \ + } /* end if */ \ + \ +diff --git src/H5Znbit.c src/H5Znbit.c +index 38610b6..ddcf8fd 100644 +--- src/H5Znbit.c ++++ src/H5Znbit.c +@@ -60,11 +60,11 @@ static void H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_of + unsigned char *buffer, size_t *j, int *buf_len, unsigned size); + static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p); +-static void H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset, ++static herr_t H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); +-static void H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_offset, ++static herr_t H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); +-static void H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, ++static herr_t H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, + const unsigned parms[]); + static void H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, unsigned size); +@@ -897,7 +897,8 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for nbit decompression") + + /* decompress the buffer */ +- H5Z_nbit_decompress(outbuf, d_nelmts, (unsigned char *)*buf, cd_values); ++ if(H5Z__nbit_decompress(outbuf, d_nelmts, (unsigned char *)*buf, cd_values) < 0) ++ HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, 0, "can't decompress buffer") + } /* end if */ + /* output; compress */ + else { +@@ -1046,12 +1047,15 @@ H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, + } + } + +-static void +-H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset, ++static herr_t ++H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]) + { + unsigned i, total_size, base_class, base_size, n, begin_index; + parms_atomic p; ++ herr_t ret_value = SUCCEED; /* Return value */ ++ ++ FUNC_ENTER_STATIC + + total_size = parms[parms_index++]; + base_class = parms[parms_index++]; +@@ -1062,7 +1066,12 @@ H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset, + p.order = parms[parms_index++]; + p.precision = parms[parms_index++]; + p.offset = parms[parms_index++]; +- n = total_size/p.size; ++ ++ /* Check values of precision and offset */ ++ if(p.precision > p.size * 8 || (p.precision + p.offset) > p.size * 8) ++ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "invalid datatype precision/offset") ++ ++ n = total_size / p.size; + for(i = 0; i < n; i++) + H5Z_nbit_decompress_one_atomic(data, data_offset + i*p.size, + buffer, j, buf_len, p); +@@ -1072,8 +1081,9 @@ H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset, + n = total_size/base_size; /* number of base_type elements inside the array datatype */ + begin_index = parms_index; + for(i = 0; i < n; i++) { +- H5Z_nbit_decompress_one_array(data, data_offset + i*base_size, +- buffer, j, buf_len, parms); ++ if(H5Z__nbit_decompress_one_array(data, data_offset + i * base_size, ++ buffer, j, buf_len, parms) < 0) ++ HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress array") + parms_index = begin_index; + } + break; +@@ -1082,8 +1092,9 @@ H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset, + n = total_size/base_size; /* number of base_type elements inside the array datatype */ + begin_index = parms_index; + for(i = 0; i < n; i++) { +- H5Z_nbit_decompress_one_compound(data, data_offset + i*base_size, +- buffer, j, buf_len, parms); ++ if(H5Z__nbit_decompress_one_compound(data, data_offset + i * base_size, ++ buffer, j, buf_len, parms) < 0) ++ HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress compound") + parms_index = begin_index; + } + break; +@@ -1094,51 +1105,76 @@ H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset, + default: + HDassert(0 && "This Should never be executed!"); + } /* end switch */ ++ ++done: ++ FUNC_LEAVE_NOAPI(ret_value) + } + +-static void +-H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_offset, ++static herr_t ++H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]) + { +- unsigned i, nmembers, member_offset, member_class, size; ++ unsigned i, nmembers, member_offset, member_class, member_size, used_size = 0, size; + parms_atomic p; ++ herr_t ret_value = SUCCEED; /* Return value */ + +- parms_index++; /* skip total size of compound datatype */ ++ FUNC_ENTER_STATIC ++ ++ size = parms[parms_index++]; + nmembers = parms[parms_index++]; + + for(i = 0; i < nmembers; i++) { + member_offset = parms[parms_index++]; + member_class = parms[parms_index++]; ++ ++ /* Check for overflow */ ++ member_size = parms[parms_index]; ++ used_size += member_size; ++ if(used_size > size) ++ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "compound member offset overflowed compound size") + switch(member_class) { + case H5Z_NBIT_ATOMIC: +- p.size = parms[parms_index++]; ++ p.size = member_size; ++ /* Advance past member size */ ++ parms_index++; + p.order = parms[parms_index++]; + p.precision = parms[parms_index++]; + p.offset = parms[parms_index++]; ++ ++ /* Check values of precision and offset */ ++ if(p.precision > p.size * 8 || (p.precision + p.offset) > p.size * 8) ++ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "invalid datatype precision/offset") ++ + H5Z_nbit_decompress_one_atomic(data, data_offset + member_offset, + buffer, j, buf_len, p); + break; + case H5Z_NBIT_ARRAY: +- H5Z_nbit_decompress_one_array(data, data_offset + member_offset, +- buffer, j, buf_len, parms); ++ if(H5Z__nbit_decompress_one_array(data, data_offset + member_offset, ++ buffer, j, buf_len, parms) < 0) ++ HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress array") + break; + case H5Z_NBIT_COMPOUND: +- H5Z_nbit_decompress_one_compound(data, data_offset+member_offset, +- buffer, j, buf_len, parms); ++ if(H5Z__nbit_decompress_one_compound(data, data_offset+member_offset, ++ buffer, j, buf_len, parms) < 0) ++ HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress compound") + break; + case H5Z_NBIT_NOOPTYPE: +- size = parms[parms_index++]; ++ /* Advance past member size */ ++ parms_index++; + H5Z_nbit_decompress_one_nooptype(data, data_offset+member_offset, +- buffer, j, buf_len, size); ++ buffer, j, buf_len, member_size); + break; + default: + HDassert(0 && "This Should never be executed!"); + } /* end switch */ + } ++ ++done: ++ FUNC_LEAVE_NOAPI(ret_value) + } + +-static void +-H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, ++static herr_t ++H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, + const unsigned parms[]) + { + /* i: index of data, j: index of buffer, +@@ -1146,6 +1182,9 @@ H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffe + size_t i, j, size; + int buf_len; + parms_atomic p; ++ herr_t ret_value = SUCCEED; /* Return value */ ++ ++ FUNC_ENTER_STATIC + + /* may not have to initialize to zeros */ + for(i = 0; i < d_nelmts*parms[4]; i++) data[i] = 0; +@@ -1161,6 +1200,11 @@ H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffe + p.order = parms[5]; + p.precision = parms[6]; + p.offset = parms[7]; ++ ++ /* Check values of precision and offset */ ++ if(p.precision > p.size * 8 || (p.precision + p.offset) > p.size * 8) ++ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "invalid datatype precision/offset") ++ + for(i = 0; i < d_nelmts; i++) { + H5Z_nbit_decompress_one_atomic(data, i*p.size, buffer, &j, &buf_len, p); + } +@@ -1169,7 +1213,8 @@ H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffe + size = parms[4]; + parms_index = 4; + for(i = 0; i < d_nelmts; i++) { +- H5Z_nbit_decompress_one_array(data, i*size, buffer, &j, &buf_len, parms); ++ if(H5Z__nbit_decompress_one_array(data, i*size, buffer, &j, &buf_len, parms) < 0) ++ HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress array") + parms_index = 4; + } + break; +@@ -1177,13 +1222,17 @@ H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffe + size = parms[4]; + parms_index = 4; + for(i = 0; i < d_nelmts; i++) { +- H5Z_nbit_decompress_one_compound(data, i*size, buffer, &j, &buf_len, parms); ++ if(H5Z__nbit_decompress_one_compound(data, i*size, buffer, &j, &buf_len, parms) < 0) ++ HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress compound") + parms_index = 4; + } + break; + default: + HDassert(0 && "This Should never be executed!"); + } /* end switch */ ++ ++done: ++ FUNC_LEAVE_NOAPI(ret_value) + } + + static void H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, From a6dc238336b71e63902a24605593fceb412b8e5a Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Tue, 15 Aug 2017 10:54:14 -0600 Subject: [PATCH 10/16] enable szip support through libaec --- hdf5.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hdf5.spec b/hdf5.spec index bc04847..4fb09db 100644 --- a/hdf5.spec +++ b/hdf5.spec @@ -7,7 +7,7 @@ # You need to recompile all users of HDF5 for each version change Name: hdf5 Version: 1.8.12 -Release: 8%{?dist} +Release: 9%{?dist} Summary: A general purpose library and file format for storing scientific data License: BSD Group: System Environment/Libraries @@ -35,6 +35,7 @@ BuildRequires: automake BuildRequires: libtool # Needed for mpi tests BuildRequires: openssh-clients +BuildRequires: libaec-devel %global with_mpich 1 %global with_openmpi 1 @@ -70,6 +71,7 @@ grids. You can also mix and match them in HDF5 files according to your needs. Summary: HDF5 development files Group: Development/Libraries Requires: %{name} = %{version}-%{release} +Requires: libaec-devel%{?_isa} Requires: zlib-devel %description devel @@ -179,6 +181,7 @@ autoreconf -f -i --enable-fortran2003 \\\ --enable-hl \\\ --enable-shared \\\ + --with-szlib \\\ %{nil} # --enable-cxx and --enable-parallel flags are incompatible # --with-mpe=DIR Use MPE instrumentation [default=no] @@ -422,6 +425,9 @@ done %changelog +* Tue Aug 15 2017 Christoph Junghans - 1.8.12-9 +- enable szip support through libaec + * Thu Dec 15 2016 Orion Poplawski - 1.8.12-8 - Add upstream patch to fix various Talos CVEs (bug #1397716) From b2141638381d00355dba2dc186cb2f2f771e5598 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Thu, 17 Aug 2017 11:52:56 -0600 Subject: [PATCH 11/16] Fixup mpi-devel package requires --- hdf5.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hdf5.spec b/hdf5.spec index 4fb09db..b029f03 100644 --- a/hdf5.spec +++ b/hdf5.spec @@ -72,7 +72,7 @@ Summary: HDF5 development files Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: libaec-devel%{?_isa} -Requires: zlib-devel +Requires: zlib-devel%{?_isa} %description devel HDF5 development headers and libraries. @@ -103,7 +103,9 @@ HDF5 parallel mpich libraries Summary: HDF5 mpich development files Group: Development/Libraries Requires: %{name}-mpich%{?_isa} = %{version}-%{release} -Requires: mpich +Requires: libaec-devel%{?_isa} +Requires: zlib-devel%{?_isa} +Requires: mpich-devel%{?_isa} Provides: %{name}-mpich2-devel = %{version}-%{release} Obsoletes: %{name}-mpich2-devel < 1.8.11-4 @@ -138,7 +140,9 @@ HDF5 parallel openmpi libraries Summary: HDF5 openmpi development files Group: Development/Libraries Requires: %{name}-openmpi%{_isa} = %{version}-%{release} -Requires: openmpi-devel +Requires: libaec-devel%{?_isa} +Requires: zlib-devel%{?_isa} +Requires: openmpi-devel%{?_isa} %description openmpi-devel HDF5 parallel openmpi development files From 7b71654b92bd1169b6263043dcd43927efd7f830 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Tue, 22 Aug 2017 15:41:19 -0600 Subject: [PATCH 12/16] RHEL doesn't provide mpich-devel%{_isa} --- hdf5.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hdf5.spec b/hdf5.spec index b029f03..cd0292b 100644 --- a/hdf5.spec +++ b/hdf5.spec @@ -7,7 +7,7 @@ # You need to recompile all users of HDF5 for each version change Name: hdf5 Version: 1.8.12 -Release: 9%{?dist} +Release: 10%{?dist} Summary: A general purpose library and file format for storing scientific data License: BSD Group: System Environment/Libraries @@ -105,7 +105,8 @@ Group: Development/Libraries Requires: %{name}-mpich%{?_isa} = %{version}-%{release} Requires: libaec-devel%{?_isa} Requires: zlib-devel%{?_isa} -Requires: mpich-devel%{?_isa} +# RHEL doesn't provide with %{_isa} +Requires: mpich-devel Provides: %{name}-mpich2-devel = %{version}-%{release} Obsoletes: %{name}-mpich2-devel < 1.8.11-4 @@ -429,6 +430,9 @@ done %changelog +* Tue Aug 22 2017 Orion Poplawski - 1.8.12-10 +- RHEL doesn't provide mpich-devel%%{_isa} + * Tue Aug 15 2017 Christoph Junghans - 1.8.12-9 - enable szip support through libaec From 8f36faddbd8ebd5a872c522154ce9533bd4742df Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Tue, 7 May 2019 21:02:50 -0600 Subject: [PATCH 13/16] Build an openmpi3 version on el7 --- hdf5.spec | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 74 insertions(+), 2 deletions(-) diff --git a/hdf5.spec b/hdf5.spec index cd0292b..adc23f9 100644 --- a/hdf5.spec +++ b/hdf5.spec @@ -7,7 +7,7 @@ # You need to recompile all users of HDF5 for each version change Name: hdf5 Version: 1.8.12 -Release: 10%{?dist} +Release: 11%{?dist} Summary: A general purpose library and file format for storing scientific data License: BSD Group: System Environment/Libraries @@ -54,9 +54,11 @@ BuildRequires: libaec-devel %global mpi_list mpich %endif %if %{with_openmpi} -%global mpi_list %{?mpi_list} openmpi +%global mpi_list %{?mpi_list} openmpi %{?el7:openmpi3} %endif +%{?el7:%global ompi3 1} + %description HDF5 is a general purpose library and file format for storing scientific data. HDF5 can store two primary objects: datasets and groups. A dataset is @@ -156,6 +158,38 @@ Requires: %{name}-openmpi-devel%{?_isa} = %{version}-%{release} %description openmpi-static HDF5 parallel openmpi static libraries + +%if 0%{?ompi3} +%package openmpi3 +Summary: HDF5 openmpi3 libraries +Group: Development/Libraries +Requires: openmpi3 +BuildRequires: openmpi3-devel + +%description openmpi3 +HDF5 parallel openmpi3 libraries + + +%package openmpi3-devel +Summary: HDF5 openmpi3 development files +Group: Development/Libraries +Requires: %{name}-openmpi3%{_isa} = %{version}-%{release} +Requires: libaec-devel%{?_isa} +Requires: zlib-devel%{?_isa} +Requires: openmpi3-devel%{?_isa} + +%description openmpi3-devel +HDF5 parallel openmpi3 development files + + +%package openmpi3-static +Summary: HDF5 openmpi3 static libraries +Group: Development/Libraries +Requires: %{name}-openmpi3-devel%{?_isa} = %{version}-%{release} + +%description openmpi3-static +HDF5 parallel openmpi3 static libraries +%endif %endif @@ -426,10 +460,48 @@ done %files openmpi-static %{_libdir}/openmpi/lib/*.a + +%if 0%{?ompi3} +%files openmpi3 +%doc COPYING MANIFEST README.txt release_docs/RELEASE.txt +%doc release_docs/HISTORY*.txt +%{_libdir}/openmpi3/bin/gif2h5 +%{_libdir}/openmpi3/bin/h52gif +%{_libdir}/openmpi3/bin/h5copy +%{_libdir}/openmpi3/bin/h5debug +%{_libdir}/openmpi3/bin/h5diff +%{_libdir}/openmpi3/bin/h5dump +%{_libdir}/openmpi3/bin/h5import +%{_libdir}/openmpi3/bin/h5jam +%{_libdir}/openmpi3/bin/h5ls +%{_libdir}/openmpi3/bin/h5mkgrp +%{_libdir}/openmpi3/bin/h5perf +%{_libdir}/openmpi3/bin/h5perf_serial +%{_libdir}/openmpi3/bin/h5redeploy +%{_libdir}/openmpi3/bin/h5repack +%{_libdir}/openmpi3/bin/h5repart +%{_libdir}/openmpi3/bin/h5stat +%{_libdir}/openmpi3/bin/h5unjam +%{_libdir}/openmpi3/bin/ph5diff +%{_libdir}/openmpi3/lib/*.so.* + +%files openmpi3-devel +%{_includedir}/openmpi3-%{_arch} +%{_libdir}/openmpi3/bin/h5pcc +%{_libdir}/openmpi3/bin/h5pfc +%{_libdir}/openmpi3/lib/lib*.so +%{_libdir}/openmpi3/lib/lib*.settings + +%files openmpi3-static +%{_libdir}/openmpi3/lib/*.a +%endif %endif %changelog +* Sun Apr 28 2019 Dave Love - 1.8.12-11 +- Build an openmpi3 version on el7 + * Tue Aug 22 2017 Orion Poplawski - 1.8.12-10 - RHEL doesn't provide mpich-devel%%{_isa} From eab17a925299ee32d3b76eb950341ad0f8397276 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 8 May 2019 12:36:37 -0600 Subject: [PATCH 14/16] No openmpi3 for ppc64 --- hdf5.spec | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/hdf5.spec b/hdf5.spec index adc23f9..00fbff2 100644 --- a/hdf5.spec +++ b/hdf5.spec @@ -39,25 +39,23 @@ BuildRequires: libaec-devel %global with_mpich 1 %global with_openmpi 1 -%if 0%{?rhel} <= 6 + %ifarch ppc64 -% No mpich2 on ppc64 in EL6 -%global with_mpich 0 -%endif -%endif -%ifarch s390 s390x -# No openmpi on s390(x) -%global with_openmpi 0 +# No openmpi3 on ppc64 +%global with_openmpi3 0 +%else +%global with_openmpi3 1 %endif %if %{with_mpich} %global mpi_list mpich %endif %if %{with_openmpi} -%global mpi_list %{?mpi_list} openmpi %{?el7:openmpi3} +%global mpi_list %{?mpi_list} openmpi +%endif +%if 0%{?with_openmpi3} +%global mpi_list %{?mpi_list} openmpi3 %endif - -%{?el7:%global ompi3 1} %description HDF5 is a general purpose library and file format for storing scientific data. @@ -159,7 +157,7 @@ Requires: %{name}-openmpi-devel%{?_isa} = %{version}-%{release} %description openmpi-static HDF5 parallel openmpi static libraries -%if 0%{?ompi3} +%if 0%{?with_openmpi3} %package openmpi3 Summary: HDF5 openmpi3 libraries Group: Development/Libraries @@ -461,7 +459,7 @@ done %files openmpi-static %{_libdir}/openmpi/lib/*.a -%if 0%{?ompi3} +%if 0%{?with_openmpi3} %files openmpi3 %doc COPYING MANIFEST README.txt release_docs/RELEASE.txt %doc release_docs/HISTORY*.txt From dd4311a91110f77c2e688acbfb7fd1ab7e5d2195 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Mon, 25 Jan 2021 19:08:20 -0700 Subject: [PATCH 15/16] Drop compiling with -O0 --- hdf5.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hdf5.spec b/hdf5.spec index 00fbff2..745cec6 100644 --- a/hdf5.spec +++ b/hdf5.spec @@ -7,7 +7,7 @@ # You need to recompile all users of HDF5 for each version change Name: hdf5 Version: 1.8.12 -Release: 11%{?dist} +Release: 12%{?dist} Summary: A general purpose library and file format for storing scientific data License: BSD Group: System Environment/Libraries @@ -228,7 +228,6 @@ autoreconf -f -i export CC=gcc export CXX=g++ export F9X=gfortran -export CFLAGS="${RPM_OPT_FLAGS/O2/O0}" mkdir build pushd build ln -s ../configure . @@ -497,6 +496,9 @@ done %changelog +* Tue Jan 26 2021 Orion Poplawski - 1.8.12-12 +- Drop compiling with -O0 + * Sun Apr 28 2019 Dave Love - 1.8.12-11 - Build an openmpi3 version on el7 From 593c3ccc3f53f712678d7cdac5ef607464cb85b7 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Sun, 26 Jan 2020 19:17:09 -0700 Subject: [PATCH 16/16] Remove Fedora build flags from h5cc/h5c++/h5fc (bz#1980549) --- hdf5-wrappers.patch | 109 ++++++++++++++++++++++++++++++++++++++++++++ hdf5.spec | 9 +++- 2 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 hdf5-wrappers.patch diff --git a/hdf5-wrappers.patch b/hdf5-wrappers.patch new file mode 100644 index 0000000..bcda52d --- /dev/null +++ b/hdf5-wrappers.patch @@ -0,0 +1,109 @@ +diff -up hdf5-1.8.12/c++/src/h5c++.in.wrappers hdf5-1.8.12/c++/src/h5c++.in +--- hdf5-1.8.12/c++/src/h5c++.in.wrappers 2013-11-21 08:14:01.000000000 -0700 ++++ hdf5-1.8.12/c++/src/h5c++.in 2021-09-15 20:14:40.123641057 -0600 +@@ -89,10 +89,10 @@ CXXLINKERBASE="@CXX@" + # paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in + # from the hdf5 build. The order of the flags is intended to give precedence + # to the user's flags. +-H5BLD_CXXFLAGS="@AM_CXXFLAGS@ @CXXFLAGS@" ++H5BLD_CXXFLAGS= + H5BLD_CPPFLAGS="@AM_CPPFLAGS@ @CPPFLAGS@" +-H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@" +-H5BLD_LIBS="@LIBS@" ++H5BLD_LDFLAGS= ++H5BLD_LIBS= + + CXX="${HDF5_CXX:-$CXXBASE}" + CXXLINKER="${HDF5_CLINKER:-$CXXLINKERBASE}" +@@ -105,7 +105,8 @@ LIBS="${HDF5_LIBS:-$LIBSBASE}" + # available library is shared, it will be used by default. The user can + # override either default, although choosing an unavailable library will result + # in link errors. +-STATIC_AVAILABLE="@enable_static@" ++# Fedora prefers shared libraries ++STATIC_AVAILABLE=no + if test "${STATIC_AVAILABLE}" = "yes"; then + USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" + else +@@ -387,7 +388,7 @@ if test "x$do_link" = "xyes"; then + # from the hdf5 build. The order of the flags is intended to give precedence + # to the user's flags. + +- $SHOW $CXXLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CXXFLAGS $CXXFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link ++ $SHOW $CXXLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CXXFLAGS $CXXFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args + + status=$? + fi +diff -up hdf5-1.8.12/fortran/src/h5fc.in.wrappers hdf5-1.8.12/fortran/src/h5fc.in +--- hdf5-1.8.12/fortran/src/h5fc.in.wrappers 2013-11-21 08:14:04.000000000 -0700 ++++ hdf5-1.8.12/fortran/src/h5fc.in 2021-09-15 20:14:40.123641057 -0600 +@@ -85,11 +85,11 @@ FLINKERBASE="@FC@" + # libraries in $link_args, followed by any external library paths and libraries + # from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in from the hdf5 build. + # The order of the flags is intended to give precedence to the user's flags. +-H5BLD_FCFLAGS="@AM_FCFLAGS@ @FCFLAGS@" ++H5BLD_FCFLAGS= + F9XMODFLAG="@F9XMODFLAG@" + F9XSUFFIXFLAG="@F9XSUFFIXFLAG@" +-H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@" +-H5BLD_LIBS="@LIBS@" ++H5BLD_LDFLAGS= ++H5BLD_LIBS= + + FC="${HDF5_FC:-$FCBASE}" + FLINKER="${HDF5_FLINKER:-$FLINKERBASE}" +@@ -101,7 +101,8 @@ LIBS="${HDF5_LIBS:-$LIBSBASE}" + # available library is shared, it will be used by default. The user can + # override either default, although choosing an unavailable library will result + # in link errors. +-STATIC_AVAILABLE="@enable_static@" ++# Fedora prefers shared libraries ++STATIC_AVAILABLE=no + if test "${STATIC_AVAILABLE}" = "yes"; then + USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" + else +@@ -365,7 +366,7 @@ if test "x$do_link" = "xyes"; then + # libraries in $link_args, followed by any external library paths and libraries + # from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in from the hdf5 build. + # The order of the flags is intended to give precedence to the user's flags. +- $SHOW $FLINKER $FCFLAGS $H5BLD_FCFLAGS $F9XSUFFIXFLAG $LDFLAGS $fmodules $link_objs $LIBS $link_args $shared_link ++ $SHOW $FLINKER $FCFLAGS $H5BLD_FCFLAGS $F9XSUFFIXFLAG $LDFLAGS $fmodules $link_objs $LIBS $link_args + status=$? + fi + +diff -up hdf5-1.8.12/tools/misc/h5cc.in.wrappers hdf5-1.8.12/tools/misc/h5cc.in +--- hdf5-1.8.12/tools/misc/h5cc.in.wrappers 2013-11-21 08:13:59.000000000 -0700 ++++ hdf5-1.8.12/tools/misc/h5cc.in 2021-09-15 20:14:40.123641057 -0600 +@@ -91,10 +91,10 @@ CLINKERBASE="@CC@" + # paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in + # from the hdf5 build. The order of the flags is intended to give precedence + # to the user's flags. +-H5BLD_CFLAGS="@AM_CFLAGS@ @CFLAGS@" ++H5BLD_CFLAGS= + H5BLD_CPPFLAGS="@AM_CPPFLAGS@ @CPPFLAGS@" +-H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@" +-H5BLD_LIBS="@LIBS@" ++H5BLD_LDFLAGS= ++H5BLD_LIBS= + + CC="${HDF5_CC:-$CCBASE}" + CLINKER="${HDF5_CLINKER:-$CLINKERBASE}" +@@ -107,7 +107,8 @@ LIBS="${HDF5_LIBS:-$LIBSBASE}" + # available library is shared, it will be used by default. The user can + # override either default, although choosing an unavailable library will result + # in link errors. +-STATIC_AVAILABLE="@enable_static@" ++# Fedora prefers shared libraries ++STATIC_AVAILABLE=no + if test "${STATIC_AVAILABLE}" = "yes"; then + USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" + else +@@ -394,7 +395,7 @@ if test "x$do_link" = "xyes"; then + # paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in + # from the hdf5 build. The order of the flags is intended to give precedence + # to the user's flags. +- $SHOW $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link ++ $SHOW $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args + status=$? + fi + diff --git a/hdf5.spec b/hdf5.spec index 745cec6..1b92f69 100644 --- a/hdf5.spec +++ b/hdf5.spec @@ -7,7 +7,7 @@ # You need to recompile all users of HDF5 for each version change Name: hdf5 Version: 1.8.12 -Release: 12%{?dist} +Release: 13%{?dist} Summary: A general purpose library and file format for storing scientific data License: BSD Group: System Environment/Libraries @@ -28,6 +28,9 @@ Patch3: hdf5-ldouble-ppc64le.patch Patch4: hdf5-ppc64le.patch # Upstream patch for various Talos CVEs Patch5: https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/talospatch/hdf51.8-CVE2016.patch +# Remove Fedora build flags from h5cc/h5c++/h5fc +# https://bugzilla.redhat.com/show_bug.cgi?id=1794625 +Patch6: hdf5-wrappers.patch BuildRequires: krb5-devel, openssl-devel, zlib-devel, gcc-gfortran, time # For patches/rpath @@ -203,6 +206,7 @@ HDF5 parallel openmpi3 static libraries %patch3 -p1 -b .ldouble-ppc64le %patch4 -p1 -b .ppc64le %patch5 -p0 -b .CVE +%patch6 -p1 -b .wrappers #This should be fixed in 1.8.7 find \( -name '*.[ch]*' -o -name '*.f90' -o -name '*.txt' \) -exec chmod -x {} + autoreconf -f -i @@ -496,6 +500,9 @@ done %changelog +* Wed Sep 15 2021 Orion Poplawski - 1.8.12-13 +- Remove Fedora build flags from h5cc/h5c++/h5fc (bz#1980549) + * Tue Jan 26 2021 Orion Poplawski - 1.8.12-12 - Drop compiling with -O0