|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 | Next > |
|
|
libgcj_bc.so not embeddedHi list,
I've compiled succesfully a project (a number of JARs) into native library using GCJ 4.1 on Ubuntu 6.10 (Edgy). When I run it on a light-weight FC5 machine, I've getting the following error message: error while loading shared libraries libgcj_bc.so.1 Why this library is not embedded in my executable file? Thanks. |
|
|
Re: libgcj_bc.so not embeddedMohsen Saboorian writes:
> I've compiled succesfully a project (a number of JARs) into native > library using GCJ 4.1 on Ubuntu 6.10 (Edgy). When I run it on a > light-weight FC5 machine, I've getting the following error message: > > error while loading shared libraries libgcj_bc.so.1 > > Why this library is not embedded in my executable file? It's not supposed to be. The idea is that you compile your program and it dynamically links with the libgcj installed on the system. Andrew. -- Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK Registered in England and Wales No. 3798903 |
|
|
Re: libgcj_bc.so not embeddedThanks Andrew,
> It's not supposed to be. The idea is that you compile your program > and it dynamically links with the libgcj installed on the system. Then what happens for example in Windows, where there is no such linkable library. Is it possible to statically link my program with this .so file so that there would be an absolute stand-alone application? Thanks again. |
|
|
Re: libgcj_bc.so not embeddedMohsen Saboorian writes:
> > > It's not supposed to be. The idea is that you compile your program > > and it dynamically links with the libgcj installed on the system. > > Then what happens for example in Windows, where there is no such > linkable library. Is it possible to statically link my program with > this .so file so that there would be an absolute stand-alone > application? Not quite, but you can link using -static-libgcj. It doesn't work for all Java programs, and in general it's a bad idea. Why do you want to do this, anyway? Andrew. -- Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK Registered in England and Wales No. 3798903 |
|
|
Re: libgcj_bc.so not embedded> > > It's not supposed to be. The idea is that you compile your program
> > > and it dynamically links with the libgcj installed on the system. > > > > Then what happens for example in Windows, where there is no such > > linkable library. Is it possible to statically link my program with > > this .so file so that there would be an absolute stand-alone > > application? > > Not quite, but you can link using -static-libgcj. It doesn't work for > all Java programs, and in general it's a bad idea. Why do you want to > do this, anyway? I have a Java application and want to have it work on OLPC (laptop.org). OLPC uses a very light FC 5 I think, which doesn't have any GCJ library, since their main development environment is Python and JavaScript. I'll try -static-libgcj option to see if this works. Thanks. |
|
|
Re: libgcj_bc.so not embeddedMohsen Saboorian wrote:
>> > > It's not supposed to be. The idea is that you compile your program >> > > and it dynamically links with the libgcj installed on the system. >> > >> > Then what happens for example in Windows, where there is no such >> > linkable library. Is it possible to statically link my program with >> > this .so file so that there would be an absolute stand-alone >> > application? >> >> Not quite, but you can link using -static-libgcj. It doesn't work for >> all Java programs, and in general it's a bad idea. Why do you want to >> do this, anyway? > > I have a Java application and want to have it work on OLPC > (laptop.org). OLPC uses a very light FC 5 I think, which doesn't have > any GCJ library, since their main development environment is Python > and JavaScript. I'll try -static-libgcj option to see if this works. I already had static compiled SWT and Swing applications running on OLPC :-) Marco |
|
|
Re: libgcj_bc.so not embedded>
> I already had static compiled SWT and Swing applications running on OLPC :-) Macro, I was able to compile my app with GCJ 4.1 package on Ubuntu, but could not compile it with your GCJ distrib (for Linux). Don't know if you Linux GCJ should also be used along with GUI or not :) Thanks. |
|
|
Re: libgcj_bc.so not embeddedAndrew Haley wrote:
> Mohsen Saboorian writes: > > > > > It's not supposed to be. The idea is that you compile your program > > > and it dynamically links with the libgcj installed on the system. > > > > Then what happens for example in Windows, where there is no such > > linkable library. Is it possible to statically link my program with > > this .so file so that there would be an absolute stand-alone > > application? > > Not quite, but you can link using -static-libgcj. It doesn't work for > all Java programs, Which ones doesn't work? If you know how to manually add objects that are not referenced (and thus aren't pulled into the binary), then everything is fine. At least for me... > and in general it's a bad idea. Why do you want to > do this, anyway? There seem to be two different universes of GCJ users. Both do not understand why the other even exists. I also live in the one that only wants GCJ to create standalone binaries. I can't imagine a reason why to use GCJ as JVM... GCJ is (for me), good to: - get around the problem of telling users to install a JVM. If they have to install one anyway, why don't then just use one from Sun which has less bugs? - better protect the written code The only other place where GCJ becomes handy are embedded devices. Of course there you can't install a JVM either and need standalone binaries... There then come's the other problem of the huge binaries ;-) Just my 2cents... Marco |
|
|
|
|
|
Re: libgcj_bc.so not embeddedJ.C. Pizarro wrote:
> > Remember, Java is generated to C++ with gcj and compiled with g++. That is incorrect and always has been. gcj directly generates assembly code for the target processor, just like all the other GCC language frontends. David Daney |
|
|
Re: libgcj_bc.so not embedded2007/4/7, David Daney <ddaney@...>:
> J.C. Pizarro wrote: > > > > Remember, Java is generated to C++ with gcj and compiled with g++. > That is incorrect and always has been. > > gcj directly generates assembly code for the target processor, just like > all the other GCC language frontends. > > David Daney > Sure? Why GCJ depends on C++ of GCC? |
|
|
Re: libgcj_bc.so not embedded2007/4/7, J.C. Pizarro <jcpiza@...>:
> 2007/4/7, David Daney <ddaney@...>: > > J.C. Pizarro wrote: > > > > > > Remember, Java is generated to C++ with gcj and compiled with g++. > > That is incorrect and always has been. > > > > gcj directly generates assembly code for the target processor, just like > > all the other GCC language frontends. > > > > David Daney > > > > Sure? Why GCJ depends on C++ of GCC? > The proof, ./configure ... --enable-languages=c,java doesn't work ./configure ... --enable-languages=c,c++,java works. The tools gcjh and g++ are used. |
|
|
Re: libgcj_bc.so not embeddedWhen using "-static-libgcj", I'm getting this error:
/usr/bin/ld: cannot find -lgcj_bc On 4/7/07, J.C. Pizarro <jcpiza@...> wrote: > 2007/4/7, J.C. Pizarro <jcpiza@...>: > > 2007/4/7, David Daney <ddaney@...>: > > > J.C. Pizarro wrote: > > > > > > > > Remember, Java is generated to C++ with gcj and compiled with g++. > > > That is incorrect and always has been. > > > > > > gcj directly generates assembly code for the target processor, just like > > > all the other GCC language frontends. > > > > > > David Daney > > > > > > > Sure? Why GCJ depends on C++ of GCC? > > > > The proof, > > ./configure ... --enable-languages=c,java doesn't work > > ./configure ... --enable-languages=c,c++,java works. > > The tools gcjh and g++ are used. > |
|
|
Re: libgcj_bc.so not embeddedOn 4/7/07, J.C. Pizarro <jcpiza@...> wrote:
> Sure? Why GCJ depends on C++ of GCC? Because part of the libgcj library is written in C++ :). GCJ's runtime library is written in Java, C, and C++ and C++ code can call Java code via the CNI interface which was created even before JNI was designed :). GCJ does support JNI now too but GCJ was the first Java implementation to support native libraries even before Sun did. Someone needs to read code more. -- Pinski |
|
|
Re: libgcj_bc.so not embeddedMohsen Saboorian writes:
> > > > It's not supposed to be. The idea is that you compile your program > > > > and it dynamically links with the libgcj installed on the system. > > > > > > Then what happens for example in Windows, where there is no such > > > linkable library. Is it possible to statically link my program with > > > this .so file so that there would be an absolute stand-alone > > > application? > > > > Not quite, but you can link using -static-libgcj. It doesn't work for > > all Java programs, and in general it's a bad idea. Why do you want to > > do this, anyway? > > I have a Java application and want to have it work on OLPC > (laptop.org). OLPC uses a very light FC 5 I think, which doesn't have > any GCJ library, since their main development environment is Python > and JavaScript. I'll try -static-libgcj option to see if this works. OK, that makes sense. If you are installing into a standard Fedora system it makes no sense at all even if statically linking does work for your particular application, since libgcj is backwards compatible and if you link statically you won't automatically get bug fixes to libgcj. If you're the only application usig libgcj it might well make sense to save space. Andrew. -- Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK Registered in England and Wales No. 3798903 |
|
|
Re: libgcj_bc.so not embeddedOn Sat, 7 Apr 2007, Andrew Pinski wrote: > On 4/7/07, J.C. Pizarro <jcpiza@...> wrote: >> Sure? Why GCJ depends on C++ of GCC? > > Because part of the libgcj library is written in C++ :). GCJ's > runtime library is written in Java, C, and C++ and C++ code can call > Java code via the CNI interface which was created even before JNI was > designed :). GCJ does support JNI now too but GCJ was the first Java > implementation to support native libraries even before Sun did. And, I might add in reply to an earlier message, CNI is the other major reason to use gcj. It makes it possible to treat a body of Java code like any other C/C++ library out there. gcj makes Java code usable and accessible to the non-Java world. This is where the static linking requirements keeps coming from. Andi.. |
|
|
Re: libgcj_bc.so not embeddedMarco Trudel writes:
> Andrew Haley wrote: > > Mohsen Saboorian writes: > > > > > > > It's not supposed to be. The idea is that you compile your program > > > > and it dynamically links with the libgcj installed on the system. > > > > > > Then what happens for example in Windows, where there is no such > > > linkable library. Is it possible to statically link my program with > > > this .so file so that there would be an absolute stand-alone > > > application? > > > > Not quite, but you can link using -static-libgcj. It doesn't work for > > all Java programs, > > Which ones doesn't work? Anything that loads core classes via reflection or via its own class loaders, as you must already know by now. > If you know how to manually add objects that > are not referenced (and thus aren't pulled into the binary), then > everything is fine. At least for me... > > > and in general it's a bad idea. Why do you want to > > do this, anyway? > > There seem to be two different universes of GCJ users. Both do not > understand why the other even exists. I also live in the one that only > wants GCJ to create standalone binaries. I can't imagine a reason why to > use GCJ as JVM... > GCJ is (for me), good to: > - get around the problem of telling users to install a JVM. If they have > to install one anyway, why don't then just use one from Sun which has > less bugs? Aside from the technical reasons: It's a different way of thinking about the world. With free software, we share libraries between applications. That way, if a user of one application finds a bug in a library, they report it and it gets fixed, and all the other applications that link to the library get the fix too. By co-operating we all benefit. By linking statically you make sure that other users can't use the library code you have linked, but you don't get their help either. > - better protect the written code Protect it from what? Alien invasion? Herds of rampaging Wildebeest? :-) Andrew. -- Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK Registered in England and Wales No. 3798903 |
|
|
Re: libgcj_bc.so not embeddedMohsen Saboorian wrote:
> When using "-static-libgcj", I'm getting this error: > /usr/bin/ld: cannot find -lgcj_bc > Please post your complete command line or file a complete bug report. If there is a problem in GCC we can fix it. David Daney |
|
|
Re: libgcj_bc.so not embeddedI have compiled all jar dependencies into .o files using
-findirect-dispatch option. My last command line to make all-in-one executable file looks like this: $ gcj-4.1 -omyApp.executable -static-libgcj -O3 --main=my.main.Class -findirect-dispatch -fjni jar1.o jar2.o jar3.o as I addded -static-libgcj, it gives me: /usr/bin/ld: cannot find -lgcj_bc collect2: ld return ed 1 exit status I believe I'm doing something wrong and this simple usage should not be a bug. Thanks. On 4/7/07, David Daney <ddaney@...> wrote: > Mohsen Saboorian wrote: > > When using "-static-libgcj", I'm getting this error: > > /usr/bin/ld: cannot find -lgcj_bc > > > Please post your complete command line or file a complete bug report. > If there is a problem in GCC we can fix it. > > David Daney > > |
|
|
Re: libgcj_bc.so not embeddedMohsen Saboorian wrote:
> I have compiled all jar dependencies into .o files using > -findirect-dispatch option. My last command line to make all-in-one > executable file looks like this: > $ gcj-4.1 -omyApp.executable -static-libgcj -O3 --main=my.main.Class > -findirect-dispatch -fjni jar1.o jar2.o jar3.o > -static-libgcj has never been tested with -findirect-dispatch or -fjni. If you are statically linking there should be no need for -findirect-dispatch as you will never be upgrading the runtime (or anything else for that matter). > as I addded -static-libgcj, it gives me: > /usr/bin/ld: cannot find -lgcj_bc > collect2: ld return ed 1 exit status > > I believe I'm doing something wrong and this simple usage should not > be a bug. > > Thanks. > > On 4/7/07, David Daney <ddaney@...> wrote: >> Mohsen Saboorian wrote: >> > When using "-static-libgcj", I'm getting this error: >> > /usr/bin/ld: cannot find -lgcj_bc >> > >> Please post your complete command line or file a complete bug report. >> If there is a problem in GCC we can fix it. >> >> David Daney >> >> |
| < Prev | 1 - 2 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |