diff options
author | Austin Foxley <austinf@cetoncorp.com> | 2010-02-19 02:05:52 -0800 |
---|---|---|
committer | Austin Foxley <austinf@cetoncorp.com> | 2010-02-19 02:05:52 -0800 |
commit | 8826c1e4573c68200092074ede1afdddd4b3e115 (patch) | |
tree | ebf52e4e5d44c055ba435d7b06af66bd85f322b2 | |
parent | 536a9d8a04dc75246d7ad70c9372064c41a43467 (diff) |
fixes to get nptl compiling for x86_64
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
10 files changed, 10 insertions, 49 deletions
diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index 45c70baf6..e86dc0c0d 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/libc/sysdeps/linux/common/Makefile.in @@ -39,7 +39,7 @@ CSRC := $(filter-out fork.c getpid.c raise.c open.c close.c read.c write.c, $(CS ifeq ($(TARGET_ARCH),arm) CSRC := $(filter-out vfork.c, $(CSRC)) else ifeq ($(TARGET_ARCH),x86_64) -#do nothing +CSRC := $(filter-out vfork.c, $(CSRC)) else CSRC := $(filter-out waitpid.c, $(CSRC)) endif diff --git a/libc/sysdeps/linux/x86_64/sysdep.h b/libc/sysdeps/linux/x86_64/sysdep.h index 2bd644f62..09bb9268b 100644 --- a/libc/sysdeps/linux/x86_64/sysdep.h +++ b/libc/sysdeps/linux/x86_64/sysdep.h @@ -116,9 +116,6 @@ lose: \ #endif #endif /* __ASSEMBLER__ */ -#ifdef IS_IN_rtld -# include <dl-sysdep.h> /* Defines RTLD_PRIVATE_ERRNO. */ -#endif /* For Linux we can use the system call table in the header file /usr/include/asm/unistd.h @@ -320,10 +317,10 @@ lose: \ # define PTR_DEMANGLE(reg) rorq $17, reg; \ xorq __pointer_chk_guard_local(%rip), reg # else -# define PTR_MANGLE(reg) asm ("xorq __pointer_chk_guard_local(%%rip), %0\n" \ +# define PTR_MANGLE(reg) __asm__ ("xorq __pointer_chk_guard_local(%%rip), %0\n" \ "rolq $17, %0" \ : "=r" (reg) : "0" (reg)) -# define PTR_DEMANGLE(reg) asm ("rorq $17, %0\n" \ +# define PTR_DEMANGLE(reg) __asm__ ("rorq $17, %0\n" \ "xorq __pointer_chk_guard_local(%%rip), %0" \ : "=r" (reg) : "0" (reg)) # endif @@ -334,13 +331,13 @@ lose: \ # define PTR_DEMANGLE(reg) rorq $17, reg; \ xorq %fs:POINTER_GUARD, reg # else -# define PTR_MANGLE(var) asm ("xorq %%fs:%c2, %0\n" \ +# define PTR_MANGLE(var) __asm__ ("xorq %%fs:%c2, %0\n" \ "rolq $17, %0" \ : "=r" (var) \ : "0" (var), \ "i" (offsetof (tcbhead_t, \ pointer_guard))) -# define PTR_DEMANGLE(var) asm ("rorq $17, %0\n" \ +# define PTR_DEMANGLE(var) __asm__ ("rorq $17, %0\n" \ "xorq %%fs:%c2, %0" \ : "=r" (var) \ : "0" (var), \ diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile.arch index f059e2db2..01a643720 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile.arch +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile.arch @@ -42,6 +42,10 @@ ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y) #Needed to use the correct SYSCALL_ERROR_HANDLER ASFLAGS-clone.S += -DUSE___THREAD ASFLAGS-vfork.S += -DUSE___THREAD +ASFLAGS-sem_wait.S += -DUSE___THREAD +ASFLAGS-sem_trywait.S += -DUSE___THREAD +ASFLAGS-sem_timedwait.S += -DUSE___THREAD +ASFLAGS-sem_post.S += -DUSE___THREAD endif CFLAGS += $(SSP_ALL_CFLAGS) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S index b0d04c75b..8fbdd7e31 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S @@ -21,6 +21,7 @@ #include <pthread-errnos.h> #include <bits/kernel-features.h> #include <lowlevellock.h> +#include <tcb-offsets.h> .text diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/not-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/not-cancel.h deleted file mode 100644 index acf1a617e..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/not-cancel.h +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/not-cancel.h" diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S index 427a723cb..b9ec1fbb1 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S @@ -40,14 +40,6 @@ __pthread_cond_timedwait: .LSTARTCODE: cfi_startproc -#ifdef SHARED - cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect, - DW.ref.__gcc_personality_v0) - cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART) -#else - cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0) - cfi_lsda(DW_EH_PE_udata4, .LexceptSTART) -#endif pushq %r12 cfi_adjust_cfa_offset(8) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S index 7c488f261..a44e7a756 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S @@ -35,14 +35,6 @@ __pthread_cond_wait: .LSTARTCODE: cfi_startproc -#ifdef SHARED - cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect, - DW.ref.__gcc_personality_v0) - cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART) -#else - cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0) - cfi_lsda(DW_EH_PE_udata4, .LexceptSTART) -#endif #define FRAME_SIZE 32 leaq -FRAME_SIZE(%rsp), %rsp diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S index 0ac952b66..a808b9d7e 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S @@ -34,14 +34,6 @@ __pthread_once: .LSTARTCODE: cfi_startproc -#ifdef SHARED - cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect, - DW.ref.__gcc_personality_v0) - cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART) -#else - cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0) - cfi_lsda(DW_EH_PE_udata4, .LexceptSTART) -#endif testl $2, (%rdi) jz 1f xorl %eax, %eax diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S index f9af8ecc1..685eff950 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S @@ -35,14 +35,6 @@ sem_timedwait: .LSTARTCODE: cfi_startproc -#ifdef SHARED - cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect, - DW.ref.__gcc_personality_v0) - cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART) -#else - cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0) - cfi_lsda(DW_EH_PE_udata4, .LexceptSTART) -#endif #if VALUE == 0 movl (%rdi), %eax #else diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S index 73d1d1633..f6b39bd74 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S @@ -31,14 +31,6 @@ sem_wait: .LSTARTCODE: cfi_startproc -#ifdef SHARED - cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect, - DW.ref.__gcc_personality_v0) - cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART) -#else - cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0) - cfi_lsda(DW_EH_PE_udata4, .LexceptSTART) -#endif #if VALUE == 0 movl (%rdi), %eax |