Wednesday 7 August 2013

Cannot build eglibc with "pthread-functions" errors.

Hi all,
    I tried to build the eglibc. I downloaded the three files from here https://launchpad.net/ubuntu/raring/+source/eglibc.Then,
$ dpkg-source -x eglibc_2.17-0ubuntu5.dsc
$ cd eglibc-2.17/
$ make -f debian/rules patch
$ cd ../
$ mkdir eglibc-build
$ cd eglibc-build
$ ../eglibc-2.17/configure --prefix=$(pwd)
$ make -j8

Now the errors occured.

/home/zyh/Downloads/eglibc-build/libpthread/libc_pthread_init.os
forward.c: In function 'pthread_attr_init':
forward.c:44:1: error: 'struct pthread_functions' has no member named 'ptr_pthread_attr_init'
forward.c:44:1: error: 'struct pthread_functions' has no member named 'ptr_pthread_attr_init'
forward.c: In function 'pthread_cond_broadcast':
forward.c:79:1: error: 'struct pthread_functions' has no member named 'ptr_pthread_cond_broadcast'
forward.c:79:1: error: 'struct pthread_functions' has no member named 'ptr_pthread_cond_broadcast'
forward.c: In function 'pthread_cond_destroy':
forward.c:80:1: error: 'struct pthread_functions' has no member named 'ptr_pthread_cond_destroy'
forward.c:80:1: error: 'struct pthread_functions' has no member named 'ptr_pthread_cond_destroy'
forward.c: In function 'pthread_cond_init':
forward.c:81:1: error: 'struct pthread_functions' has no member named 'ptr_pthread_cond_init'
forward.c:81:1: error: 'struct pthread_functions' has no member named 'ptr_pthread_cond_init'
forward.c: In function 'pthread_cond_signal':
forward.c:84:1: error: 'struct pthread_functions' has no member named 'ptr_pthread_cond_signal'
forward.c:84:1: error: 'struct pthread_functions' has no member named 'ptr_pthread_cond_signal'
forward.c: In function 'pthread_cond_wait':
forward.c:85:1: error: 'struct pthread_functions' has no member named 'ptr_pthread_cond_wait'
forward.c:85:1: error: 'struct pthread_functions' has no member named 'ptr_pthread_cond_wait'
forward.c: In function 'pthread_cond_timedwait':
forward.c:87:1: error: 'struct pthread_functions' has no member named 'ptr_pthread_cond_timedwait'
forward.c:87:1: error: 'struct pthread_functions' has no member named 'ptr_pthread_cond_timedwait'
forward.c: In function 'pthread_exit':
forward.c:96:1: error: 'struct pthread_functions' has no member named 'ptr_pthread_exit'
forward.c:96:1: error: 'struct pthread_functions' has no member named 'ptr_pthread_exit'
forward.c:96:1: warning: function declared 'noreturn' has a 'return' statement [enabled by default]
forward.c:96:1: warning: 'return' with a value, in function returning void [enabled by default]
forward.c: In function '__pthread_get_cleanup_stack':
forward.c:127:1: error: 'struct pthread_functions' has no member named 'ptr___pthread_get_cleanup_stack'
forward.c:127:1: error: 'struct pthread_functions' has no member named 'ptr___pthread_get_cleanup_stack'
forward.c:127:1: warning: control reaches end of non-void function [-Wreturn-type]
forward.c: In function 'pthread_exit':
forward.c:96:1: warning: 'noreturn' function does return [enabled by default]
forward.c: In function 'pthread_cond_timedwait':
forward.c:87:1: warning: control reaches end of non-void function [-Wreturn-type]
forward.c: In function 'pthread_cond_wait':
forward.c:85:1: warning: control reaches end of non-void function [-Wreturn-type]
forward.c: In function 'pthread_cond_signal':
forward.c:84:1: warning: control reaches end of non-void function [-Wreturn-type]
forward.c: In function 'pthread_cond_init':
forward.c:81:1: warning: control reaches end of non-void function [-Wreturn-type]
forward.c: In function 'pthread_cond_destroy':
forward.c:80:1: warning: control reaches end of non-void function [-Wreturn-type]
forward.c: In function 'pthread_cond_broadcast':
forward.c:79:1: warning: control reaches end of non-void function [-Wreturn-type]
forward.c: In function 'pthread_attr_init':
forward.c:44:1: warning: control reaches end of non-void function [-Wreturn-type]
make[2]: *** [/home/zyh/Downloads/eglibc-build/libpthread/forward.os] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/home/zyh/Downloads/eglibc-2.17/libpthread'
make[1]: *** [libpthread/subdir_lib] Error 2
make[1]: Leaving directory `/home/zyh/Downloads/eglibc-2.17'
make: *** [all] Error 2

I looked at the /libpthread/forward.c and found that the line
"#include <pthread-functions.h>"
will include the file "/nptl/sysdeps/pthread/pthread-functions.h" instead of "/libpthread/pthread/pthread-functions.h".
I tried to let it include the right file but it won't work because of my poor knowledge of the patch and the whole eglibc.

Is it  a bug or my wrong operation?