-%define glibcrelease 1
+%define glibcrelease 2
%define auxarches i586 i686 athlon sparcv9 alphaev6
%define prelinkarches noarch
%define nptlarches i386 i686 athlon x86_64 ia64 s390 s390x sparcv9 ppc ppc64
-%define rtkaioarches noarch
%define withtlsarches i386 i686 athlon x86_64 ia64 s390 s390x alpha alphaev6 sparc sparcv9 ppc ppc64
+%define xenarches i686 athlon
+%ifarch %{xenarches}
+%define buildxen 1
+%define xenpackage 1
+%else
+%define buildxen 0
+%define xenpackage 0
+%endif
+%define rtkaioarches noarch
%define debuginfocommonarches %{ix86} alpha alphaev6 sparc sparcv9
%define _unpackaged_files_terminate_build 0
Summary: The GNU libc libraries.
library and the standard math library. Without these two libraries, a
Linux system will not function.
+%if %{xenpackage}
+%package xen
+Summary: The GNU libc libraries (optimized for running under Xen)
+Group: System Environment/Libraries
+Requires: glibc = %{version}-%{release}, glibc-utils = %{version}-%{release}
+
+%description xen
+The standard glibc package is optimized for native kernels and does not
+perform as well under the Xen hypervisor. This package provides alternative
+library binaries that will be selected instead when running under Xen.
+
+Install glibc-xen if you might run your system under the Xen hypervisor.
+%endif
+
%package devel
Summary: Object files for development using standard C libraries.
Group: Development/Libraries
%endif
%ifarch %{nptlarches}
-rm -rf build-%{nptl_target_cpu}-linuxnptl
-mkdir build-%{nptl_target_cpu}-linuxnptl ; cd build-%{nptl_target_cpu}-linuxnptl
+build_nptl()
+{
+builddir=build-%{nptl_target_cpu}-$1
+shift
+rm -rf $builddir
+mkdir $builddir ; cd $builddir
EnableKernel="--enable-kernel=%{enablekernelnptl} --disable-profile"
Pthreads=nptl
WithTls="--with-tls --with-__thread"
-CC="$GCC" CFLAGS="$BuildFlags -g -O3" ../configure --prefix=%{_prefix} \
+build_CFLAGS="$BuildFlags -g -O3 $*"
+CC="$GCC" CFLAGS="$build_CFLAGS" ../configure --prefix=%{_prefix} \
--enable-add-ons=$Pthreads$AddOns --without-cvs $EnableKernel \
--with-headers=%{_prefix}/include --enable-bind-now \
$WithTls --build %{nptl_target_cpu}-redhat-linux --host %{nptl_target_cpu}-redhat-linux
-make -j$numprocs -r CFLAGS="$BuildFlags -g -O3" PARALLELMFLAGS=-s
+make -j$numprocs -r CFLAGS="$build_CFLAGS" PARALLELMFLAGS=-s
cd ..
+}
+
+build_nptl linuxnptl
+
+%if %{buildxen}
+build_nptl linuxnptl-nosegneg -mno-tls-direct-seg-refs
+%endif
%endif
%install
%endif
%ifarch %{nptlarches}
-cd build-%{nptl_target_cpu}-linuxnptl
+ObsDir=obsolete/linuxthreads
mkdir -p $RPM_BUILD_ROOT/%{_lib}/obsolete/linuxthreads
mv -f $RPM_BUILD_ROOT/%{_lib}/lib{c,m,pthread,rt,thread_db}[.-]*so* $RPM_BUILD_ROOT/%{_lib}/obsolete/linuxthreads/
+
+install_nptl() {
+cd build-%{nptl_target_cpu}-$1
Pthreads=nptl
-SubDir=
-ObsDir=obsolete/linuxthreads
+SubDir=$2
mkdir -p $RPM_BUILD_ROOT/%{_lib}/$SubDir/
cp -a libc.so $RPM_BUILD_ROOT/%{_lib}/$SubDir/`basename $RPM_BUILD_ROOT/%{_lib}/$ObsDir/libc-*.so`
ln -sf `basename $RPM_BUILD_ROOT/%{_lib}/$ObsDir/libc-*.so` $RPM_BUILD_ROOT/%{_lib}/$SubDir/`basename $RPM_BUILD_ROOT/%{_lib}/$ObsDir/libc.so.*`
%endif
cp -a ${Pthreads}_db/libthread_db.so $RPM_BUILD_ROOT/%{_lib}/$SubDir/`basename $RPM_BUILD_ROOT/%{_lib}/$ObsDir/libthread_db-*.so`
ln -sf `basename $RPM_BUILD_ROOT/%{_lib}/$ObsDir/libthread_db-*.so` $RPM_BUILD_ROOT/%{_lib}/$SubDir/`basename $RPM_BUILD_ROOT/%{_lib}/$ObsDir/libthread_db.so.*`
+}
+
+install_nptl linuxnptl
mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{_lib}/linuxthreads
mv -f $RPM_BUILD_ROOT%{_prefix}/%{_lib}/{libc,libpthread,libpthread_nonshared,librt}.a \
cd ..
+%if %{buildxen}
+%define nosegneg_subdir i686/nosegneg
+install_nptl linuxnptl-nosegneg %{nosegneg_subdir}
+cd ..
+%endif
+
%endif
# compatibility hack: this locale has vanished from glibc, but some other
grep -v '%{_prefix}/sbin/[^gi]' |
grep -v '%{_prefix}/share' > rpm.filelist
+> nosegneg.filelist
+%if %{xenpackage}
+grep '/%{_lib}/%{nosegneg_subdir}' < rpm.filelist >> nosegneg.filelist
+mv rpm.filelist rpm.filelist.full
+grep -v '/%{_lib}/%{nosegneg_subdir}' < rpm.filelist.full > rpm.filelist
+%endif
+
echo '%{_prefix}/sbin/build-locale-archive' >> common.filelist
echo '%{_prefix}/sbin/nscd' > nscd.filelist
cd build-%{nptl_target_cpu}-linuxnptl
make -j$numprocs -k check PARALLELMFLAGS=-s 2>&1 | tee check.log || :
cd ..
+%if %{buildxen}
+echo ====================TESTING NPTL -mno-tls-direct-seg-refs=============
+cd build-%{nptl_target_cpu}-linuxnptl-nosegneg
+make -j$numprocs -k check PARALLELMFLAGS=-s 2>&1 | tee check.log || :
+cd ..
+%endif
%endif
echo ====================TESTING DETAILS=================
for i in `sed -n 's|^.*\*\*\* \[\([^]]*\.out\)\].*$|\1|p' build-*-linux*/check.log`; do
strip $RPM_BUILD_ROOT/{sbin/ldconfig,usr/sbin/glibc_post_upgrade.%{_target_cpu},usr/sbin/build-locale-archive}
# Strip ELF binaries
-for f in `grep -v '%%\(dir\|lang\|config\|verify\)' rpm.filelist`; do
+for f in `cat rpm.filelist nosegneg.filelist \
+ | grep -v '%%\(dir\|lang\|config\|verify\)'`; do
bf=$RPM_BUILD_ROOT$f
if [ -f $bf -a -x $bf -a ! -h $bf ]; then
if `file $bf 2>/dev/null | grep 'ELF.*, not stripped' | grep -vq 'statically linked'`; then
service nscd condrestart > /dev/null 2>&1 || :
fi
+%if %{xenpackage}
+%post xen -p /sbin/ldconfig
+%postun xen -p /sbin/ldconfig
+%endif
+
%clean
rm -rf "$RPM_BUILD_ROOT"
rm -f *.filelist*
%dir /lib/i686
%endif
%endif
+%if %{buildxen} && !%{xenpackage}
+%dir /%{_lib}/%{nosegneg_subdir}
+%endif
%ifarch s390x
%dir /lib
/lib/ld64.so.1
%doc COPYING COPYING.LIB README.libm LICENSES
%doc hesiod/README.hesiod
+%if %{xenpackage}
+%files -f nosegneg.filelist xen
+%defattr(-,root,root)
+%dir /%{_lib}/%{nosegneg_subdir}
+%endif
+
%ifnarch %{auxarches}
%files -f common.filelist common
%defattr(-,root,root)
%endif
%changelog
+- glibc-xen subpackage for i686
+
* Fri Apr 15 2005 Roland McGrath <roland@redhat.com> 2.3.5-1
- update from CVS
- fix execvp regression (BZ#851)