From 122eae5a026c742a2a5edbbae1443c18a6e5529d Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sat, 31 May 2025 09:20:21 -0400 Subject: [PATCH 1/2] configury: remove whitespace from "conftestval"-style tests Several configure tests write integer result values to files and then do something like foo=$(cat conftestval). However, if the conftestval file contains whitespace around the integer value (e.g., if conftestval was written by a Fortran test code), then $foo will still contain that whitespace, too -- which then propagates throughout the configury and elsewhere. This commit uses xargs to strip off the whitespace. There's really only one place where this is happening that is a problem, but let's do it in all places where we foo=$(cat conftestval) with integer results, just as a matter of consistency and defensive programming. Thanks to Lisandro Dalcin for raising the issue. Signed-off-by: Jeff Squyres --- config/ompi_fortran_check_logical_array.m4 | 2 +- config/ompi_fortran_check_real16_c_equiv.m4 | 2 +- config/ompi_fortran_get_alignment.m4 | 2 +- config/ompi_fortran_get_sizeof.m4 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/ompi_fortran_check_logical_array.m4 b/config/ompi_fortran_check_logical_array.m4 index 7a6a6291548..3d2a6de48d8 100644 --- a/config/ompi_fortran_check_logical_array.m4 +++ b/config/ompi_fortran_check_logical_array.m4 @@ -101,7 +101,7 @@ EOF [ # assume we're ok value=yes], [OPAL_LOG_COMMAND([./conftest], - [if test "`cat conftestval`" = "1" ; then + [if test "`cat conftestval | xargs`" = "1" ; then value=yes else value=no diff --git a/config/ompi_fortran_check_real16_c_equiv.m4 b/config/ompi_fortran_check_real16_c_equiv.m4 index 3e39798d1c7..8ae47a0f081 100644 --- a/config/ompi_fortran_check_real16_c_equiv.m4 +++ b/config/ompi_fortran_check_real16_c_equiv.m4 @@ -141,7 +141,7 @@ EOF [AC_MSG_RESULT([Error!]) AC_MSG_ERROR([Can not determine if REAL*16 bit-matches C if cross compiling])], [OPAL_LOG_COMMAND([./conftest], - [fortran_real16_happy=`cat conftestval`], + [fortran_real16_happy=`cat conftestval | xargs`], [AC_MSG_RESULT([Error!]) AC_MSG_ERROR([Could not determine if REAL*16 bit-matches C type]) ]) diff --git a/config/ompi_fortran_get_alignment.m4 b/config/ompi_fortran_get_alignment.m4 index 9ccca2a22fb..59ed7467106 100644 --- a/config/ompi_fortran_get_alignment.m4 +++ b/config/ompi_fortran_get_alignment.m4 @@ -203,7 +203,7 @@ end program]])], [AS_IF([test "$cross_compiling" = "yes"], [AC_MSG_ERROR([Can not determine common alignment when cross-compiling])], [OPAL_LOG_COMMAND([./conftest], - [AS_VAR_SET(ompi_cv_fortran_common_alignment, [`cat conftestval`])], + [AS_VAR_SET(ompi_cv_fortran_common_alignment, [`cat conftestval | xargs`])], [AC_MSG_ERROR([Could not determine common alignment])])])], [AC_MSG_WARN([Could not determine common alignment]) diff --git a/config/ompi_fortran_get_sizeof.m4 b/config/ompi_fortran_get_sizeof.m4 index e25d982c58f..da597c921ff 100644 --- a/config/ompi_fortran_get_sizeof.m4 +++ b/config/ompi_fortran_get_sizeof.m4 @@ -79,7 +79,7 @@ EOF AS_IF([test "$cross_compiling" = "yes"], [AC_MSG_ERROR([Can not determine size of $2 when cross-compiling])], [OPAL_LOG_COMMAND([./conftest], - [AS_VAR_SET(type_var, [`cat conftestval`])], + [AS_VAR_SET(type_var, [`cat conftestval | xargs`])], [AC_MSG_ERROR([Could not determine size of $2])])]) unset happy ompi_conftest_h From 1a58617cae39066f49dbf192c48a81a5767400ed Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sat, 31 May 2025 09:23:12 -0400 Subject: [PATCH 2/2] configury: remove errant blank line No code or logic changes. Signed-off-by: Jeff Squyres --- config/ompi_fortran_get_alignment.m4 | 1 - 1 file changed, 1 deletion(-) diff --git a/config/ompi_fortran_get_alignment.m4 b/config/ompi_fortran_get_alignment.m4 index 59ed7467106..fef505885a0 100644 --- a/config/ompi_fortran_get_alignment.m4 +++ b/config/ompi_fortran_get_alignment.m4 @@ -216,5 +216,4 @@ end program]])], [AC_MSG_CHECKING([Fortran common alignment]) $1=0 AC_MSG_RESULT([skipped])]) - ])dnl