Commit e3eaa609882fbcffb6c1b21270b6ff46fb57699f

Hans 2022-09-19T23:26:59

Suppress error console output duing configure in case not an ELF file (#729) On Cygwin, MSYS and MinGW readelf is available, but files generated are no ELF files. This results in an Error output on console: 'checking whether .eh_frame section should be read-only... readelf: Error: Not an ELF file - it has the wrong magic bytes at the start yes' With this patch the error output is suppressed resulting in only 'checking whether .eh_frame section should be read-only... yes' Setting of related variables is not changed. Co-authored-by: Hannes Müller <>

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/configure.ac b/configure.ac
index ed394c9..0ac8b76 100644
--- a/configure.ac
+++ b/configure.ac
@@ -294,7 +294,7 @@ if test "x$GCC" = "xyes"; then
   	libffi_cv_ro_eh_frame=yes
   	echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
   	if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then
-	    if $READELF -WS conftest.o | grep -q -n 'eh_frame .* WA'; then
+	    if $READELF -WS conftest.o 2>/dev/null | grep -q -n 'eh_frame .* WA'; then
 	        libffi_cv_ro_eh_frame=no
 	    fi
   	fi