Bug 28329

Summary: [ecj] gcj leaves .jar and .zip files in /tmp
Product: gcc Reporter: Tom Tromey <tromey>
Component: javaAssignee: Tom Tromey <tromey>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs, java-prs
Priority: P3    
Version: 4.2.0   
Target Milestone: 4.3.0   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2006-07-12 19:29:29
Bug Depends on:    
Bug Blocks: 28067    

Description Tom Tromey 2006-07-10 19:35:28 UTC
This only happens with the gcj on the gcj-eclipse branch.

Doing a build with the new gcj leaves many .zip and .jar files
in /tmp.  This is probably a bug in java/lang-specs.h, but could
also be a bug in gcc.c.
Comment 1 Ranjit Mathew 2006-07-11 01:20:03 UTC
Perhaps the "%d" string was omitted in the relevant specs:

  http://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html

Just guessing.
Comment 2 Tom Tromey 2006-07-11 19:28:31 UTC
%U implies %d

I debugged today and set a breakpoint in delete_if_ordinary.
I get this:

Breakpoint 1, delete_if_ordinary (
    name=0x9af48c0 "-fzip-dependency=/tmp/ccQurYQS.zip")
    at ../../trunk/gcc/gcc.c:2349

So the problem seems to be that gcc.c assumes that %U is only used
as a standalone argument.  This makes sense, so the fix, I think, is
to change the specs to pass this argument standalone somewhere.
Comment 3 Tom Tromey 2006-07-12 19:29:29 UTC
testing a patch
Comment 4 Tom Tromey 2006-07-12 20:01:55 UTC
Subject: Bug 28329

Author: tromey
Date: Wed Jul 12 20:01:47 2006
New Revision: 115396

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115396
Log:
	PR java/28329:
	* lang-specs.h: Pass '%U'-based options as separate arguments.
	Use -faux-classpath.
	* lang.c (java_handle_option): Handle OPT_faux_classpath.
	* lang.opt (faux-classpath): New option.

Modified:
    branches/gcj-eclipse/gcc/java/ChangeLog
    branches/gcj-eclipse/gcc/java/lang-specs.h
    branches/gcj-eclipse/gcc/java/lang.c
    branches/gcj-eclipse/gcc/java/lang.opt

Comment 5 Tom Tromey 2006-07-12 20:06:57 UTC
Fixed on branch.