This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Build of 4.1.0 in cross env


FERANDELLE Pascal writes:
 > >  >
 > >  > So now, I have a complete cross powerpc-linux gcc chain in 4.1.0, and I test on a simple HelloWorld Java program.
 > >  > It does not link because there is an undefined reference to __tls_get_addr, needed by libgcj.so.
 > >  > I did not have this problem in 3.4.4.
 > >  >
 > >  > Any idea ?
 > >
 > > It should be in the target lib libpthread.so.  Make sure your
 > > LD_LIBRARY_PATH points to the dir where that lib resides.
 > 
 > The problem is that I don't have any __tls_get_addr in my target libpthread.so ...
 > And I don't have call to this reference in my native 4.1.0 libgcj.so.

Whenever thread local storage is used there will be a call to this or
something similar.  If you look at gcc/configure you'll see something
like

  powerpc-*-*)
    conftest_s='
        .section ".tdata","awT",@progbits
        .align 2
ld0:    .space 4
ld1:    .space 4
x1:     .space 4
x2:     .space 4
x3:     .space 4
        .text
        addi 3,31,ld0@got@tlsgd
        bl __tls_get_addr
        addi 3,31,x1@got@tlsld
        bl __tls_get_addr
        addi 9,3,x1@dtprel
        addis 9,3,x2@dtprel@ha
        addi 9,9,x2@dtprel@l
        lwz 9,x3@got@tprel(31)
        add 9,9,x@tls
        addi 9,2,x1@tprel
        addis 9,2,x2@tprel@ha
        addi 9,9,x2@tprel@l'
        tls_first_major=2
        tls_first_minor=14
        tls_as_opt="-a32 --fatal-warnings"

for each CPU type.  gcc uses these tests to determine if tls can be
used on your target.  If these test pass, gcc uses tls.

You can always configure with --disable-tls, but I'd first try to find
out why it's failing.

Andrew.


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