Am Freitag, den 01.07.2005, 13:46 +0200 schrieb Matthias Klose:
August Mayer writes:
If libgcj4-dev is installed, the program compiles, but then crashes when
trying to execute the program.
byte-compiling (-C) works without the -dev package.
But compilation to native (without -C) produces faulty executables, and
the error message is very strange and non-informative (just segfaults in
the bytecode verifier)
The same is true for gcj-3.3 also, conversely. If libgcj6-dev is installed,
programs compiled with gcj-3.3 will crash too. I believe this is because
the program links against the wrong version of /usr/lib/libgcj.so .
please be more specific, i.e. send a sequence of commands, and/or
example files. compiling works for me.
(Note: Only relevant output is shown; also, packages are taken from
unstable, version 4.0.0-11. Note also how gcj-4.0 links against
libgcj.so.4 when libgcj4-dev is installed, and conversely how gcj-3.3
links against libgcj.so.6 when libgcj6-dev is installed.)
$ apt-get install gcj-4.0
$ apt-get install gcj
< Installs gcj-3.3 etc. >
$ cat HalloWelt.java
public
class HalloWelt
{
public static
void main(String[] args)
{
System.out.println("Hallo Welt!");
}
}
$ gcj --main=HalloWelt HalloWelt.java -o HalloWelt
gcj: libgcj.spec: Datei oder Verzeichnis nicht gefunden
$ gcj-4.0 --main=HalloWelt HalloWelt.java -o HalloWelt
gcj-4.0: libgcj.spec: Datei oder Verzeichnis nicht gefunden
$ apt-get install libgcj-dev
< installs libgcj-dev, libgcj4-dev, libgcj4-awt >
$ gcj --main=HalloWelt HalloWelt.java -o HalloWelt
$ ./HalloWelt
Hallo Welt!
$ gcj-4.0 --main=HalloWelt HalloWelt.java -o HalloWelt
$ ./HalloWelt
?
$ ldd HalloWelt
linux-gate.so.1 => (0xffffe000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7fcc000)
libgcj.so.4 => /usr/lib/libgcj.so.4 (0xb77fd000)
libm.so.6 => /lib/tls/libm.so.6 (0xb77da000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb77c9000)
libz.so.1 => /usr/lib/libz.so.1 (0xb77b7000)
libdl.so.2 => /lib/tls/libdl.so.2 (0xb77b4000)
libc.so.6 => /lib/tls/libc.so.6 (0xb7699000)
/lib/ld-linux.so.2 (0xb7fea000)
$ apt-get install libgcj6-dev
< Package version 4.0.0-11 correctly removes libgcj4-dev >
$ gcj-4.0 --main=HalloWelt HalloWelt.java -o HalloWelt
$ ./HalloWelt
Hallo Welt!
$ gcj --main=HalloWelt HalloWelt.java -o HalloWelt
$ ./HalloWelt
Aborted
$ ldd HalloWelt
linux-gate.so.1 => (0xffffe000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7fcc000)
libgcj.so.6 => /usr/lib/libgcj.so.6 (0xb6f01000)
libm.so.6 => /lib/tls/libm.so.6 (0xb6ede000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb6ecd000)
libz.so.1 => /usr/lib/libz.so.1 (0xb6ebb000)
libdl.so.2 => /lib/tls/libdl.so.2 (0xb6eb8000)
libc.so.6 => /lib/tls/libc.so.6 (0xb6d9d000)
/lib/ld-linux.so.2 (0xb7fea000)
--
August Mayer, M.Sc - http://purl.org/net/amayer/
Student of Applied Computer Science, University of Salzburg
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]