Created attachment 318840 [details] Patch which adds proper linker flag Hello, Ok, I noticed that this bug is caused by #427524. Every available prelink's version in portage fails to compile because of undefined references to pthread functions: /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf_begin.o):function file_read_elf: error: undefined reference to 'pthread_rwlock_init' /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf_begin.o):function __libelf_read_mmaped_file: error: undefined reference to 'pthread_rwlock_init' /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf_begin.o):function __libelf_read_mmaped_file: error: undefined reference to 'pthread_rwlock_init' /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf_begin.o):function read_file: error: undefined reference to 'pthread_rwlock_init' /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf_begin.o):function lock_dup_elf.7838: error: undefined reference to 'pthread_rwlock_unlock' /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf_begin.o):function lock_dup_elf.7838: error: undefined reference to 'pthread_rwlock_wrlock' /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf_begin.o):function elf_begin: error: undefined reference to 'pthread_rwlock_rdlock' /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf_begin.o):function elf_begin: error: undefined reference to 'pthread_rwlock_unlock' /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf_end.o):function elf_end: error: undefined reference to 'pthread_rwlock_wrlock' /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf_end.o):function elf_end: error: undefined reference to 'pthread_rwlock_unlock' /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf_end.o):function elf_end: error: undefined reference to 'pthread_rwlock_rdlock' /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf_end.o):function elf_end: error: undefined reference to 'pthread_rwlock_wrlock' /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf_end.o):function elf_end: error: undefined reference to 'pthread_rwlock_unlock' /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf_end.o):function elf_end: error: undefined reference to 'pthread_rwlock_destroy' /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf32_getehdr.o):function getehdr_impl: error: undefined reference to 'pthread_rwlock_wrlock' /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf32_getehdr.o):function elf32_getehdr: error: undefined reference to 'pthread_rwlock_rdlock' /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/../../../../lib64/libelf.a(elf64_getehdr.o):function elf64_getehdr: error: undefined reference to 'pthread_rwlock_rdlock' The solution is modifying `configure' script and adding -lpthread flag to `LIBS' variable (as shown in my ugly, attached patch). NOTE: It does not matter if we're trying compilation with 'highly unstable' (masked) gcc version or stable one. It never works.
don't cc people directly
should be all set now in the tree; thanks for the report! Commit message: Link against pthreads when elfutils is built with USE=threads http://sources.gentoo.org/sys-devel/prelink/prelink-20111012.ebuild?r1=1.3&r2=1.4