Bug 40888 - gcj -C has problems with clone()
Summary: gcj -C has problems with clone()
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-28 11:51 UTC by Andrew John Hughes
Modified: 2009-07-28 11:51 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew John Hughes 2009-07-28 11:51:55 UTC
When trying to use gcj -C instead of a symlink to ecj as gcj's javac (with options appropriately changed with a script), I ran across an interesting issue building OpenJDK:
gcj -C -g     -d lib/hotspot-tools     -fsource=1.5     -I'hotspot-tools:/home/andrew/projects/openjdk/icedtea/netx:/mnt/builder/icedtea/generated:openjdk/jdk/src/share/classes:openjdk/jdk/src/solaris/classes:openjdk/langtools/src/share/classes:openjdk/jaxp/src/share/classes:openjdk/corba/src/share/classes:openjdk/jaxws/src/share/classes'     -bootclasspath \'\' -w @hotspot-tools-source-files.txt

(-w added so the errors aren't lost in 12k+ warnings)

hotspot-tools/com/sun/codemodel/internal/JClass.java:269: error: The constructor JNarrowedClass(JClass, List<Object>) is \
undefined
        return new JNarrowedClass(this,Arrays.asList(clazz.clone()));
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
hotspot-tools/com/sun/tools/javac/code/Scope.java:138: error: The constructor Scope(Scope, Symbol, Object) is undefined
        return new Scope(this, this.owner, this.table.clone());
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
hotspot-tools/com/sun/tools/javac/code/Scope.java:490: error: The constructor Scope.ErrorScope(Scope.ErrorScope, Symbol, \
Object) is undefined
        return new ErrorScope(this, owner, table.clone());
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
hotspot-tools/com/sun/tools/javac/jvm/Code.java:1608: error: Type mismatch: cannot convert from Object to Type[]
        state.stack = stack.clone();

There are 146 of these errors, all seem to be related to clone().  They don't occur when using gij to run ecj, either the system copy or the one used by gcj (from sourceware.org):

/home/andrew/build/gcj/bin/gij -cp /home/andrew/projects/classpath/gcj/dependencies/ecj.jar org.eclipse.jdt.internal.compiler.batch.Main  -g     -d lib/hotspot-tools     -source 1.5     -sourcepath       'hotspot-tools:/home/andrew/projects/openjdk/icedtea/netx:/mnt/builder/icedtea/generated:openjdk/jdk/src/share/classes:openjdk/jdk/src/solaris/classes:openjdk/langtools/src/share/classes:openjdk/jaxp/src/share/classes:openjdk/corba/src/share/classes:openjdk/jaxws/src/share/classes'     -bootclasspath \'\' @hotspot-tools-source-files.txt
... some time later...
21808 problems (21808 warnings)

Am I translating some of the arguments correctly?  If I instead turn sourcepath into -fsourcepath, it fails immediately as it is unable to locate java.lang.Object.  The same occurs if -bootclasspath \'\' is removed.