Patchwork RISC-V: Fix `test' operand error with soft-float ABI being configured

login
register
mail settings
Submitter Maciej Rozycki
Date March 29, 2019, 12:42 a.m.
Message ID <alpine.DEB.2.20.1903271407380.17164@tpp>
Download mbox | patch
Permalink /patch/32057/
State New
Headers show

Comments

Maciej Rozycki - March 29, 2019, 12:42 a.m.
From: Maciej W. Rozycki <macro@wdc.com>

Fix a:

.../sysdeps/unix/sysv/linux/riscv/configure: line 181: test: =: unary operator expected

message produced by the RISC-V configure fragment with the soft-float 
ABI selected, caused by $libc_cv_riscv_float_abi evaluating to nil in 
the invocation of `test $libc_cv_riscv_float_abi = no'.

	* sysdeps/unix/sysv/linux/riscv/configure.ac: Quote 
	$libc_cv_riscv_float_abi in `test' invocation.
	* sysdeps/unix/sysv/linux/riscv/configure: Regenerate.
---
Hi,

 NB my WDC copyright assignment with FSF hasn't been sorted yet, however 
this change, being under 15 lines, falls into the legally-insignificant 
category I believe, and therefore should be OK to apply right away.

 I believe it is obviously correct as well, and therefore I will commit it 
shortly.  The change has been verified by reconfiguring glibc and ensuring 
that the message has gone away.

  Maciej

---
 sysdeps/unix/sysv/linux/riscv/configure    |    2 +-
 sysdeps/unix/sysv/linux/riscv/configure.ac |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

glibc-riscv-configure-float-abi.diff

Patch

Index: glibc/sysdeps/unix/sysv/linux/riscv/configure
===================================================================
--- glibc.orig/sysdeps/unix/sysv/linux/riscv/configure
+++ glibc/sysdeps/unix/sysv/linux/riscv/configure
@@ -178,7 +178,7 @@  if (eval "$ac_cpp conftest.$ac_ext") 2>&
 fi
 rm -f conftest*
 
-if test $libc_cv_riscv_float_abi = no; then
+if test "$libc_cv_riscv_float_abi" = no; then
   as_fn_error $? "Unable to determine floating-point ABI" "$LINENO" 5
 fi
 
Index: glibc/sysdeps/unix/sysv/linux/riscv/configure.ac
===================================================================
--- glibc.orig/sysdeps/unix/sysv/linux/riscv/configure.ac
+++ glibc/sysdeps/unix/sysv/linux/riscv/configure.ac
@@ -20,7 +20,7 @@  AC_EGREP_CPP(yes, [#ifdef __riscv_float_
 		   yes
 		   #endif
   ],libc_cv_riscv_float_abi=)
-if test $libc_cv_riscv_float_abi = no; then
+if test "$libc_cv_riscv_float_abi" = no; then
   AC_MSG_ERROR([Unable to determine floating-point ABI])
 fi