public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* java/4027: gcj-3.0 fails to compile main class files with package declaration
@ 2001-08-14 22:26 walters
  0 siblings, 0 replies; 2+ messages in thread
From: walters @ 2001-08-14 22:26 UTC (permalink / raw)
  To: gcc-gnats, debian-gcc; +Cc: 108730

>Number:         4027
>Category:       java
>Synopsis:       gcj-3.0 fails to compile programs with package declaration
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 14 22:26:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Colin Walters
>Release:        3.0.1 20010811 (Debian prerelease) (Debian testing/unstable)
>Organization:
>Environment:
System: Linux space-ghost 2.4.8-pre3+ipsec+xfs #3 Sun Aug 5 04:19:42 EDT 2001 ppc unknown
Architecture: ppc

-- System Information
Debian Release: testing/unstable
Kernel Version: Linux space-ghost 2.4.8-pre3+ipsec+xfs #3 Sun Aug 5 04:19:42 EDT 2001 ppc unknown

Versions of the packages gcj-3.0 depends on:
ii  gcc-3.0        3.0.1-0pre0108 The GNU C compiler.
ii  gcc-3.0-base   3.0.1-0pre0108 The GNU Compiler Collection (base package).
ii  java-common    0.7            Base of all Java packages
ii  libc6          2.2.3-6        GNU C Library: Shared libraries and Timezone
ii  libgcj2-dev    3.0.1-0pre0108 Java development headers and static library 
ii  zlib1g         1.1.3-15       compression library - runtime

host: powerpc-unknown-linux-gnu
build: powerpc-unknown-linux-gnu
target: powerpc-unknown-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc powerpc-linux
>Description:
 GCJ-3.0 fails to compile simple java programs whose main class
 file has a package declaration

>How-To-Repeat:

Here's a file Test.java:

,----[ Test.java ]
| package gnu.foo;
| 
| class Test {
|     public static void main(String[] args) {
| 	System.out.println("Hello, World!");
|     }
| }
`----

Compiling it fails like:

,----[ *compilation** ]
| gcj-3.0 -o Test --main=Test Test.java
| /tmp/cctAs4jG.o: In function `main':
| /tmp/ccvuhFZz.i(.text+0x2e): undefined reference to `Test::class$'
| /tmp/ccvuhFZz.i(.text+0x32): undefined reference to `Test::class$'
| collect2: ld returned 1 exit status
`----

>Fix:
 If I remove the package declaration, everything seems to work
 fine.  I've experienced this with larger packages; I believe it's
 just having a package declaration in the file with the "main" function
 that causes a failure.
>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: java/4027: gcj-3.0 fails to compile main class files with package declaration
@ 2001-08-14 22:36 Alexandre Petit-Bianco
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Petit-Bianco @ 2001-08-14 22:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR java/4027; it has been noted by GNATS.

From: Alexandre Petit-Bianco <apbianco@cygnus.com>
To: walters@cis.ohio-state.edu, gcc-gnats@gcc.gnu.org,
        debian-gcc@lists.debian.org, 108730@bugs.debian.org
Cc:  
Subject: Re: java/4027: gcj-3.0 fails to compile main class files with package declaration
Date: Tue, 14 Aug 2001 22:35:16 -0700 (PDT)

 walters@cis.ohio-state.edu writes:
 
 > | gcj-3.0 -o Test --main=Test Test.java
 
 Try:
 
   gcj-3.0 -o Test --main=gnu.foo.Test Test.java
 
 intead.
 
 ./A


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

end of thread, other threads:[~2001-08-14 22:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-14 22:26 java/4027: gcj-3.0 fails to compile main class files with package declaration walters
2001-08-14 22:36 Alexandre Petit-Bianco

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).