From: kay.sievers@vrfy.org Date: Thu, 24 Feb 2005 18:54:47 +0000 (+0100) Subject: [PATCH] klibc v0.199 X-Git-Tag: 054~6 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=833aa0fab572536ebb680cc54bf95c50c3b36a0f [PATCH] klibc v0.199 --- diff --git a/klibc/MCONFIG b/klibc/MCONFIG index 7da150d03..3fae2898c 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 000000000..e7444983e --- /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 02131c7f2..de0a14cf6 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 5987ed584..d7ab6c0b8 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 6fbea3290..fe26b996a 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 631a478e4..36b30ffb8 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 50f91dc1d..7859ba414 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 efcd03f7f..f79bdc823 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 6706d9ddc..2673090fc 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 a24897381..0a9891898 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 6a817e54b..66405e437 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 51b2b1a58..aebe03a5e 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 eb6b5dd92..63b5e17fc 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 ff7c44db9..82c710701 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 09881b8d4..9aba2ddbb 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 e32c33faa..640b395b5 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 1c8232bed..081a0bbb5 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 cb94f46c0..55f8b198c 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 d490c6364..a8a742412 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 23af82ecc..5faee7c6b 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 0f59938ff..8b5faa001 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 4d8458d5e..78223152c 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 129efcc00..b4d2b300c 100644 --- a/klibc/version +++ b/klibc/version @@ -1 +1 @@ -0.198 +0.199