http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57652

            Bug ID: 57652
           Summary: [4.7/4.8/4.9 Regression] collect2 does not clean up
                    temporary files
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dje at gcc dot gnu.org

The 2011-05-19 change to convert collect2 to use the common diagnostics
infrastructure broke collect2's handling of temporary files.  The original
error reporting routines reported the error message and, IMPORTANTLY, called
collect_exit(). collect_exit() removes temporary files through multiple
invocations of maybe_unlink().

The change to invoke fatal_error() in GCC's diagnostics.c directly terminates
without cleaning up the temporary files. This leaves at least 5 temporary files
in /tmp for each link step that results in an error message.  When using GNU
configure to probe system features, this creates numerous temporary files.

For example,

$ cat foo.c
int main () {}
$ gcc foo.c -lnonexistent
collect2: fatal error: library libnonexistent not found
compilation terminated.
$ ls /tmp/cc*
/tmp/cc0IcxVL.c   /tmp/ccKwuh03.x   /tmp/ccqMJsFn.le
/tmp/cc2taIMJ.ld  /tmp/cceKTq5n.o

Reply via email to