libc/uClibc: enable NPTL for snapshots

Recently, NPTL has matured a lot in uClibc, and more and more
people are interested to at least give it a try. So enable it.
This commit is contained in:
Yann E. MORIN" 2010-07-03 01:15:28 +02:00
parent 974f60e98a
commit 42a7dc1946
3 changed files with 84 additions and 7 deletions

View File

@ -45,15 +45,22 @@ config LIBC_V_0_9_28_3
prompt "0.9.28.3 (OBSOLETE)"
depends on OBSOLETE
# As of today (20100702) we can be pretty sure that every
# snapshots made since a month ago are post -0.9.30.
config LIBC_V_snapshot
bool
prompt "latest snapshot (EXPERIMENTAL)"
depends on EXPERIMENTAL
select LIBC_SUPPORT_NPTL
select LIBC_UCLIBC_0_9_30_or_later
config LIBC_V_specific_date
bool
prompt "<specific date> (EXPERIMENTAL)"
depends on EXPERIMENTAL
select LIBC_SUPPORT_NPTL
select LIBC_UCLIBC_0_9_30_or_later
endchoice

View File

@ -28,9 +28,11 @@ config LIBC_UCLIBC_LNXTHRD_NEW
endchoice
endif # THREADS_LINUXTHREADS
config LIBC_UCLIBC_LNXTHRD
string
default "" if THREADS_NONE
default "" if THREADS_NPTL
default "old" if LIBC_UCLIBC_LNXTHRD_OLD
default "new" if LIBC_UCLIBC_LNXTHRD_NEW
endif # THREADS_LINUXTHREADS

View File

