Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 41581 Details for
Bug 21132
LD_ASSUME_KERNEL on nptl system fails
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to glibc-2.3.3.20040420 ebuild to create both NPTL and Linuxthreads GLIBC
glibc-2.3.3.20040420-r3.patch (text/plain), 9.28 KB, created by
James Roberts-Thomson
on 2004-10-11 14:46:09 UTC
(
hide
)
Description:
Patch to glibc-2.3.3.20040420 ebuild to create both NPTL and Linuxthreads GLIBC
Filename:
MIME Type:
Creator:
James Roberts-Thomson
Created:
2004-10-11 14:46:09 UTC
Size:
9.28 KB
patch
obsolete
>--- glibc-2.3.3.20040420-r2.ebuild 2004-10-08 11:24:28.000000000 +1300 >+++ glibc-2.3.3.20040420-r3.ebuild 2004-10-12 10:30:53.295857686 +1300 >@@ -8,7 +8,6 @@ inherit eutils flag-o-matic gcc > # BRANCH_UPDATE= > BRANCH_UPDATE="20040420" > >- > # Minimum kernel version for --enable-kernel > export MIN_KV="2.4.1" > # Minimum kernel version for enabling TLS and NPTL ... >@@ -97,6 +96,23 @@ get_KHV() { > return 1 > } > >+want_tls() { >+ # Archs that can use TLS (Thread Local Storage) >+ if use amd64 || use alpha || use ia64 || use ppc || \ >+ use ppc64 || use s390 || use sparc; then >+ return 0 >+ fi >+ >+ # Specific x86 CHOSTS that can use TLS >+ if use x86; then >+ case "${CHOST/-*}" in >+ i486|i586|i686) return 0 ;; >+ esac >+ fi >+ >+ return 1 >+} >+ > use_nptl() { > # Enable NPTL support if: > # - We have 'nptl' in USE >@@ -472,6 +488,21 @@ src_unpack() { > chmod u+x ${S}/scripts/*.sh > } > >+pkg_setup() { >+ # give some sort of warning about the nptl logic changes... >+ if use_nptl && use !nptlonly ; then >+ ewarn "Warning! Gentoo's GLIBC with NPTL enabled now behaves like the" >+ ewarn "glibc from almost every other distribution out there. This means" >+ ewarn "that glibc is compiled -twice-, once with linuxthreads and once" >+ ewarn "with nptl. The NPTL version is installed to lib/tls and is still" >+ ewarn "used by default. If you do not need nor want the linuxthreads" >+ ewarn "fallback, you can disable this behavior by adding nptlonly to" >+ ewarn "USE to save yourself some compile time." >+ ebeep >+ epause >+ fi >+} >+ > setup_flags() { > # Over-zealous CFLAGS can often cause problems. What may work for one person may not > # work for another. To avoid a large influx of bugs relating to failed builds, we >@@ -522,9 +553,8 @@ setup_flags() { > export LDFLAGS="${LDFLAGS//-Wl,--relax}" > } > >-src_compile() { >+glibc_configure() { > local myconf= >- local myconf_nptl= > > setup_flags > >@@ -532,51 +562,37 @@ src_compile() { > # zoneinfo do not always get installed ... > unset LANGUAGE LANG LC_ALL > >- use nls || myconf="${myconf} --disable-nls" >+ # set addons >+ pushd ${S} > /dev/null >+ ADDONS=$(echo */configure | sed -e 's!/configure!!g;s!\(linuxthreads\|nptl\|rtkaio\)\( \|$\)!!g;s! \+$!!;s! !,!g;s!^!,!;/^,\*$/d') >+ popd > /dev/null > >+ use nls || myconf="${myconf} --disable-nls" > use erandom || myconf="${myconf} --disable-dev-erandom" > >- if use_nptl >- then >- local kernelheaders="$(get_KHV "`KV_to_int ${MIN_NPTL_KV}`")" >- >- # NTPL and Thread Local Storage support. >- myconf="${myconf} --with-tls --with-__thread \ >- --enable-add-ons=nptl \ >- --enable-kernel=${MIN_NPTL_KV} \ >- --with-headers=${kernelheaders}" >+ if [ "$1" == "linuxthreads" ] ; then >+ want_tls && myconf="${myconf} --with-tls --without-__thread" >+ want_tls || myconf="${myconf} --without-tls --without-__thread" >+ myconf="${myconf} --enable-add-ons=linuxthreads${ADDONS}" >+ myconf="${myconf} --enable-kernel=2.4.1" >+ elif [ "$1" == "nptl" ] ; then >+ use_nptl && myconf="${myconf} --with-tls --with-__thread" >+ myconf="${myconf} --enable-add-ons=nptl${ADDONS}" >+ myconf="${myconf} --enable-kernel=${MIN_NPTL_KV}" > else >- myconf="${myconf} --without-__thread \ >- --enable-add-ons=linuxthreads" >- >- # If we build for the build system we use the kernel headers from the target >- # We also now set it without "build" as well, else it might use the >- # current kernel's headers, which might just fail (the linux-headers >- # package is usually well tested...) >-# ( use build || use sparc ) \ >-# && myconf="${myconf} --with-headers=${ROOT}usr/include" >- myconf="${myconf} --with-headers=${ROOT}usr/include" >- >- # If kernel version and headers in ${ROOT}/usr/include are ok, >- # then enable --enable-kernel=${MIN_KV} ... >- if [ "`get_KV`" -ge "`KV_to_int ${MIN_KV}`" -a \ >- -n "$(get_KHV "`KV_to_int ${MIN_KV}`" "${ROOT}/usr/include")" ] >- then >- myconf="${myconf} --enable-kernel=${MIN_KV}" >- else >- myconf="${myconf} --enable-kernel=2.2.5" >- fi >+ die "invalid pthread option" > fi > > # some silly people set LD_RUN_PATH and that breaks things. > # see bug 19043 > unset LD_RUN_PATH > >- einfo "Configuring GLIBC..." >- rm -rf ${S}/buildhere >- mkdir -p ${S}/buildhere >- cd ${S}/buildhere >- ../configure --build=${CHOST} \ >+ GBUILDDIR="${WORKDIR}/build-$1" >+ rm -rf ${GBUILDDIR} >+ mkdir -p ${GBUILDDIR} >+ cd ${GBUILDDIR} >+ >+ myconf=$"${myconf} --build=${CHOST} \ > --host=${CHOST} \ > --with-gd=no \ > --without-cvs \ >@@ -584,29 +600,111 @@ src_compile() { > --prefix=/usr \ > --mandir=/usr/share/man \ > --infodir=/usr/share/info \ >- --libexecdir=/usr/lib/misc \ >- ${myconf} || die >+ --libexecdir=/usr/lib/misc" > >- einfo "Building GLIBC..." >- cd ${S}/buildhere >- make PARALLELMFLAGS="${MAKEOPTS}" || die >-# einfo "Doing GLIBC checks..." >-# make check >+ einfo "Configuring GLIBC for $1 with: ${myconf}" >+ ${S}/configure ${myconf} || die "failed to configure glibc" > } > >-src_install() { >- local buildtarget="buildhere" >+src_compile() { >+ # do the linuxthreads build unless we're using nptlonly >+ if use !nptlonly; then >+ glibc_configure linuxthreads >+ einfo "Building GLIBC with linuxthreads..." >+ cd ${S}/build-linuxthreads >+ make PARALLELMFLAGS="${MAKEOPTS}" || die >+ fi >+ if use_nptl; then >+ unset LD_ASSUME_KERNEL || : >+ glibc_configure nptl >+ einfo "Building GLIBC with NPTL..." >+ cd ${S}/build-nptl >+ make PARALLELMFLAGS="${MAKEOPTS}" || die >+ fi >+} > >+src_install() { > setup_flags > > # These should not be set, else the > # zoneinfo do not always get installed ... > unset LANGUAGE LANG LC_ALL > >- einfo "Installing GLIBC..." >- make PARALLELMFLAGS="${MAKEOPTS}" \ >- install_root=${D} \ >- install -C ${buildtarget} || die >+ if use !nptlonly ; then >+ local buildtarget="build-linuxthreads" >+ cd ${WORKDIR}/${buildtarget} >+ einfo "Installing GLIBC with linuxthreads..." >+ make PARALLELMFLAGS="${MAKEOPTS}" \ >+ install_root=${D} \ >+ install || die >+ elif use nptlonly ; then >+ local buildtarget="build-nptl" >+ cd ${WORKDIR}/${buildtarget} >+ einfo "Installing GLIBC with NPTL..." >+ make PARALLELMFLAGS="${MAKEOPTS}" \ >+ install_root=${D} \ >+ install || die >+ fi >+ >+ if use !nptlonly && use_nptl ; then >+ einfo "Installing NPTL to $(get_libdir)/tls/..." >+ cd ${WORKDIR}/build-nptl >+ mkdir -p ${D}/$(get_libdir)/tls/ >+ >+ libcsofile=$(basename ${D}/$(get_libdir)/libc-*.so) >+ cp -a libc.so ${D}/$(get_libdir)/tls/${libcsofile} || die >+ dosym ${libcsofile} /$(get_libdir)/tls/$(ls libc.so.*) >+ >+ libmsofile=$(basename ${D}/$(get_libdir)/libm-*.so) >+ pushd math > /dev/null >+ cp -a libm.so ${D}/$(get_libdir)/tls/${libmsofile} || die >+ dosym ${libmsofile} /$(get_libdir)/tls/$(ls libm.so.*) >+ popd > /dev/null >+ >+ librtsofile=$(basename ${D}/$(get_libdir)/librt-*.so) >+ pushd rt > /dev/null >+ cp -a librt.so ${D}/$(get_libdir)/tls/${librtsofile} || die >+ dosym ${librtsofile} /$(get_libdir)/tls/$(ls librt.so.*) >+ popd > /dev/null >+ >+ libthreaddbsofile=$(basename ${D}/$(get_libdir)/libthread_db-*.so) >+ pushd nptl_db > /dev/null >+ cp -a libthread_db.so ${D}/$(get_libdir)/tls/${libthreaddbsofile} || die >+ dosym ${libthreaddbsofile} /$(get_libdir)/tls/$(ls libthread_db.so.*) >+ popd > /dev/null >+ >+ libpthreadsofile=libpthread-${NEW_PV}.so >+ cp -a nptl/libpthread.so ${D}/$(get_libdir)/tls/${libpthreadsofile} || die >+ dosym ${libpthreadsofile} /$(get_libdir)/tls/libpthread.so.0 >+ >+ # and now for the static libs >+ mkdir -p ${D}/usr/$(get_libdir)/nptl >+ cp -a libc.a nptl/libpthread.a nptl/libpthread_nonshared.a rt/librt.a \ >+ ${D}/usr/$(get_libdir)/nptl >+ # linker script stuff >+ sed "s~/$(get_libdir)/~/$(get_libdir)/tls/~" ${D}/usr/$(get_libdir)/libc.so \ >+ > ${D}/usr/$(get_libdir)/nptl/libc.so >+ >+ sed "s~/$(get_libdir)/~/$(get_libdir)/tls/~" ${D}/usr/$(get_libdir)/libpthread.so \ >+ > ${D}/usr/$(get_libdir)/nptl/libpthread.so >+ sed -i -e "s~/usr/lib64/~/usr/lib64/nptl/~" ${D}/usr/$(get_libdir)/nptl/libpthread.so >+ >+ dosym ../${librtsofile} /usr/$(get_libdir)/nptl/librt.so >+ >+ # last but not least... headers. >+ mkdir -p ${D}/nptl ${D}/usr/include/nptl >+ make install_root=${D}/nptl install-headers PARALLELMFLAGS="${MAKEOPTS}" >+ pushd ${D}/nptl/usr/include > /dev/null >+ for i in `find . -type f`; do >+ if ! [ -f ${D}/usr/include/$i ] \ >+ || ! cmp -s $i ${D}/usr/include/$i; then >+ mkdir -p ${D}/usr/include/nptl/`dirname $i` >+ cp -a $i ${D}/usr/include/nptl/$i >+ fi >+ done >+ rm -rf ${D}/nptl >+ cd ${WORKDIR} >+ fi > > # If librt.so is a symlink, change it into linker script (Redhat) > if [ -L "${D}/usr/lib/librt.so" -a "${LIBRT_LINKERSCRIPT}" = "yes" ] >@@ -647,11 +745,9 @@ EOF > keepdir /usr/lib/locale/ru_RU/LC_MESSAGES > > einfo "Installing man pages and docs..." >- # Install linuxthreads man pages >- use_nptl || { >- dodir /usr/share/man/man3 >- doman ${S}/man/*.3thr >- } >+ # Install linuxthreads man pages even if nptl is enabled >+ dodir /usr/share/man/man3 >+ doman ${S}/man/*.3thr > > # Install nscd config file > insinto /etc ; doins ${FILESDIR}/nscd.conf
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 21132
:
33859
|
33860
|
41581
|
41593