summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/klibc
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core-testing/klibc')
-rw-r--r--abs/core-testing/klibc/PKGBUILD62
-rw-r--r--abs/core-testing/klibc/klibc-2.6.24.patch44
-rw-r--r--abs/core-testing/klibc/klibc-Kbuild.patch41
-rw-r--r--abs/core-testing/klibc/klibc-compile-shared-by-default.patch12
-rw-r--r--abs/core-testing/klibc/klibc-module-init-tools.patch63
-rw-r--r--abs/core-testing/klibc/multiple_raid_assembly_fix.patch20
6 files changed, 242 insertions, 0 deletions
diff --git a/abs/core-testing/klibc/PKGBUILD b/abs/core-testing/klibc/PKGBUILD
new file mode 100644
index 0000000..a65d119
--- /dev/null
+++ b/abs/core-testing/klibc/PKGBUILD
@@ -0,0 +1,62 @@
+# $Id: PKGBUILD 5849 2008-07-21 18:46:34Z thomas $
+# Maintainer: Aaron Griffin <aaron@archlinux.org>
+# Maintainer: Thomas Baechler <thomas@archlinux.org>
+
+###
+### NOTE: Do not build this package with anything except gcc - using ccache
+### forces others to use it as well as it becomes hardcoded in the klibc
+### script.
+###
+
+pkgname=klibc
+pkgver=1.5
+_klibcbranch=Stable #Stable/Testing
+_kver=2.6.26-ARCH
+pkgrel=15
+pkgdesc="A minimal libc made for early-userspace"
+arch=(i686 x86_64)
+url="http://www.kernel.org/pub/linux/libs/klibc/"
+license=('BSD')
+groups=('base')
+options=(!ccache !strip)
+source=(http://www.kernel.org/pub/linux/libs/klibc/$_klibcbranch/$pkgname-$pkgver.tar.gz
+ multiple_raid_assembly_fix.patch
+ klibc-compile-shared-by-default.patch
+ klibc-module-init-tools.patch
+ klibc-2.6.24.patch
+ klibc-Kbuild.patch)
+md5sums=('d55ce89c0656a7d6896ec0b2af07b5dc'
+ '8d257d50a4554d57b8f461c6a87a2877'
+ 'c263a7c3fd290fcc84a4e230d456d022'
+ '4d78311ebce63f2fbb711f8518e71839'
+ 'a98b3e96aff53339572ed0bdccc8aed2'
+ 'c928be0153585a487b72a7eb5dfa8b13')
+
+build()
+{
+ cd $startdir/src/$pkgname-$pkgver
+ #INI_DEBUG causes ipconfig to fail within kinit
+ sed -i "/#define INI_DEBUG/d" usr/kinit/kinit.h || return 1
+ ln -sf /usr/src/linux-${_kver} linux
+
+ patch -p1 -i ../multiple_raid_assembly_fix.patch || return 1
+ # make klibc-module-init-tools compile
+ # don't build insmod
+ patch -p1 -i ../klibc-module-init-tools.patch || return 1
+ # compile binaries shared by default
+ patch -p1 -i ../klibc-compile-shared-by-default.patch || return 1
+ # fix compilation on 2.6.24
+ patch -p1 -i ../klibc-2.6.24.patch || return 1
+ # don't build kill, gzip and cpio
+ patch -p1 -i ../klibc-Kbuild.patch || return 1
+
+ make EXTRA_KLIBCFLAGS='' || return 1
+ make INSTALLROOT=$startdir/pkg install || return 1
+ #simplify
+ mv $startdir/pkg/usr/lib/klibc/bin/sh.shared $startdir/pkg/usr/lib/klibc/bin/sh
+ mv $startdir/pkg/usr/lib/klibc/bin/kinit.shared $startdir/pkg/usr/lib/klibc/bin/kinit
+ ln -sf asm-x86 $startdir/pkg/usr/lib/klibc/include/asm
+
+ provides[${#provides[@]}]="$(basename $startdir/pkg/lib/klibc-*.so .so)"
+ export provides
+}
diff --git a/abs/core-testing/klibc/klibc-2.6.24.patch b/abs/core-testing/klibc/klibc-2.6.24.patch
new file mode 100644
index 0000000..2527699
--- /dev/null
+++ b/abs/core-testing/klibc/klibc-2.6.24.patch
@@ -0,0 +1,44 @@
+unchanged:
+--- klibc-1.5.orig/usr/klibc/arch/i386/MCONFIG 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/klibc/arch/i386/MCONFIG 2008-01-27 16:06:08.000000000 +0100
+@@ -31,3 +31,4 @@
+ # calls, and work on the memory models for this architecture
+ # 96 MB - normal binaries start at 128 MB
+ KLIBCSHAREDFLAGS = -Ttext 0x06000200
++KLIBCASMARCH = x86
+unchanged:
+--- klibc-1.5.orig/usr/klibc/arch/x86_64/MCONFIG 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/klibc/arch/x86_64/MCONFIG 2008-01-27 16:05:43.000000000 +0100
+@@ -36,4 +36,4 @@
+ KLIBCSHAREDFLAGS = -Ttext 0x00200200 -z max-page-size=0x100000
+
+ # Additional asm- directories needed during installation
+-ASMARCH = asm-i386
++KLIBCASMARCH = x86
+only in patch2:
+unchanged:
+--- a/scripts/Kbuild.install 2007-03-04 02:52:10.000000000 +0100
++++ b/scripts/Kbuild.install 2007-11-04 15:43:28.000000000 +0100
+@@ -84,6 +84,13 @@
+ # 1) Create directories, install headers and man pages
+ # 2) Tell that we now install binaries
+ # 3) Install binaries by descending
++
++# Arch specific definitions for klibc
++include $(KLIBCSRC)/arch/$(KLIBCARCHDIR)/MCONFIG
++
++# include/asm-* architecture
++KLIBCASMARCH ?= $(KLIBCARCH)
++
+ .PHONY: header footer descend
+ header:
+ $(Q)echo " INSTALL headers + man pages to $(INSTALLROOT)$(INSTALLDIR)"
+@@ -95,7 +102,7 @@
+ $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include
+ $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib
+ $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin
+- $(Q)set -e ; for d in linux scsi asm-$(KLIBCARCH) asm-generic $(ASMKLIBCARCH); do \
++ $(Q)set -e ; for d in linux scsi asm-$(KLIBCASMARCH) asm-generic $(ASMKLIBCARCH); do \
+ mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KLIBCCROSS)include/$$d ; \
+ for r in $(KLIBCKERNELSRC)/include $(KLIBCKERNELOBJ)/include \
+ $(KLIBCKERNELOBJ)/include2 ; do \
diff --git a/abs/core-testing/klibc/klibc-Kbuild.patch b/abs/core-testing/klibc/klibc-Kbuild.patch
new file mode 100644
index 0000000..93a95da
--- /dev/null
+++ b/abs/core-testing/klibc/klibc-Kbuild.patch
@@ -0,0 +1,41 @@
+diff -Nur klibc-1.5.orig/Kbuild klibc-1.5/Kbuild
+--- klibc-1.5.orig/Kbuild 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/Kbuild 2008-05-14 12:45:02.000000000 +0200
+@@ -10,9 +10,8 @@
+ $(Q)$(MAKE) $(klibc)=usr/kinit
+ $(Q)$(MAKE) $(klibc)=usr/dash
+ $(Q)$(MAKE) $(klibc)=usr/utils
+- $(Q)$(MAKE) $(klibc)=usr/gzip
+
+
+ # Directories to visit during clean and install
+-subdir- := scripts/basic klcc usr/klibc usr/dash usr/utils usr/gzip \
++subdir- := scripts/basic klcc usr/klibc usr/dash usr/utils \
+ usr/kinit usr/klibc/tests
+diff -Nur klibc-1.5.orig/usr/Kbuild klibc-1.5/usr/Kbuild
+--- klibc-1.5.orig/usr/Kbuild 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/Kbuild 2008-05-14 12:45:02.000000000 +0200
+@@ -6,7 +6,7 @@
+
+ include-subdir := include
+ klibc-subdir := klibc
+-usr-subdirs := kinit utils dash gzip
++usr-subdirs := kinit utils dash
+ subdir- := $(include-subdir) $(klibc-subdir) $(usr-subdirs)
+
+ usr-subdirs := $(addprefix _usr_,$(usr-subdirs))
+diff -Nur klibc-1.5.orig/usr/utils/Kbuild klibc-1.5/usr/utils/Kbuild
+--- klibc-1.5.orig/usr/utils/Kbuild 2008-05-14 12:44:47.000000000 +0200
++++ klibc-1.5/usr/utils/Kbuild 2008-05-14 12:45:20.000000000 +0200
+@@ -2,9 +2,9 @@
+ # Kbuild file for klib utils
+ #
+
+-progs := chroot dd mkdir mkfifo mknod mount pivot_root umount
++progs := chroot dd mkdir mkfifo mount pivot_root umount
+ progs += true false sleep ln nuke minips cat
+-progs += uname halt kill readlink cpio
++progs += uname halt readlink
+
+ static-y := $(addprefix static/, $(progs))
+ shared-y := $(addprefix shared/, $(progs))
diff --git a/abs/core-testing/klibc/klibc-compile-shared-by-default.patch b/abs/core-testing/klibc/klibc-compile-shared-by-default.patch
new file mode 100644
index 0000000..e144c3e
--- /dev/null
+++ b/abs/core-testing/klibc/klibc-compile-shared-by-default.patch
@@ -0,0 +1,12 @@
+diff -Nur klibc-1.5.orig/klcc/klcc.in klibc-1.5/klcc/klcc.in
+--- klibc-1.5.orig/klcc/klcc.in 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/klcc/klcc.in 2007-10-31 09:20:34.000000000 +0100
+@@ -113,7 +113,7 @@
+
+ $save_temps = 0; # The -save-temps option
+ $verbose = 0; # The -v option
+-$shared = 0; # Are we compiling shared?
++$shared = 1; # Are we compiling shared?
+ $debugging = 0; # -g or -p option present?
+ $strip = 0; # -s option present?
+ undef $output; # -o option present?
diff --git a/abs/core-testing/klibc/klibc-module-init-tools.patch b/abs/core-testing/klibc/klibc-module-init-tools.patch
new file mode 100644
index 0000000..a5e4532
--- /dev/null
+++ b/abs/core-testing/klibc/klibc-module-init-tools.patch
@@ -0,0 +1,63 @@
+diff -Nur klibc-1.5.orig/usr/include/sys/elf32.h klibc-1.5/usr/include/sys/elf32.h
+--- klibc-1.5.orig/usr/include/sys/elf32.h 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/include/sys/elf32.h 2007-10-31 09:18:09.000000000 +0100
+@@ -110,4 +110,8 @@
+ Elf32_Word n_type; /* Content type */
+ } Elf32_Nhdr;
+
++/* How to extract and insert information held in the st_info field. */
++#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4)
++#define ELF32_ST_TYPE(val) ((val) & 0xf)
++
+ #endif /* _SYS_ELF32_H */
+diff -Nur klibc-1.5.orig/usr/include/sys/elf64.h klibc-1.5/usr/include/sys/elf64.h
+--- klibc-1.5.orig/usr/include/sys/elf64.h 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/include/sys/elf64.h 2007-10-31 09:18:09.000000000 +0100
+@@ -110,4 +110,8 @@
+ Elf64_Word n_type; /* Content type */
+ } Elf64_Nhdr;
+
++/* Both Elf32_Sym and Elf64_Sym use the same one-byte st_info field. */
++#define ELF64_ST_BIND(val) ELF32_ST_BIND (val)
++#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val)
++
+ #endif /* _SYS_ELF64_H */
+diff -Nur klibc-1.5.orig/usr/include/sys/elfcommon.h klibc-1.5/usr/include/sys/elfcommon.h
+--- klibc-1.5.orig/usr/include/sys/elfcommon.h 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/include/sys/elfcommon.h 2007-10-31 09:18:09.000000000 +0100
+@@ -184,4 +184,14 @@
+ #define ELFOSABI_NONE 0
+ #define ELFOSABI_LINUX 3
+
++/* Legal values for ST_BIND subfield of st_info (symbol binding). */
++#define STB_LOCAL 0 /* Local symbol */
++#define STB_GLOBAL 1 /* Global symbol */
++#define STB_WEAK 2 /* Weak symbol */
++#define STB_NUM 3 /* Number of defined types. */
++#define STB_LOOS 10 /* Start of OS-specific */
++#define STB_HIOS 12 /* End of OS-specific */
++#define STB_LOPROC 13 /* Start of processor-specific */
++#define STB_HIPROC 15 /* End of processor-specific */
++
+ #endif /* _SYS_ELFCOMMON_H */
+diff -Nur klibc-1.5.orig/usr/utils/Kbuild klibc-1.5/usr/utils/Kbuild
+--- klibc-1.5.orig/usr/utils/Kbuild 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/utils/Kbuild 2007-10-31 09:18:28.000000000 +0100
+@@ -4,7 +4,7 @@
+
+ progs := chroot dd mkdir mkfifo mknod mount pivot_root umount
+ progs += true false sleep ln nuke minips cat
+-progs += insmod uname halt kill readlink cpio
++progs += uname halt kill readlink cpio
+
+ static-y := $(addprefix static/, $(progs))
+ shared-y := $(addprefix shared/, $(progs))
+@@ -40,8 +40,6 @@
+ shared/minips-y := minips.o
+ static/cat-y := cat.o
+ shared/cat-y := cat.o
+-static/insmod-y := insmod.o
+-shared/insmod-y := insmod.o
+ static/uname-y := uname.o
+ shared/uname-y := uname.o
+ static/halt-y := halt.o
diff --git a/abs/core-testing/klibc/multiple_raid_assembly_fix.patch b/abs/core-testing/klibc/multiple_raid_assembly_fix.patch
new file mode 100644
index 0000000..237a1db
--- /dev/null
+++ b/abs/core-testing/klibc/multiple_raid_assembly_fix.patch
@@ -0,0 +1,20 @@
+--- a/usr/kinit/do_mounts_md.c 2006-07-31 21:16:01.000000000 -0500
++++ b/usr/kinit/do_mounts_md.c 2006-07-31 21:18:46.000000000 -0500
+@@ -228,6 +228,7 @@
+ char *devname;
+ mdu_disk_info_t dinfo;
+ char name[16];
++ struct stat st_chk;
+
+ dev_minor = md_setup_args[ent].minor;
+ partitioned = md_setup_args[ent].partitioned;
+@@ -236,6 +237,9 @@
+ snprintf(name, sizeof name,
+ "/dev/md%s%d", partitioned ? "_d" : "", dev_minor);
+
++ if (stat(name, &st_chk) == 0)
++ continue;
++
+ if (partitioned)
+ dev = makedev(mdp_major(), dev_minor << MdpMinorShift);
+ else