summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorAustin Foxley <austinf@cetoncorp.com>2009-09-22 15:13:17 -0700
committerAustin Foxley <austinf@cetoncorp.com>2009-09-22 15:13:17 -0700
commitb10ae3e1a7c105609771b0de911ff9e72a4cc0d1 (patch)
tree714bff4be539f60d1467d4b2a4373fa9e7d940f8 /libc
parent51468f1123252fbc9f1cbb244160cf7d95d01334 (diff)
downloaduClibc-alpine-b10ae3e1a7c105609771b0de911ff9e72a4cc0d1.tar.bz2
uClibc-alpine-b10ae3e1a7c105609771b0de911ff9e72a4cc0d1.tar.xz
spent this morning beating i386 nptl into shape
Got it compiling thus far, still working on getting it to run Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libc')
-rw-r--r--libc/misc/elf/dl-support.c1
-rw-r--r--libc/stdlib/Makefile.in2
-rw-r--r--libc/sysdeps/linux/common/Makefile.in4
-rw-r--r--libc/sysdeps/linux/i386/Makefile.arch13
-rw-r--r--libc/sysdeps/linux/i386/bits/syscalls.h2
-rw-r--r--libc/sysdeps/linux/i386/bits/uClibc_arch_features.h2
-rw-r--r--libc/sysdeps/linux/i386/clone.S8
-rw-r--r--libc/sysdeps/linux/i386/vfork.S10
8 files changed, 37 insertions, 5 deletions
diff --git a/libc/misc/elf/dl-support.c b/libc/misc/elf/dl-support.c
index 833d5355e..002262a3a 100644
--- a/libc/misc/elf/dl-support.c
+++ b/libc/misc/elf/dl-support.c
@@ -44,6 +44,7 @@ void internal_function _dl_aux_init (ElfW(auxv_t) *av)
libpthread implementations should provide their own hook
to handle all threads. */
void
+internal_function
_dl_nothread_init_static_tls (struct link_map *map)
{
# if TLS_TCB_AT_TP
diff --git a/libc/stdlib/Makefile.in b/libc/stdlib/Makefile.in
index a7ecdbfad..1b549c543 100644
--- a/libc/stdlib/Makefile.in
+++ b/libc/stdlib/Makefile.in
@@ -32,10 +32,10 @@ CSRC += mkstemp64.c
endif
ifeq ($(UCLIBC_HAS_FLOATS),y)
CSRC += drand48.c drand48_r.c erand48.c erand48_r.c
+endif
ifeq ($(UCLIBC_SUSV3_LEGACY),y)
CSRC += gcvt.c mktemp.c
endif
-endif
# multi source stdlib.c
CSRC += abs.c labs.c atoi.c atol.c strtol.c strtoul.c _stdlib_strto_l.c \
diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
index ad38ffb84..e2095a83c 100644
--- a/libc/sysdeps/linux/common/Makefile.in
+++ b/libc/sysdeps/linux/common/Makefile.in
@@ -88,6 +88,10 @@ ifeq ($(TARGET_ARCH),sparc)
CSRC := $(filter-out vfork.c,$(CSRC))
endif
+ifeq ($(TARGET_ARCH),i386)
+CSRC := $(filter-out vfork.c,$(CSRC))
+endif
+
# fails for some reason
ifneq ($(strip $(ARCH_OBJS)),)
CSRC := $(filter-out $(notdir $(ARCH_OBJS:.o=.c)),$(CSRC))
diff --git a/libc/sysdeps/linux/i386/Makefile.arch b/libc/sysdeps/linux/i386/Makefile.arch
index 2bf2b7607..668cca742 100644
--- a/libc/sysdeps/linux/i386/Makefile.arch
+++ b/libc/sysdeps/linux/i386/Makefile.arch
@@ -5,8 +5,17 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC := brk.c sigaction.c __syscall_error.c
+CSRC := brk.c __syscall_error.c
+
+ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+CSRC += sigaction.c
+endif
SSRC := \
- __longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
+ __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
sync_file_range.S syscall.S mmap.S mmap64.S posix_fadvise64.S
+
+
+ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+SSRC += vfork.S clone.S
+endif
diff --git a/libc/sysdeps/linux/i386/bits/syscalls.h b/libc/sysdeps/linux/i386/bits/syscalls.h
index 8a98a0e08..cd73b023c 100644
--- a/libc/sysdeps/linux/i386/bits/syscalls.h
+++ b/libc/sysdeps/linux/i386/bits/syscalls.h
@@ -105,7 +105,7 @@ __asm__ (".L__X'%ebx = 1\n\t"
"int $0x80\n\t" \
RESTOREARGS_##nr \
: "=a" (resultvar) \
- : "i" (name) ASMFMT_##nr(args) : "memory", "cc"); \
+ : "g" (name) ASMFMT_##nr(args) : "memory", "cc"); \
(int) resultvar; })
#define LOADARGS_0
diff --git a/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h b/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
index deeec03d5..536e9c155 100644
--- a/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
@@ -37,7 +37,7 @@
#undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
/* define if target supports CFI pseudo ops */
-#undef __UCLIBC_HAVE_ASM_CFI_DIRECTIVES__
+#define __UCLIBC_HAVE_ASM_CFI_DIRECTIVES__
/* define if target supports IEEE signed zero floats */
#define __UCLIBC_HAVE_SIGNED_ZERO__
diff --git a/libc/sysdeps/linux/i386/clone.S b/libc/sysdeps/linux/i386/clone.S
index 14fc25ca1..a7de3fe27 100644
--- a/libc/sysdeps/linux/i386/clone.S
+++ b/libc/sysdeps/linux/i386/clone.S
@@ -79,7 +79,10 @@ clone:
movl %eax,8(%ecx)
/* Don't leak any information. */
movl $0,4(%ecx)
+#ifndef RESET_PID
movl $0,(%ecx)
+#endif
+
/* Do the system call */
pushl %ebx
@@ -90,6 +93,10 @@ clone:
movl FLAGS+12(%esp),%ebx
movl CTID+12(%esp),%edi
movl $__NR_clone,%eax
+#ifdef RESET_PID
+ /* Remember the flag value. */
+ movl %ebx, (%ecx)
+#endif
int $0x80
popl %edi
popl %esi
@@ -121,3 +128,4 @@ __error:
jmp __syscall_error
.size clone,.-clone
+weak_alias(clone, __clone)
diff --git a/libc/sysdeps/linux/i386/vfork.S b/libc/sysdeps/linux/i386/vfork.S
index 8005ff1d2..c9db2f48c 100644
--- a/libc/sysdeps/linux/i386/vfork.S
+++ b/libc/sysdeps/linux/i386/vfork.S
@@ -18,9 +18,19 @@
__vfork:
popl %ecx
+
+#ifdef SAVE_PID
+ SAVE_PID
+#endif
+
movl $__NR_vfork,%eax
int $0x80
pushl %ecx
+
+#ifdef RESTORE_PID
+ RESTORE_PID
+#endif
+
cmpl $-4095,%eax
jae __syscall_error
ret