configure warning on cygwin

Eric Blake
Fri Jun 1 09:47:00 GMT 2007

readelf doesn't do auto-exe magic on cygwin, which results in an ugly message 
to stderr in the middle of configure:

checking for .preinit_array/.init_array/.fini_array support... readelf: Error: 
Input file 'conftest' is not readable.

My first thought was to use $(EXEEXT) to work around readelf's need for an 
explicit extension.  But since cygwin executables aren't elf in the first 
place, and since EXEEXT is intentionally left undefined while configuring 
newlib because of cross-compiler bootstrap issues, it is easier (and still 
gives the correct result) to just squelch the message.

OK to apply?

2007-05-31  Eric Blake  <>

	* (libc_cv_initfinit_array): Silence error on

RCS file: /cvs/src/src/newlib/,v
retrieving revision 1.37
diff -u -p -b -r1.37
---	24 May 2007 17:33:30 -0000	1.37
+++	31 May 2007 21:50:33 -0000
@@ -381,7 +381,7 @@ EOF
 if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest conftest.c
 		   -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD])
-  if ${READELF} -S conftest | grep -e INIT_ARRAY > /dev/null; then
+  if ${READELF} -S conftest 2>/dev/null | grep -e INIT_ARRAY > /dev/null; then

More information about the Newlib mailing list