#
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
--- /dev/null
+/*
+ * 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 */
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
# Build configuration for this architecture
#
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 64
# Extra linkflags when building the shared version of the library
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)
# accordingly.
#
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 64
//
.align 32
.global setjmp
+ .proc setjmp
setjmp:
//
// Make sure buffer is aligned at 16byte boundary
.align 32
.global longjmp
+ .proc longjmp
longjmp:
//
// Make sure buffer is aligned at 16byte boundary
/* pid_t vfork(void) */
/* Implemented as clone(CLONE_VFORK | CLONE_VM | SIGCHLD, 0) */
+ .align 32
.proc vfork
.global vfork
vfork:
;;
(p7) mov r8=-1
br.ret.sptk.many b0
- .endp
+ .endp vfork
# accordingly.
#
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 32
# Extra linkflags when building the shared version of the library
#
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
# accordingly.
#
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 64
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
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";
# accordingly.
#
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 32
# Extra linkflags when building the shared version of the library
#
ARCHREQFLAGS = -m64 -mcall-aixdesc
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 64
LDFLAGS = -m elf64ppc
# accordingly.
#
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 32
SHAREDFLAGS = -Ttext 0x40000200
# accordingly.
#
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 64
SHAREDFLAGS = -Ttext 0x40000200
# accordingly.
#
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 32
# Extra linkflags when building the shared version of the library
#
ARCHREQFLAGS = -m64 -mptr64
-OPTFLAGS = -Os -fomit-frame-pointer
+OPTFLAGS = -Os
BITSIZE = 64
LDFLAGS = -m elf64_sparc
#define TARGET_PTR_SIZE 64
-#include "arch/sparc/crt0i.S"
+#include "../sparc/crt0i.S"
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;
}
char *q = strchr(dst, '\0');
const char *p = src;
char ch;
- size_t nn = q-dst;
while (n--) {
*q++ = ch = *p++;