[libgfortran,patch] Add compiler check when configuring libgfortran

François-Xavier Coudert fxcoudert@gmail.com
Tue Jan 9 11:57:00 GMT 2007


:ADDPATCH libgfortran:

Attached patch fixes a long-standing bug in libgfortran configury by
adding an explicit check that we have a working gfortran compiler, and
otherwise error out. Without this patch, a miscompiled (or mislinked)
gfortran will only induce an error late in the libgfortran build, and
with a very cryptic error message (see PR 26893 for details). With
this patch, a non usable compiler will yield the following error
message:

checking whether the GNU Fortran compiler is working... no
configure: error: GNU Fortran is not working; please report a bug in
http://gcc.gnu.org/bugzilla, attaching
/home/fxcoudert/svn/debug3/ibin/i686-pc-linux-gnu/libgfortran/config.log


Bootstrapped and tested on i686-linux. OK for mainline? Would it be OK
to backport this to 4.2, a few weeks after it has been commited to
mainline? (I think it's an annoying bug for users compiling on unusual
platforms or using unusual configurations).

PS: To generate a non-working compiler, I used the following patch to
make gfortran abort when called:

Index: svn/trunk3/gcc/fortran/parse.c
===================================================================
--- svn/trunk3/gcc/fortran/parse.c      (revision 120585)
+++ svn/trunk3/gcc/fortran/parse.c      (working copy)
@@ -28,6 +28,10 @@
 #include "match.h"
 #include "parse.h"

+#include <sys/types.h>
+#include <signal.h>
+#include <unistd.h>
+
 /* Current statement label.  Zero means no statement label.  Because
    new_st can get wiped during statement matching, we have to keep it
    separate.  */
@@ -3175,6 +3179,8 @@

   seen_program = 0;

+  kill (getpid (), SIGQUIT);
+
   /* Exit early for empty files.  */
   if (gfc_at_eof ())
     goto done;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compiler_check.ChangeLog
Type: application/octet-stream
Size: 220 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070109/a1cc21ba/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compiler_check.diff
Type: text/x-patch
Size: 1325 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070109/a1cc21ba/attachment.bin>


More information about the Gcc-patches mailing list