This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

java/1629: gcj link problem with a simple program

>Number:         1629
>Category:       java
>Synopsis:       gcj link problem with a simple program
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 12 02:26:01 PST 2001
>Release:        2.97 20010111 (experimental)
Ericsson SoftLab
System: Linux robyn 2.4.0-test11 #1 Wed Dec 6 20:52:57 CET 2000 i686 unknown
Architecture: i686

host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../configure --prefix=/softlab/robyn/Linux/epkg/gcc-20010111 --enable-threads=posix --enable-shared --enable-languages=c++,java --disable-new-gxx-abi --with-gnu-as --with-gnu-ld
	I get the following link error message when compiling a
simple program with the current cvs version of gcj: undefined
reference to `Client::class$'.


> CLASSPATH=.. gcj -v -save-temps --main=Client        
Reading specs from /softlab/robyn/Linux/epkg/gcc-20010111/lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
Reading specs from /softlab/robyn/Linux/epkg/gcc-20010111/lib/gcc-lib/i686-pc-linux-gnu/2.97/../../../libgcj.specrename spec lib to liborig
rename spec startfile to startfileorig
Configured with: ../configure --prefix=/softlab/robyn/Linux/epkg/gcc-20010111 --enable-threads=posix --enable-shared --enable-languages=c++,java --disable-new-gxx-abi --with-gnu-as --with-gnu-ld
gcc version 2.97 20010111 (experimental)
 /softlab/robyn/Linux/epkg/gcc-20010111/lib/gcc-lib/i686-pc-linux-gnu/2.97/jc1 -fno-use-divide-subroutine -fuse-boehm-gc -fasynchronous-exceptions -quiet -dumpbase -g1 -version -o Client.s
GNU Java version 2.97 20010111 (experimental) (i686-pc-linux-gnu)
	compiled by GNU C version 2.95.3 20010101 (prerelease).
 as -V -Qy -o Client.o Client.s
GNU assembler version 2.10.91 (i386-linux) using BFD version
 /softlab/robyn/Linux/epkg/gcc-20010111/lib/gcc-lib/i686-pc-linux-gnu/2.97/jvgenmain Client Clientmain.i
 /softlab/robyn/Linux/epkg/gcc-20010111/lib/gcc-lib/i686-pc-linux-gnu/2.97/cc1 Clientmain.i -quiet -dumpbase Client.c -g1 -version -fdollars-in-identifiers -o Clientmain.s
GNU CPP version 2.97 20010111 (experimental) (cpplib) (i386 Linux/ELF)
GNU C version 2.97 20010111 (experimental) (i686-pc-linux-gnu)
	compiled by GNU C version 2.95.3 20010101 (prerelease).
 as -V -Qy -o Clientmain.o Clientmain.s
GNU assembler version 2.10.91 (i386-linux) using BFD version
 /softlab/robyn/Linux/epkg/gcc-20010111/lib/gcc-lib/i686-pc-linux-gnu/2.97/collect2 -m elf_i386 -dynamic-linker /lib/ /usr/lib/crt1.o /usr/lib/crti.o /softlab/robyn/Linux/epkg/gcc-20010111/lib/gcc-lib/i686-pc-linux-gnu/2.97/crtbegin.o -u __rethrow -u __frame_state_for -lgcc -L/softlab/robyn/Linux/epkg/gcc-20010111/lib/gcc-lib/i686-pc-linux-gnu/2.97 -L/softlab/robyn/Linux/epkg/gcc-20010111/lib/gcc-lib/i686-pc-linux-gnu/2.97/../../.. Client.o Clientmain.o -lgcc -lgcj -lm -lgcjgc -lpthread -lzgcj -ldl -lc -lgcc /softlab/robyn/Linux/epkg/gcc-20010111/lib/gcc-lib/i686-pc-linux-gnu/2.97/crtend.o /usr/lib/crtn.o
Clientmain.o: In function `main':
/home/projects/joses/usr/patha/socketThreads/Clientmain.i(.text+0x1a): undefined reference to `Client::class$'
collect2: ld returned 1 exit status

########## ##########

package socketThreads;


public class Client extends Thread {     
    static final boolean debug = true;
    static final int serverPort = 4002;
    static final int msgLength = 15;
    static final int msgTotal = 10;
    static final int clients = 3;
    static final byte[] data = new byte[msgLength];
    final Socket socket;
    final OutputStream outputStream;
    final InputStream inputStream;
    final int number;

    Client(int number) {
        this.number = number;
        Socket s = null;
        OutputStream oS = null;
        InputStream iS = null;
        try {
            s = new Socket(InetAddress.getLocalHost(), serverPort);
            oS = s.getOutputStream();
            iS = s.getInputStream();
        } catch (Exception e) {
        } finally {
            socket = s;
            inputStream = iS;
            outputStream = oS;

    public final void run() {
        try {
            for (int b = 0; b < msgTotal; b++) {
                for (int i = 0; i < msgLength; i++)
                    data[i] = (byte)(b % 256);
                if (debug)
                    System.out.println("Client " + number + " read: "
                                       + data[0]);
        } catch (Exception e) {

    public static final void main(String args[]) {
        for (int i = 0; i < clients; i++) {
            new Client(i).start();
        System.out.println("Client closed.");


##########  Clientmain.i ##########

extern const char **_Jv_Compiler_Properties;
static const char *props[] =

extern int class __attribute__ ((alias ("_6Client.class$")));
int main (int argc, const char **argv)
   _Jv_Compiler_Properties = props;
   JvRunMain (&class, argc, argv);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]