[Aboriginal] Fun with TLS [was requires approval]

David Halls dahalls at gmail.com
Mon Nov 3 14:34:52 PST 2014


>
> Ah, I see. Yup, works on i686, gives me the message on x86-64.
>

Yep

>
> > If I remove this line from sources/targets/x86_64:
> >
> > LINUXTHREADS_OLD=y
> >
> > then ntpl tries to build but I get:
> >
> >
> /home/david/Downloads/aboriginal-1.2.9/build/simple-cross-compiler-x86_64/lib/../x86_64-unknown-linux/bin/ld:
> > libpthread/nptl/libpthread_so.a(pthread_once.oS): relocation
> > R_X86_64_PC32 against `__fork_generation' can not be used when making a
> > shared object; recompile with -fPIC
> >
> /home/david/Downloads/aboriginal-1.2.9/build/simple-cross-compiler-x86_64/lib/../x86_64-unknown-linux/bin/ld:
> > final link failed: Bad value
> > collect2: ld returned 1 exit status
> > libpthread/nptl/Makefile.in:78: recipe for target 'lib/libpthread.so'
> failed
> > make: *** [lib/libpthread.so] Error 1
>
> Sigh. I very vaguely recall that...
>
> Ah: http://landley.net/hg/aboriginal/rev/1522
>
> Ok, yeah, I left a thing I need to fix. :)
>
>
Doing this in nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S:

 +       .hidden __fork_generation
         .comm   __fork_generation, 4, 4

fixes the compile problem - have to hide __fork_generation in the assembly,
like the C declaration does.
(I have yet to test the TLS stuff in the image.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/aboriginal-landley.net/attachments/20141103/7b3a29ac/attachment-0002.htm>


More information about the Aboriginal mailing list