public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/53982] New: gij built for x32 can't run a simple Hello World class
@ 2012-07-16 14:18 dschepler at gmail dot com
  2012-07-16 14:53 ` [Bug java/53982] " hjl.tools at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dschepler at gmail dot com @ 2012-07-16 14:18 UTC (permalink / raw)
  To: java-prs

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

             Bug #: 53982
           Summary: gij built for x32 can't run a simple Hello World class
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: java
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dschepler@gmail.com


Built and installed gcc from hjl/x32/gcc-4_7-branch (in a test chroot), after
running "git merge origin/branches/gcc-4_7-branch", using
../src/configure --prefix=/usr --with-abi=mx32 --enable-languages=c,c++,java

With this configuration, I imported a HelloWorld.class file built outside the
chroot (since "gcj -C HelloWorld.java" inside the chroot complains about
missing ecj1), and tried running "gij HelloWorld".  This gave an error:
Exception in thread "main" java.lang.NullPointerException
   at java.lang.String.charAt(libgcj.so.13)
   at gnu.gcj.convert.Output_ASCII.write(libgcj.so.13)
   at java.io.PrintStream.writeChars(libgcj.so.13)
   at java.io.PrintStream.print(libgcj.so.13)
   at java.io.PrintStream.println(libgcj.so.13)
   at HelloWorld.main(HelloWorld.java:3)

The Java source is just the prototypical Java hello-world example:
public class HelloWorld {
    public static void main(String args[]) {
        System.out.println("Hello World!");
    }
}

On the other hand, if I compile the .class file into a native executable using
"gcj -O2 HelloWorld.class --main=HelloWorld -o ./HelloWorld"
then that executable runs just fine.

But I'm not entirely convinced gcj-compiled native executables work without
problems, either.  For example, with ecj compiled from the Debian libecj-java
binary package's jar file into native code, I can run gcj -C HelloWorld.java OK
in the Debian x32 chroot I'm bootstrapping.  But on most source packages of any
size, it bails out sooner or later with a heap corruption message
ecj1: arena.c:661: heap_trim: Assertion `p->size == (0|0x1)' failed.
gcj-4.7: internal compiler error: Aborted (program ecj1)


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-07-18 19:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-16 14:18 [Bug java/53982] New: gij built for x32 can't run a simple Hello World class dschepler at gmail dot com
2012-07-16 14:53 ` [Bug java/53982] " hjl.tools at gmail dot com
2012-07-16 15:54 ` dschepler at gmail dot com
2012-07-16 16:05 ` dschepler at gmail dot com
2012-07-16 20:15 ` hjl.tools at gmail dot com
2012-07-18 19:13 ` hjl.tools at gmail dot com
2012-07-18 19:20 ` hjl at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).