Re: gcj static crosscompiling raises issues with boehm-gc

David Daney <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
Normally I leave the list CCed.  It is my personal policy not to respond 
to private messages of this nature, but I am making an exception for 
this one.

On 10/06/2010 10:53 AM, Andreas Frisch wrote:
>> Things can get complicated when linking in C++ code with the gcj driver
>> program.  I would think all you would need is -lsupc++, and perhaps
>> -lstdc++.
>>
>> -nostdlib looks a bit questionable to me.
>>
>> In any event it is good to see that people are still making use of gcj
>> on mips.
>>
>> David Daney
>
> dear David,
>
> yeah it actually comes in very handy! if it just wasn't so tricky to use.
> okay soo where do i start... i mean i've literally spent a week trying to get
> this to link properly and i've tried maaaany combinations of the parameters
>
> i'll just put in some command lines along with excerpts of the respective
> error messages
>
>   --main=dumphd.core.DumpHD -static-libgcj
>          -L/dream/oe1.6/dm8000/build/tmp/staging/mipsel-oe-linux/usr/lib \
>          -L/dream/projects/bluray/aacskeys-0.4.0c-mipsel/lib/linux/ \
>          -Wl,-rpath-link,/dream/oe1.6/dm8000/build/tmp/staging/mipsel-oe-
> linux/usr/lib \
>          -Wl,-rpath-link,/dream/projects/bluray/aacskeys-0.4.0c-
> mipsel/lib/linux/ -laacskeys \
>          -Wl,-non_shared \
>          -Wl,-lstdc++ -lsupc++
>
> 10 problems (10 warnings)
> /dream/oe1.6/dm8000/build/tmp/cross/mipsel/lib/gcc/mipsel-oe-
> linux/4.4.4/../../../../mipsel-oe-linux/bin/ld: cannot find -lgcc_s
>
> ***
>
>   --main=dumphd.core.DumpHD -static-libgcj \
>          -nostdlib \
>          -L/dream/oe1.6/dm8000/build/tmp/staging/mipsel-oe-linux/usr/lib \
>          -L/dream/projects/bluray/aacskeys-0.4.0c-mipsel/lib/linux/ \
>          -Wl,-rpath-link,/dream/oe1.6/dm8000/build/tmp/staging/mipsel-oe-
> linux/usr/lib \
>          -Wl,-rpath-link,/dream/projects/bluray/aacskeys-0.4.0c-
> mipsel/lib/linux/ -laacskeys \
>          -Wl,-lstdc++ -lsupc++
>
> 10 problems (10 warnings)
> /dream/oe1.6/dm8000/build/tmp/cross/mipsel/lib/gcc/mipsel-oe-
> linux/4.4.4/../../../../mipsel-oe-linux/bin/ld: warning: libgcc_s.so.1, needed
> by /dream/projects/bluray/aacskeys-0.4.0c-mipsel/lib/linux//libaacskeys.so,
> not found (try using -rpath or -rpath-link)
> /dream/oe1.6/dm8000/build/tmp/cross/mipsel/lib/gcc/mipsel-oe-
> linux/4.4.4/../../../../mipsel-oe-linux/bin/ld: warning: cannot find entry
> symbol __start; defaulting to 00000000004015d0
> /tmp/cclqdxg7.o: In function `bdvm::vm::BDVMException::BDVMException()':
> ./source/bdvm/vm/BDVMException.java:(.text+0x2c): undefined reference to
> `java::lang::Exception::Exception()'
> /tmp/cclqdxg7.o: In function
> `bdvm::vm::BDVMException::BDVMException(java::lang::String*)':
> ./source/bdvm/vm/BDVMException.java:(.text+0x8c): undefined reference to
> `java::lang::Exception::Exception(java::lang::String*)'
> /tmp/cclqdxg7.o: In function
> `bdvm::vm::BDVMException::BDVMException(java::lang::String*,
> java::lang::Throwable*)':
> ./source/bdvm/vm/BDVMException.java:(.text+0x100): undefined reference to
> `java::lang::Exception::Exception(java::lang::String*,
> java::lang::Throwable*)'
> /tmp/cclqdxg7.o: In function
> `bdvm::vm::BDVMException::BDVMException(java::lang::Throwable*)':
> ./source/bdvm/vm/BDVMException.java:(.text+0x160): undefined reference to
> `java::lang::Exception::Exception(java::lang::Throwable*)'
> /tmp/cclqdxg7.o: In function
> `dumphd::bdplus::ConversionTable::ConversionTable()':
> ./source/bdvm/vm/BDVMException.java:(.text+0x1b4): undefined reference to
> `java::lang::Object::Object()'
> ./source/bdvm/vm/BDVMException.java:(.text+0x1cc): undefined reference to
> `java::util::ArrayList::class$'
> 6000+ similar undefined refs
>
> ***
>
>   --main=dumphd.core.DumpHD -static-libgcj \
>          -L/dream/oe1.6/dm8000/build/tmp/staging/mipsel-oe-linux/usr/lib \
>          -L/dream/projects/bluray/aacskeys-0.4.0c-mipsel/lib/linux/ \
>          -Wl,-rpath-link,/dream/oe1.6/dm8000/build/tmp/staging/mipsel-oe-
> linux/usr/lib \
>          -Wl,-rpath-link,/dream/projects/bluray/aacskeys-0.4.0c-
> mipsel/lib/linux/ -laacskeys \
>          -Wl,-lstdc++ -lsupc++
>
> 10 problems (10 warnings)
> /tmp/ccWdYPef.o:(.data+0x5638): undefined reference to `hidden alias for
> java::lang::String* dumphd::aacs::AACSKeys::getVersionString()'
> /tmp/ccWdYPef.o:(.data+0x563c): undefined reference to `hidden alias for void
> dumphd::aacs::AACSKeys::getKeys(java::lang::String*, dumphd::core::KeyData*)'
> /tmp/ccWdYPef.o:(.data+0x5680): undefined reference to `hidden alias for
> java::lang::String* dumphd::aacs::AACSKeys::getVersionString()'
> /tmp/ccWdYPef.o:(.data+0x5694): undefined reference to `hidden alias for void
> dumphd::aacs::AACSKeys::getKeys(java::lang::String*, dumphd::core::KeyData*)'
> collect2: ld returned 1 exit status
>
>
> the parameter set in my original post (with the boehm-gc errors) led me the
> farthest, as far as i can tell. at least there were no complaints about
> linking the java sources and that c++ library, possible though that it failed
> in an earlier state of the linking process - i don't really know
>
> still open for more suggestions, i am available on instant messangers or irc
> too for live trial and error experiments :)
> [email protected] thorugh jabber/xmpp or fraxinas on ircnet or freenode irc

The GCJ IRC channel typically has the highest concentration of gcj 
experts available on this planet.

David Daney
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.