From: greg@kroah.com Date: Thu, 12 Feb 2004 02:34:28 +0000 (-0800) Subject: [PATCH] finish syncing up with klibc X-Git-Tag: 017~30 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=da92f46b9e86643e70861bb705453f81aef5618d [PATCH] finish syncing up with klibc --- diff --git a/klibc/MCONFIG b/klibc/MCONFIG index 8b5da4154..de8b332d9 100644 --- a/klibc/MCONFIG +++ b/klibc/MCONFIG @@ -21,7 +21,8 @@ PERL = perl STRIP = $(CROSS)strip --strip-all -R .comment -R .note HOST_CC = gcc -HOST_LDFLAGS = -s +HOST_CFLAGS = -g -O +HOST_LDFLAGS = HOST_LIBS = CRT0 = $(KLIBSRC)/crt0.o diff --git a/klibc/MRULES b/klibc/MRULES new file mode 100644 index 000000000..8a8831c34 --- /dev/null +++ b/klibc/MRULES @@ -0,0 +1,41 @@ +# -*- makefile -*- +# +# Standard pattern rules +# + +.SUFFIXES: .c .o .a .so .lo .i .S .s .ls .ss .lss + +.c.o: + $(CC) $(CFLAGS) -c -o $@ $< + +.c.i: + $(CC) $(CFLAGS) -E -o $@ $< + +.c.s: + $(CC) $(CFLAGS) -S -o $@ $< + +.S.o: + $(CC) $(CFLAGS) -D__ASSEMBLY__ -c -o $@ $< + +.S.s: + $(CC) $(CFLAGS) -D__ASSEMBLY__ -E -o $@ $< + +.S.lo: + $(CC) $(CFLAGS) $(SOFLAGS) -D__ASSEMBLY__ -c -o $@ $< + +.S.ls: + $(CC) $(CFLAGS) $(SOFLAGS) -D__ASSEMBLY__ -E -o $@ $< + +.s.o: + $(CC) $(CFLAGS) -x assembler -c -o $@ $< + +.ls.lo: + $(CC) $(CFLAGS) $(SOFLAGS) -x assembler -c -o $@ $< + +.c.lo: + $(CC) $(CFLAGS) $(SOFLAGS) -c -o $@ $< + +.c.ls: + $(CC) $(CFLAGS) $(SOFLAGS) -S -o $@ $< + + diff --git a/klibc/README b/klibc/README index 577de2b70..438136487 100644 --- a/klibc/README +++ b/klibc/README @@ -1,8 +1,10 @@ -Please see klibc/README for how to set up the tree before building. +Please see klibc/README for build instructions. + + klibc is archived at: - ftp://ftp.zytor.com/pub/linux/libs/klibc/ + ftp://ftp.kernel.org/pub/linux/libs/klibc/ There is a mailing list for klibc and early-userspace issues at: @@ -12,5 +14,7 @@ There is also a cvsweb repository at: http://www.zytor.com/cvsweb.cgi/klibc/ -There is no direct public CVS access yet, however. +There is no direct public CVS access yet, however, the CVS repository +is available for rsync from: + rsync://rsync.kernel.org/pub/linux/libs/klibc/cvsroot/ diff --git a/klibc/klibc.spec.in b/klibc/klibc.spec.in new file mode 100644 index 000000000..f8bccc390 --- /dev/null +++ b/klibc/klibc.spec.in @@ -0,0 +1,151 @@ +%define _rpmdir rpms +%define _builddir . + +Summary: A minimal libc subset for use with initramfs. +Name: klibc +Version: 0.89 +Release: 1 +License: BSD/GPL +Group: Development/Libraries +URL: http://www.zytor.com/klibc +Source: /dev/null +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot +Packager: Bryan O'Sullivan +Prefix: /usr +Vendor: Starving Linux Artists + +%description +%{name} is intended to be a minimalistic libc subset for use with +initramfs. It is deliberately written for small size, minimal +entanglement, and portability, not speed. It is definitely a work in +progress, and a lot of things are still missing. + +%package kernheaders +Summary: Kernel headers used during the build of klibc. +Group: Development/Libraries + +%description kernheaders +This package contains the set of kernel headers that were required to +build %{name} and the utilities that ship with it. This may or may +not be a complete enough set to build other programs that link against +%{name}. If in doubt, use real kernel headers instead. + +%package utils +Summary: Small statically-linked utilities built with klibc. +Group: Utilities/System + +%description utils + +This package contains a collection of programs that are statically +linked against klibc. These duplicate some of the functionality of a +regular Linux toolset, but are typically much smaller than their +full-function counterparts. They are intended for inclusion in +initramfs images and embedded systems. + +%prep +if [ ! -L linux ]; then + echo "*** You must have a symlink named linux to build klibc" 1>&2 + exit 1 +fi +if [ ! -f linux/include/asm/page.h ]; then + echo "*** You need to 'make prepare' in the linux tree before building klibc" 1>&2 + exit 1 +fi +mkdir -p %{buildroot} %{_rpmdir} + +%build +make + +%install +rm -rf %{buildroot} + +dest=%{buildroot}/%{prefix} +lib=$dest/%{_lib}/klibc +inc=$dest/include/klibc +exe=$dest/libexec/klibc +doc=$dest/share/doc/%{name}-%{version} +udoc=$dest/share/doc/%{name}-utils-%{version} + +# First, the library. + +install -dD -m 755 $lib $inc/kernel $exe $doc $udoc +install -m 755 klibc/klibc.so $lib +install -m 644 klibc/libc.a $lib +install -m 644 klibc/crt0.o $lib +install -m 644 klibc/libc.so.hash $lib +ln $lib/klibc.so $lib/libc.so +ln $lib/klibc.so $lib/klibc-$(cat $lib/libc.so.hash).so + +# Next, the generated binaries. + +install -m 755 ash/sh $exe +install -m 755 gzip/gzip $exe +ln $exe/gzip $exe/gunzip +ln $exe/gzip $exe/zcat +install -m 755 ipconfig/ipconfig $exe +install -m 755 kinit/kinit $exe +install -m 755 nfsmount/nfsmount $exe +for i in chroot dd fstype mkdir mkfifo mount umount; do + install -m 755 utils/$i $exe +done + +# The docs. + +install -m 444 README $doc +install -m 444 klibc/README $doc/README.klibc +install -m 444 klibc/arch/README $doc/README.klibc.arch + +install -m 444 gzip/COPYING $udoc/COPYING.gzip +install -m 444 gzip/README $udoc/README.gzip +install -m 444 ipconfig/README $udoc/README.ipconfig +install -m 444 kinit/README $udoc/README.kinit + +# Finally, the include files. + +bitsize=$(make --no-print-directory -C klibc bitsize) +cp --parents $(find klibc/include \( -name CVS -o -name SCCS \) -prune \ + -o -name '*.h' -print) $inc +mv $inc/klibc $inc/klibc.$$ +mv $inc/klibc.$$/include/* $inc +mv $inc/bits$bitsize/bitsize $inc +rm -rf $inc/klibc.$$ $inc/bits[0-9]* +pushd klibc/arch/%{_arch}/include +cp --parents -f $(find . \( -name CVS -o -name SCCS \) -prune \ + -o -name '*.h' -print) $inc +popd + +# Yeugh. Find the transitive closure over all kernel headers included +# by klibc, and copy them into place. + +find . -name '.*.d' | xargs -r sed -e 's,[ \t][ \t]*,\n,g' | sed -n -e 's,^\.\./linux/include/,,p' | sort | uniq | (cd linux/include && xargs -ri cp --parents '{}' $inc/kernel) + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%docdir %{prefix}/share/doc/%{name}-%{version} +%{prefix}/%{_lib}/klibc +%dir %{prefix}/include/klibc +%{prefix}/include/klibc/*.h +%{prefix}/include/klibc/arpa +%{prefix}/include/klibc/bitsize +%{prefix}/include/klibc/klibc +%{prefix}/include/klibc/net +%{prefix}/include/klibc/netinet +%{prefix}/include/klibc/sys +%{prefix}/share/doc/%{name}-%{version} + +%files kernheaders +%defattr(-,root,root,-) +%{prefix}/include/klibc/kernel + +%files utils +%defattr(-,root,root,-) +%{prefix}/libexec/klibc +%docdir %{prefix}/share/doc/%{name}-utils-%{version} +%{prefix}/share/doc/%{name}-utils-%{version} + +%changelog +* Sat Nov 29 2003 Bryan O'Sullivan - +- Initial build. diff --git a/klibc/version b/klibc/version index 2f3d7fa99..f14cf6a1e 100644 --- a/klibc/version +++ b/klibc/version @@ -1 +1 @@ -0.101 +0.107