From 13356d153443c2c836ae64f1049b0f43c0949775 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 20 May 2024 03:52:02 -0700 Subject: [PATCH 1/2] Revert "Remove Autotools sed hack (#3848)" This reverts commit 8b3ffdef3099d2699ec71a5f855966132b3d3c25. --- configure.ac | 6 ++++++ release_docs/RELEASE.txt | 10 ---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index e4201bb0824..00b4fd55d70 100644 --- a/configure.ac +++ b/configure.ac @@ -4613,5 +4613,11 @@ if test "X$HDF_FORTRAN" = "Xyes"; then esac fi +## HDF5 configure code created by autotools with gcc 4.9.2 is adding problematic +## linker flags: -l with no library name; -l , specifically gfortran or m. +## This sed script corrects "-l " first and then "-l " with no library name. +## If the order is not preserved, all instances of "-l " will be removed. +sed -e '/^postdeps/ s/-l \([a-zA-Z]\)/-l\1/g' -e '/^postdeps/ s/-l //g' -i libtool + ## show the configure settings cat src/libhdf5.settings diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d53877c80ce..157e956996c 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1701,16 +1701,6 @@ Bug Fixes since HDF5-1.14.0 release * HDF5_ENABLE_DOXY_WARNINGS: ON/OFF (Default: OFF) * --enable-doxygen-errors: enable/disable (Default: disable) - - Removed an Autotools configure hack that causes problems on MacOS - - A sed line in configure.ac was added in the past to paper over some - problems with older versions of the Autotools that would add incorrect - linker flags. This hack is not needed with recent versions of the - Autotools and the sed line errors on MacOS (though this was a silent - error that didn't break the build) so the hack has been removed. - - Fixes GitHub issue #3843 - - Fixed an issue where the h5tools_test_utils test program was being installed on the system for Autotools builds of HDF5 From 62898227fc9ace37d20d2422cfb8d3f53e146f9f Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 20 May 2024 04:46:49 -0700 Subject: [PATCH 2/2] Fix libtool sed cleanup on MacOS Convert sed -i line to sed > libtool.bak && mv libtool.bak libtool to avoid non-portable -i option. --- configure.ac | 3 ++- release_docs/RELEASE.txt | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 00b4fd55d70..7b8c25c79cc 100644 --- a/configure.ac +++ b/configure.ac @@ -4617,7 +4617,8 @@ fi ## linker flags: -l with no library name; -l , specifically gfortran or m. ## This sed script corrects "-l " first and then "-l " with no library name. ## If the order is not preserved, all instances of "-l " will be removed. -sed -e '/^postdeps/ s/-l \([a-zA-Z]\)/-l\1/g' -e '/^postdeps/ s/-l //g' -i libtool +sed -e '/^postdeps/ s/-l \([a-zA-Z]\)/-l\1/g' -e '/^postdeps/ s/-l //g' libtool > libtool.bak +mv -- libtool.bak libtool ## show the configure settings cat src/libhdf5.settings diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 157e956996c..3fab61f4548 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1674,6 +1674,22 @@ Bug Fixes since HDF5-1.14.0 release Configuration ------------- + - Fixed/reverted an Autotools configure hack that causes problems on MacOS + + A sed line in configure.ac was added in the past to paper over some + problems with older versions of the Autotools that would add incorrect + linker flags. This used the -i option in a way that caused silent + errors on MacOS that did not break the build. + + The original fix for this problem (in 1.14.4) removed the sed line + entirely, but it turns out that the sed cleanup is still necessary + on some systems, where empty -l options will be added to the libtool + script. + + This sed line has been restored and reworked to not use -i. + + Fixes GitHub issues #3843 and #4448 + - Fixed a list index out of range issue in the runTest.cmake file Fixed an issue in config/cmake/runTest.cmake where the CMake logic