summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-02-24 19:54:47 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 23:36:14 -0700
commit833aa0fab572536ebb680cc54bf95c50c3b36a0f (patch)
tree1ca75bd4cfd6433d97d547fc836a47ef6dde0808
parentf385ff6512012a75b8381938dd3f55f991b53e9a (diff)
[PATCH] klibc v0.199
-rw-r--r--klibc/MCONFIG5
-rw-r--r--klibc/include/arch/parisc/klibc/archsetjmp.h14
-rw-r--r--klibc/klibc.spec2
-rw-r--r--klibc/klibc/arch/alpha/MCONFIG2
-rw-r--r--klibc/klibc/arch/arm/MCONFIG2
-rw-r--r--klibc/klibc/arch/ia64/MCONFIG2
-rw-r--r--klibc/klibc/arch/ia64/setjmp.S2
-rw-r--r--klibc/klibc/arch/ia64/vfork.S3
-rw-r--r--klibc/klibc/arch/m32r/MCONFIG2
-rw-r--r--klibc/klibc/arch/mips/MCONFIG2
-rw-r--r--klibc/klibc/arch/mips64/MCONFIG2
-rw-r--r--klibc/klibc/arch/parisc/setjmp.S2
-rw-r--r--klibc/klibc/arch/parisc/sysstub.ph1
-rw-r--r--klibc/klibc/arch/ppc/MCONFIG2
-rw-r--r--klibc/klibc/arch/ppc64/MCONFIG2
-rw-r--r--klibc/klibc/arch/s390/MCONFIG2
-rw-r--r--klibc/klibc/arch/s390x/MCONFIG2
-rw-r--r--klibc/klibc/arch/sparc/MCONFIG2
-rw-r--r--klibc/klibc/arch/sparc64/MCONFIG2
-rw-r--r--klibc/klibc/arch/sparc64/crt0.S2
-rw-r--r--klibc/klibc/memmem.c54
-rw-r--r--klibc/klibc/strncat.c1
-rw-r--r--klibc/version2
23 files changed, 70 insertions, 42 deletions
diff --git a/klibc/MCONFIG b/klibc/MCONFIG
index 7da150d031..3fae2898c6 100644
--- a/klibc/MCONFIG
+++ b/klibc/MCONFIG
@@ -62,5 +62,10 @@ ERRLIST = 1
#
include $(KLIBSRC)/arch/$(ARCH)/MCONFIG
+ifeq ($(DEBUG),y)
+STRIP = /bin/true -Since_we_are_debugging
+OPTFLAGS += -O1 -g
+endif
+
# How to tell the linker main() is the entrypoint
EMAIN ?= -e main
diff --git a/klibc/include/arch/parisc/klibc/archsetjmp.h b/klibc/include/arch/parisc/klibc/archsetjmp.h
new file mode 100644
index 0000000000..e7444983ed
--- /dev/null
+++ b/klibc/include/arch/parisc/klibc/archsetjmp.h
@@ -0,0 +1,14 @@
+/*
+ * arch/parisc/include/klibc/archsetjmp.h
+ */
+
+#ifndef _KLIBC_ARCHSETJMP_H
+#define _KLIBC_ARCHSETJMP_H
+
+struct __jmp_buf {
+ double regs[21];
+};
+
+typedef struct __jmp_buf jmp_buf[1];
+
+#endif /* _SETJMP_H */
diff --git a/klibc/klibc.spec b/klibc/klibc.spec
index 02131c7f25..de0a14cf63 100644
--- a/klibc/klibc.spec
+++ b/klibc/klibc.spec
@@ -1,6 +1,6 @@
Summary: A minimal libc subset for use with initramfs.
Name: klibc
-Version: 0.198
+Version: 0.199
Release: 1
License: BSD/GPL
Group: Development/Libraries
diff --git a/klibc/klibc/arch/alpha/MCONFIG b/klibc/klibc/arch/alpha/MCONFIG
index 5987ed5841..d7ab6c0b82 100644
--- a/klibc/klibc/arch/alpha/MCONFIG
+++ b/klibc/klibc/arch/alpha/MCONFIG
@@ -5,7 +5,7 @@
# Build configuration for this architecture
#
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 64
# Extra linkflags when building the shared version of the library
diff --git a/klibc/klibc/arch/arm/MCONFIG b/klibc/klibc/arch/arm/MCONFIG
index 6fbea32903..fe26b996a7 100644
--- a/klibc/klibc/arch/arm/MCONFIG
+++ b/klibc/klibc/arch/arm/MCONFIG
@@ -11,7 +11,7 @@ THUMB = n
CPU_ARCH := armv4
CPU_TUNE := strongarm
-OPTFLAGS = -Os -fomit-frame-pointer -march=$(CPU_ARCH) -mtune=$(CPU_TUNE)
+OPTFLAGS = -Os -march=$(CPU_ARCH) -mtune=$(CPU_TUNE)
BITSIZE = 32
ifeq ($(THUMB),y)
diff --git a/klibc/klibc/arch/ia64/MCONFIG b/klibc/klibc/arch/ia64/MCONFIG
index 631a478e4f..36b30ffb81 100644
--- a/klibc/klibc/arch/ia64/MCONFIG
+++ b/klibc/klibc/arch/ia64/MCONFIG
@@ -7,5 +7,5 @@
# accordingly.
#
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 64
diff --git a/klibc/klibc/arch/ia64/setjmp.S b/klibc/klibc/arch/ia64/setjmp.S
index 50f91dc1d6..7859ba4143 100644
--- a/klibc/klibc/arch/ia64/setjmp.S
+++ b/klibc/klibc/arch/ia64/setjmp.S
@@ -61,6 +61,7 @@
//
.align 32
.global setjmp
+ .proc setjmp
setjmp:
//
// Make sure buffer is aligned at 16byte boundary
@@ -190,6 +191,7 @@ setjmp:
.align 32
.global longjmp
+ .proc longjmp
longjmp:
//
// Make sure buffer is aligned at 16byte boundary
diff --git a/klibc/klibc/arch/ia64/vfork.S b/klibc/klibc/arch/ia64/vfork.S
index efcd03f7f1..f79bdc8234 100644
--- a/klibc/klibc/arch/ia64/vfork.S
+++ b/klibc/klibc/arch/ia64/vfork.S
@@ -19,6 +19,7 @@
/* pid_t vfork(void) */
/* Implemented as clone(CLONE_VFORK | CLONE_VM | SIGCHLD, 0) */
+ .align 32
.proc vfork
.global vfork
vfork:
@@ -38,4 +39,4 @@ vfork:
;;
(p7) mov r8=-1
br.ret.sptk.many b0
- .endp
+ .endp vfork
diff --git a/klibc/klibc/arch/m32r/MCONFIG b/klibc/klibc/arch/m32r/MCONFIG
index 6706d9ddc1..2673090fce 100644
--- a/klibc/klibc/arch/m32r/MCONFIG
+++ b/klibc/klibc/arch/m32r/MCONFIG
@@ -7,7 +7,7 @@
# accordingly.
#
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 32
# Extra linkflags when building the shared version of the library
diff --git a/klibc/klibc/arch/mips/MCONFIG b/klibc/klibc/arch/mips/MCONFIG
index a248973815..0a98918987 100644
--- a/klibc/klibc/arch/mips/MCONFIG
+++ b/klibc/klibc/arch/mips/MCONFIG
@@ -8,7 +8,7 @@
#
ARCHREQFLAGS = -fno-pic -mno-abicalls -G 0
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 32
# Extra linkflags when building the shared version of the library
diff --git a/klibc/klibc/arch/mips64/MCONFIG b/klibc/klibc/arch/mips64/MCONFIG
index 6a817e54b6..66405e4373 100644
--- a/klibc/klibc/arch/mips64/MCONFIG
+++ b/klibc/klibc/arch/mips64/MCONFIG
@@ -7,5 +7,5 @@
# accordingly.
#
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 64
diff --git a/klibc/klibc/arch/parisc/setjmp.S b/klibc/klibc/arch/parisc/setjmp.S
index 51b2b1a58b..aebe03a5ed 100644
--- a/klibc/klibc/arch/parisc/setjmp.S
+++ b/klibc/klibc/arch/parisc/setjmp.S
@@ -27,7 +27,7 @@ setjmp:
stw %r17,60(%r26)
stw %r18,64(%r26)
stw %r19,68(%r26)
- stw %dp,72(%r26)
+ stw %r27,72(%r26)
stw %r30,76(%r26)
stw %rp,80(%r26)
ldo 88(%r26),%r19
diff --git a/klibc/klibc/arch/parisc/sysstub.ph b/klibc/klibc/arch/parisc/sysstub.ph
index eb6b5dd92a..63b5e17fcf 100644
--- a/klibc/klibc/arch/parisc/sysstub.ph
+++ b/klibc/klibc/arch/parisc/sysstub.ph
@@ -16,7 +16,6 @@ sub make_sysstub($$$$@) {
print OUT "\t.import __syscall_common, code\n";
print OUT "\t.global ${fname}\n";
print OUT "\t.export ${fname}, code\n";
- print OUT "\t.type ${fname}, @function\n";
print OUT "\t.proc\n";
print OUT "\.callinfo\n";
print OUT "${fname}:\n";
diff --git a/klibc/klibc/arch/ppc/MCONFIG b/klibc/klibc/arch/ppc/MCONFIG
index ff7c44db9a..82c7107013 100644
--- a/klibc/klibc/arch/ppc/MCONFIG
+++ b/klibc/klibc/arch/ppc/MCONFIG
@@ -7,7 +7,7 @@
# accordingly.
#
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 32
# Extra linkflags when building the shared version of the library
diff --git a/klibc/klibc/arch/ppc64/MCONFIG b/klibc/klibc/arch/ppc64/MCONFIG
index 09881b8d40..9aba2ddbb6 100644
--- a/klibc/klibc/arch/ppc64/MCONFIG
+++ b/klibc/klibc/arch/ppc64/MCONFIG
@@ -8,7 +8,7 @@
#
ARCHREQFLAGS = -m64 -mcall-aixdesc
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 64
LDFLAGS = -m elf64ppc
diff --git a/klibc/klibc/arch/s390/MCONFIG b/klibc/klibc/arch/s390/MCONFIG
index e32c33faa1..640b395b54 100644
--- a/klibc/klibc/arch/s390/MCONFIG
+++ b/klibc/klibc/arch/s390/MCONFIG
@@ -7,7 +7,7 @@
# accordingly.
#
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 32
SHAREDFLAGS = -Ttext 0x40000200
diff --git a/klibc/klibc/arch/s390x/MCONFIG b/klibc/klibc/arch/s390x/MCONFIG
index 1c8232bed5..081a0bbb52 100644
--- a/klibc/klibc/arch/s390x/MCONFIG
+++ b/klibc/klibc/arch/s390x/MCONFIG
@@ -7,7 +7,7 @@
# accordingly.
#
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 64
SHAREDFLAGS = -Ttext 0x40000200
diff --git a/klibc/klibc/arch/sparc/MCONFIG b/klibc/klibc/arch/sparc/MCONFIG
index cb94f46c00..55f8b198c2 100644
--- a/klibc/klibc/arch/sparc/MCONFIG
+++ b/klibc/klibc/arch/sparc/MCONFIG
@@ -7,7 +7,7 @@
# accordingly.
#
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 32
# Extra linkflags when building the shared version of the library
diff --git a/klibc/klibc/arch/sparc64/MCONFIG b/klibc/klibc/arch/sparc64/MCONFIG
index d490c63643..a8a742412e 100644
--- a/klibc/klibc/arch/sparc64/MCONFIG
+++ b/klibc/klibc/arch/sparc64/MCONFIG
@@ -8,7 +8,7 @@
#
ARCHREQFLAGS = -m64 -mptr64
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 64
LDFLAGS = -m elf64_sparc
diff --git a/klibc/klibc/arch/sparc64/crt0.S b/klibc/klibc/arch/sparc64/crt0.S
index 23af82ecc4..5faee7c6be 100644
--- a/klibc/klibc/arch/sparc64/crt0.S
+++ b/klibc/klibc/arch/sparc64/crt0.S
@@ -1,2 +1,2 @@
#define TARGET_PTR_SIZE 64
-#include "arch/sparc/crt0i.S"
+#include "../sparc/crt0i.S"
diff --git a/klibc/klibc/memmem.c b/klibc/klibc/memmem.c
index 0f59938ffb..8b5faa0014 100644
--- a/klibc/klibc/memmem.c
+++ b/klibc/klibc/memmem.c
@@ -13,32 +13,40 @@
void *memmem(const void *haystack, size_t n, const void *needle, size_t m)
{
- const unsigned char *y = (const unsigned char *)haystack;
- const unsigned char *x = (const unsigned char *)needle;
+ const unsigned char *y = (const unsigned char *)haystack;
+ const unsigned char *x = (const unsigned char *)needle;
- size_t j, k, l;
+ size_t j, k, l;
- if ( m > n )
- return NULL;
+ if (m > n || !m || !n)
+ return NULL;
- if ( x[0] == x[1] ) {
- k = 2;
- l = 1;
- } else {
- k = 1;
- l = 2;
- }
+ if (1 != m) {
+ if (x[0] == x[1]) {
+ k = 2;
+ l = 1;
+ } else {
+ k = 1;
+ l = 2;
+ }
- j = 0;
- while ( j <= n-m ) {
- if (x[1] != y[j+1]) {
- j += k;
- } else {
- if ( !memcmp(x+2, y+j+2, m-2) && x[0] == y[j] )
- return (void *)&y[j];
- j += l;
- }
- }
+ j = 0;
+ while (j <= n - m) {
+ if (x[1] != y[j + 1]) {
+ j += k;
+ } else {
+ if (!memcmp(x + 2, y + j + 2, m - 2)
+ && x[0] == y[j])
+ return (void *)&y[j];
+ j += l;
+ }
+ }
+ } else
+ do {
+ if (*y == *x)
+ return (void *)y;
+ y++;
+ } while (--n);
- return NULL;
+ return NULL;
}
diff --git a/klibc/klibc/strncat.c b/klibc/klibc/strncat.c
index 4d8458d5ec..78223152c4 100644
--- a/klibc/klibc/strncat.c
+++ b/klibc/klibc/strncat.c
@@ -10,7 +10,6 @@ char *strncat(char *dst, const char *src, size_t n)
char *q = strchr(dst, '\0');
const char *p = src;
char ch;
- size_t nn = q-dst;
while (n--) {
*q++ = ch = *p++;
diff --git a/klibc/version b/klibc/version
index 129efcc007..b4d2b300cd 100644
--- a/klibc/version
+++ b/klibc/version
@@ -1 +1 @@
-0.198
+0.199