Remove Fedora build flags from h5cc/h5c++/h5fc (bz#1980549)

This commit is contained in:
Orion Poplawski 2020-01-26 19:17:09 -07:00
parent dd4311a911
commit 593c3ccc3f
2 changed files with 117 additions and 1 deletions

109
hdf5-wrappers.patch Normal file
View File

@ -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

View File

@ -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 <orion@nwra.com> - 1.8.12-13
- Remove Fedora build flags from h5cc/h5c++/h5fc (bz#1980549)
* Tue Jan 26 2021 Orion Poplawski <orion@nwra.com> - 1.8.12-12
- Drop compiling with -O0