testsuite: fix compiler vendor detection on dash as /bin/sh (#594)
authorSergei Trofimovich <slyfox@gentoo.org>
Wed, 24 Mar 2021 23:19:54 +0000 (23:19 +0000)
committerGitHub <noreply@github.com>
Wed, 24 Mar 2021 23:19:54 +0000 (19:19 -0400)
In https://bugs.gentoo.org/753299 Paolo Pedroni reported
a single test failure out of all libffi. Here is the minimal
reproducer:

```
$ ./autogen
$ CONFIG_SHELL=/bin/dash ./configure --host=x86_64-pc-linux-gnu
$ make check RUNTESTFLAGS='complex.exp'
...
FAIL: libffi.complex/cls_align_complex_float.c (test for excess errors)
```

This happens because under 'dash' shell autoconf generates slightly
different style of string quotation in `config.log`:

- on bash: `ax_cv_c_compiler_vendor=gnu`
- on dash: `ax_cv_c_compiler_vendor='gnu'`

To avoid shell quotation parsing the change just embeds
`compiler_vendor` into `local.exp` at configure time.

Reported-by: Paolo Pedroni
Bug: https://bugs.gentoo.org/753299
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
configure.ac
testsuite/lib/libffi.exp

index 0f141f48bb95a45766437f7147b6993a240bdbb0..a9b7bf6a39daccf1add826b9fc803f7e1b92f9a7 100644 (file)
@@ -59,6 +59,7 @@ fi
 cat > local.exp <<EOF
 set CC_FOR_TARGET "$CC"
 set CXX_FOR_TARGET "$CXX"
+set compiler_vendor "$ax_cv_c_compiler_vendor"
 EOF
 
 AM_MAINTAINER_MODE
index d3c17db485a332623d7b16572ee1794cb73155e8..4f4dd48d2c61b06629059ae1c77a2b3347b57f15 100644 (file)
@@ -292,9 +292,6 @@ proc libffi-init { args } {
     verbose "libffi $blddirffi"
 
     # Which compiler are we building with?
-    set tmp [grep "$blddirffi/config.log" "^ax_cv_c_compiler_vendor.*$"]
-    regexp -- {^[^=]*=(.*)$} $tmp nil compiler_vendor
-
     if { [string match $compiler_vendor "gnu"] } {
         set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
         if {$gccdir != ""} {