Hey
Its been a long time since I threw my hat in the ring to help the hlfs project.
Unfortunately many unforeseen changes in my life pulled me away from the
project. At this point I am very interested in getting back to it.
So to that end I am running through the 2.4 glibc version of the book. Happy
to see its been merged into the mainline book. Anyhow it seems that glibc-2.5.1
is fairly dependent on nptl. So much so that it fails to compile without it in
its current state.
dl-runtime.c: In function '_dl_fixup':
dl-runtime.c:102: error: 'RTLD_SINGLE_THREAD_P' undeclared (first use in this
function)
dl-runtime.c:102: error: (Each undeclared identifier is reported only once
dl-runtime.c:102: error: for each function it appears in.)
dl-runtime.c:103: warning: implicit declaration of function
'THREAD_GSCOPE_SET_FLAG'
dl-runtime.c:110: warning: implicit declaration of function
'THREAD_GSCOPE_RESET_FLAG'
dl-runtime.c: In function '_dl_profile_fixup':
dl-runtime.c:194: error: 'RTLD_SINGLE_THREAD_P' undeclared (first use in this
function)
A grep of the source shows this...(minus the changelog entries)
../glibc-2.5.1/elf/dl-close.c: if (!RTLD_SINGLE_THREAD_P
../glibc-2.5.1/elf/dl-runtime.c: if (!RTLD_SINGLE_THREAD_P)
../glibc-2.5.1/elf/dl-runtime.c: if (!RTLD_SINGLE_THREAD_P)
../glibc-2.5.1/elf/dl-runtime.c: if (!RTLD_SINGLE_THREAD_P)
../glibc-2.5.1/elf/dl-runtime.c: if (!RTLD_SINGLE_THREAD_P)
../glibc-2.5.1/elf/dl-sym.c: if (RTLD_SINGLE_THREAD_P)
../glibc-2.5.1/elf/dl-open.c: if (!RTLD_SINGLE_THREAD_P)
../glibc-2.5.1/elf/dl-open.c: if (RTLD_SINGLE_THREAD_P)
../glibc-2.5.1/nptl/ChangeLog: * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
(RTLD_SINGLE_THREAD_P):
../glibc-2.5.1/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h:# define
RTLD_SINGLE_THREAD_P \
../glibc-2.5.1/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h:# define
RTLD_SINGLE_THREAD_P \
../glibc-2.5.1/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h:# define
RTLD_SINGLE_THREAD_P \
../glibc-2.5.1/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h:#
define RTLD_SINGLE_THREAD_P \
../glibc-2.5.1/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h:#
define RTLD_SINGLE_THREAD_P \
../glibc-2.5.1/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h:#
define RTLD_SINGLE_THREAD_P \
../glibc-2.5.1/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h:#
define RTLD_SINGLE_THREAD_P \
../glibc-2.5.1/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h:# define
RTLD_SINGLE_THREAD_P \
../glibc-2.5.1/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h:#
define RTLD_SINGLE_THREAD_P \
../glibc-2.5.1/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h:#
define RTLD_SINGLE_THREAD_P \
../glibc-2.5.1/nptl/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h:# define
RTLD_SINGLE_THREAD_P \
../glibc-2.5.1/sysdeps/generic/sysdep-cancel.h:#define RTLD_SINGLE_THREAD_P (1)
This all seems to be because the glibc team has depricated linuxthreads, and
RTLD_SINGLE_THREAD_P is defined in nptl. Fixing the linuxthreads sources with a
define for RTL_SINGLE_THREAD_P was simple, but unfortunately that is not the
only issue with the compilation. There is also the addition of THREAD_GSCOPE
stuff to address.
gcc -B/tools/bin/ -nostdlib -nostartfiles -shared -o
/mnt/hlfs/sources/glibc-build/elf/ld.so \
-Wl,-z,combreloc -Wl,-z,relro -Wl,-z,defs -Wl,-z,now \
/mnt/hlfs/sources/glibc-build/elf/librtld.os
-Wl,--version-script=/mnt/hlfs/sources/glibc-build/ld.map \
-Wl,-soname=ld-linux.so.2 -T
/mnt/hlfs/sources/glibc-build/elf/ld.so.lds
/mnt/hlfs/sources/glibc-build/elf/librtld.os: In function `_dl_profile_fixup':
/mnt/hlfs/sources/glibc-2.5.1/elf/dl-runtime.c:195: undefined reference to
`THREAD_GSCOPE_SET_FLAG'
/mnt/hlfs/sources/glibc-2.5.1/elf/dl-runtime.c:203: undefined reference to
`THREAD_GSCOPE_RESET_FLAG'
/mnt/hlfs/sources/glibc-build/elf/librtld.os: In function `_dl_fixup':
/mnt/hlfs/sources/glibc-2.5.1/elf/dl-runtime.c:110: undefined reference to
`THREAD_GSCOPE_RESET_FLAG'
/mnt/hlfs/sources/glibc-2.5.1/elf/dl-runtime.c:103: undefined reference to
`THREAD_GSCOPE_SET_FLAG'
/mnt/hlfs/sources/glibc-build/elf/librtld.os: In function `_dl_scope_free':
/mnt/hlfs/sources/glibc-2.5.1/elf/dl-open.c:195: undefined reference to
`THREAD_GSCOPE_WAIT'
/mnt/hlfs/sources/glibc-2.5.1/elf/dl-open.c:181: undefined reference to
`THREAD_GSCOPE_WAIT'
/mnt/hlfs/sources/glibc-build/elf/librtld.os: In function `add_to_global':
/mnt/hlfs/sources/glibc-2.5.1/elf/dl-open.c:162: undefined reference to
`atomic_write_barrier'
/mnt/hlfs/sources/glibc-2.5.1/elf/dl-open.c:145: undefined reference to
`THREAD_GSCOPE_WAIT'
/mnt/hlfs/sources/glibc-build/elf/librtld.os: In function `dl_open_worker':
/mnt/hlfs/sources/glibc-2.5.1/elf/dl-open.c:480: undefined reference to
`atomic_write_barrier'
/mnt/hlfs/sources/glibc-build/elf/librtld.os: In function `_dl_close_worker':
/mnt/hlfs/sources/glibc-2.5.1/elf/dl-close.c:503: undefined reference to
`THREAD_GSCOPE_WAIT'
collect2: ld returned 1 exit status
make[2]: *** [/mnt/hlfs/sources/glibc-build/elf/ld.so] Error 1
make[2]: Leaving directory `/mnt/hlfs/sources/glibc-2.5.1/elf'
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory `/mnt/hlfs/sources/glibc-2.5.1'
make: *** [all] Error 2
I can't say one way or the other if there is anything more to be addressed in
patching linuxthreads to be glibc-2.5.1 compliant. Considering the glibc
maintainers are not interested in continuing linuxthreads development. I was
wondering if it is worth the effort to continue porting changes into
linuxthreads since it seems they would not be accepted upstream. I am thinking
continuing forward with glibc-2.5 in the 2.4 version of the book might be a
more realistic approach. Of course I might be missing something. Does anyone
have any other options to get glibc-2.5.1 and linuxthreads to jive?
rbaker
________________________________________________________________
Sent via the WebMail system at mail.netslyder.net
--
http://linuxfromscratch.org/mailman/listinfo/hlfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page