@ -70,6 +70,7 @@ do_libc_check_config() {
# This functions installs uClibc's headers
do_libc_headers() {
local install_rule
local cross
CT_DoStep INFO "Installing C library headers"
@ -86,11 +87,23 @@ do_libc_headers() {
# compiler tools to use. Setting it to the empty string forces
# use of the native build host tools, which we need at this
# stage, as we don't have target tools yet.
# BUT! With NPTL, we need a cross-compiler (and we have it)
if [ "${CT_THREADS}" = "nptl" ]; then
cross="${CT_TARGET}-"
fi
CT_DoLog EXTRA "Applying configuration"
CT_DoYes "" |CT_DoExecLog ALL make CROSS= PREFIX="${CT_SYSROOT_DIR}/" oldconfig
CT_DoYes "" |CT_DoExecLog ALL \
make CROSS="${cross}" \
PREFIX="${CT_SYSROOT_DIR}/" \
oldconfig
CT_DoLog EXTRA "Building headers"
CT_DoExecLog ALL make ${CT_LIBC_UCLIBC_VERBOSITY} CROSS= PREFIX="${CT_SYSROOT_DIR}/" headers
CT_DoExecLog ALL \
make ${CT_LIBC_UCLIBC_VERBOSITY} \
CROSS="${cross}" \
PREFIX="${CT_SYSROOT_DIR}/" \
headers
if [ "${CT_LIBC_UCLIBC_0_9_30_or_later}" = "y" ]; then
install_rule=install_headers
@ -99,7 +112,40 @@ do_libc_headers() {
fi
CT_DoLog EXTRA "Installing headers"
CT_DoExecLog ALL make ${CT_LIBC_UCLIBC_VERBOSITY} CROSS= PREFIX="${CT_SYSROOT_DIR}/" "${install_rule}"
CT_DoExecLog ALL \
make ${CT_LIBC_UCLIBC_VERBOSITY} \
CROSS="${cross}" \
PREFIX="${CT_SYSROOT_DIR}/" \
${install_rule}
if [ "${CT_THREADS}" = "nptl" ]; then
CT_DoLog EXTRA "Building start files"
CT_DoExecLog ALL \
make ${CT_LIBC_UCLIBC_PARALLEL:+${PARALLELMFLAGS}} \
CROSS="${cross}" \
PREFIX="${CT_SYSROOT_DIR}/" \
STRIPTOOL=true \
${CT_LIBC_UCLIBC_VERBOSITY} \
lib/crt1.o lib/crti.o lib/crtn.o
# From: http://git.openembedded.org/cgit.cgi/openembedded/commit/?id=ad5668a7ac7e0436db92e55caaf3fdf782b6ba3b
# libm.so is needed for ppc, as libgcc is linked against libm.so
# No problem to create it for other archs.
CT_DoLog EXTRA "Building dummy shared libs"
CT_DoExecLog ALL "${cross}gcc" -nostdlib \
-nostartfiles \
-shared \
-x c /dev/null \
-o libdummy.so
CT_DoLog EXTRA "Installing start files"
CT_DoExecLog ALL install -m 0644 lib/crt1.o lib/crti.o lib/crtn.o \
"${CT_SYSROOT_DIR}/usr/lib"
CT_DoLog EXTRA "Installing dummy shared libs"
CT_DoExecLog ALL install -m 0755 libdummy.so "${CT_SYSROOT_DIR}/usr/lib/libc.so"
CT_DoExecLog ALL install -m 0755 libdummy.so "${CT_SYSROOT_DIR}/usr/lib/libm.so"
fi # CT_THREADS == nptl
CT_EndStep
}
@ -140,6 +186,13 @@ do_libc() {
# /Old/ versions can not build in //
CT_DoLog EXTRA "Building C library"
CT_DoExecLog ALL \
make -j1 \
CROSS=${CT_TARGET}- \
PREFIX="${CT_SYSROOT_DIR}/" \
STRIPTOOL=true \
${CT_LIBC_UCLIBC_VERBOSITY} \
pregen
CT_DoExecLog ALL \
make ${CT_LIBC_UCLIBC_PARALLEL:+${PARALLELMFLAGS}} \
CROSS=${CT_TARGET}- \
PREFIX="${CT_SYSROOT_DIR}/" \
@ -344,13 +397,14 @@ mungeuClibcConfig() {
# Push the threading model
# Note: we take into account all of the .28, .29, .30 and .31
# versions, here.
# versions, here. Even snapshots with NPTL.
case "${CT_THREADS}:${CT_LIBC_UCLIBC_LNXTHRD}" in
none:*)
none:)
cat <<-ENDSED
s/^UCLIBC_HAS_THREADS=y/# UCLIBC_HAS_THREADS is not set/
s/^LINUXTHREADS_OLD=y/# LINUXTHREADS_OLD is not set/
s/^LINUXTHREADS_NEW=y/# LINUXTHREADS_NEW is not set/
s/^UCLIBC_HAS_THREADS_NATIVE=y/# UCLIBC_HAS_THREADS_NATIVE is not set/
ENDSED
;;
linuxthreads:old)
@ -358,6 +412,7 @@ mungeuClibcConfig() {
s/^# UCLIBC_HAS_THREADS is not set/UCLIBC_HAS_THREADS=y/
s/^# LINUXTHREADS_OLD is not set/LINUXTHREADS_OLD=y/
s/^LINUXTHREADS_NEW=y/# LINUXTHREADS_NEW is not set/
s/^UCLIBC_HAS_THREADS_NATIVE=y/# UCLIBC_HAS_THREADS_NATIVE is not set/
ENDSED
;;
linuxthreads:new)
@ -365,8 +420,21 @@ mungeuClibcConfig() {
s/^# UCLIBC_HAS_THREADS is not set/UCLIBC_HAS_THREADS=y/
s/^LINUXTHREADS_OLD=y/# LINUXTHREADS_OLD is not set/
s/^# LINUXTHREADS_NEW is not set/LINUXTHREADS_NEW=y/
s/^UCLIBC_HAS_THREADS_NATIVE=y/# UCLIBC_HAS_THREADS_NATIVE is not set/
ENDSED
;;
nptl:)
cat <<-ENDSED
s/^HAS_NO_THREADS=y/# HAS_NO_THREADS is not set/
s/^UCLIBC_HAS_THREADS=y/# UCLIBC_HAS_THREADS is not set/
s/^LINUXTHREADS_OLD=y/# LINUXTHREADS_OLD is not set/
s/^LINUXTHREADS_NEW=y/# LINUXTHREADS_NEW is not set/
s/^# UCLIBC_HAS_THREADS_NATIVE is not set/UCLIBC_HAS_THREADS_NATIVE=y/
ENDSED
;;
*)
CT_Abort "Incorrect thread settings: CT_THREADS='${CT_THREAD}' CT_LIBC_UCLIBC_LNXTHRD='${CT_LIBC_UCLIBC_LNXTHRD}'"
;;
esac
# Always build the libpthread_db