Has anybody actually tested x86-64 with NPTL in 0.9.33.1?

Rob Landley rob at landley.net
Mon May 14 23:04:41 UTC 2012


Attempting to build NPTL on x86-64 does this:

  LD libpthread-0.9.33.2-git.so
/home/landley/aboriginal/aboriginal/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/landley/aboriginal/aboriginal/build/simple-cross-compiler-x86_64/lib/../x86_64-unknown-linux/bin/ld:
final link failed: Bad value

This seems to be because an assembly file has explicitly non-pic code in
it. Switching to LINUXTHREAD_OLD for the x86-64 architecture worked
around the problem, but when I run my linux from scratch build under the
result (same script which worked fine with the previous release), and
perl goes:

Running Mkbootstrap for threads::shared ()
chmod 644 shared.bs
rm -f ../../lib/auto/threads/shared/shared.so
cc  -shared -O2 shared.o  -o ../../lib/auto/threads/shared/shared.so
chmod 755 ../../lib/auto/threads/shared/shared.so
cp shared.bs ../../lib/auto/threads/shared/shared.bs
chmod 644 ../../lib/auto/threads/shared/shared.bs
make[1]: Leaving directory `/home/perl/dist/threads-shared'
LD_LIBRARY_PATH=/home/perl  ./perl -f -Ilib pod/buildtoc --build-toc -q
./perl: Can't resolve symbol '__pthread_mutex_lock'
make: *** [pod/perltoc.pod] Error 1
Command exited with non-zero status 1

So linuxthreads_old is bit-rotted, and NPTL isn't working on x86-64 for
me.  Has anybody else hit this?

I grepped for PIC in the other assembly files in the directory, and
found a couple #ifdefs with @GOTOFF in the pic case, but none of them
actually _dereference_ the symbol (just check whether the pointer is
null), and google is being extremely unhelpful about @GOT and @GOTOFF
and @PIC...

Currently reading this in hopes SOMEBODY will explain what magic syntax
I need...

  http://netwinder.osuosl.org/users/p/patb/public_html/elf_relocs.html

Rob
-- 
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's "mere aggregation", or a license violation.  Pick one.


More information about the uClibc mailing list