From 41537a770b46f2376e74af58ba4885749339e81e Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Mon, 15 Sep 2014 22:13:07 +0200 Subject: buildsys: fix IS_IN_lib* define NOT_IN_libc / IS_IN_libxxx appropriately to fix pthread_once Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/Makefile.commonarch | 12 ++++++++++-- libc/sysdeps/linux/common/Makefile.in | 2 ++ libc/sysdeps/linux/x86_64/crt1.S | 4 +++- 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'libc/sysdeps/linux') diff --git a/libc/sysdeps/linux/Makefile.commonarch b/libc/sysdeps/linux/Makefile.commonarch index a001a44f1..1bf2dc511 100644 --- a/libc/sysdeps/linux/Makefile.commonarch +++ b/libc/sysdeps/linux/Makefile.commonarch @@ -20,8 +20,16 @@ libc-y += $(ARCH_OBJS-y) libc-nomulti-y += $(ARCH_SOBJ) objclean-y += CLEAN_$(subst $(top_builddir),,$(ARCH_OUT)) -CFLAGS-crti.S+=$(PICFLAG) -CFLAGS-crtn.S+=$(PICFLAG) +CFLAGS-OMIT-crt1.S := -D_LIBC_REENTRANT +CFLAGS-OMIT-crti.S := -D_LIBC_REENTRANT +CFLAGS-OMIT-crtn.S := -D_LIBC_REENTRANT +CFLAGS-OMIT-crtreloc.c := -D_LIBC_REENTRANT +CFLAGS-crti.S += $(PICFLAG) +CFLAGS-crtn.S += $(PICFLAG) +# Due to a "bug" in make these order_only prereqs inherit per-target flags. +# Attempt to workaround this inconvenient behaviour: +CFLAGS-OMIT-crt1.S += $(CFLAGS-rtld) -DIN_LIB=% +CFLAGS-OMIT-crtreloc.c += $(CFLAGS-rtld) -DIN_LIB=% CLEAN_$(subst $(top_builddir),,$(ARCH_OUT)): $(do_rm) $(addprefix $(ARCH_OUT)/*., o os oS) $(CTOR_TARGETS) $(CRTS) diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index 85621544c..a175ab64c 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/libc/sysdeps/linux/common/Makefile.in @@ -115,6 +115,8 @@ ifneq ($(strip $(ARCH_OBJS-y)),) CSRC-y := $(filter-out $(notdir $(ARCH_OBJS-y:.o=.c)) $(ARCH_OBJ_FILTEROUT-y),$(CSRC-y)) endif +CFLAGS-OMIT-ssp.c := $(CFLAG_-fstack-protector) $(CFLAG_-fstack-protector-all) $(CFLAG_-fstack-protector-strong) +CFLAGS-OMIT-ssp-local.c := $(CFLAG_-fstack-protector) $(CFLAG_-fstack-protector-all) $(CFLAG_-fstack-protector-strong) CFLAGS-ssp.c := $(SSP_DISABLE_FLAGS) CFLAGS-ssp-local.c := $(SSP_DISABLE_FLAGS) diff --git a/libc/sysdeps/linux/x86_64/crt1.S b/libc/sysdeps/linux/x86_64/crt1.S index 52b564cc8..87777dd5d 100644 --- a/libc/sysdeps/linux/x86_64/crt1.S +++ b/libc/sysdeps/linux/x86_64/crt1.S @@ -54,7 +54,9 @@ ... NULL */ - +#if defined NOT_IN_libc +# error error in build framework +#endif #include .text -- cgit v1.2.3 From 56824024e4f3fa8b5c6f696934c51fbc86946a80 Mon Sep 17 00:00:00 2001 From: Gustavo Zacarias Date: Sun, 7 Sep 2014 12:01:33 -0300 Subject: powerpc: update ptrace.h to latest from glibc Update sys/ptrace.h to latest glibc release for a lot of missing definitions. Signed-off-by: Gustavo Zacarias Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/powerpc/sys/ptrace.h | 93 ++++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 2 deletions(-) (limited to 'libc/sysdeps/linux') diff --git a/libc/sysdeps/linux/powerpc/sys/ptrace.h b/libc/sysdeps/linux/powerpc/sys/ptrace.h index 02c303c24..dd81efc28 100644 --- a/libc/sysdeps/linux/powerpc/sys/ptrace.h +++ b/libc/sysdeps/linux/powerpc/sys/ptrace.h @@ -1,5 +1,5 @@ /* `ptrace' debugger support interface. Linux version. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,6 +20,7 @@ #define _SYS_PTRACE_H 1 #include +#include __BEGIN_DECLS @@ -78,8 +79,96 @@ enum __ptrace_request #define PT_DETACH PTRACE_DETACH /* Continue and stop at the next (return from) syscall. */ - PTRACE_SYSCALL = 24 + PTRACE_SYSCALL = 24, #define PT_SYSCALL PTRACE_SYSCALL + + /* Set ptrace filter options. */ + PTRACE_SETOPTIONS = 0x4200, +#define PT_SETOPTIONS PTRACE_SETOPTIONS + + /* Get last ptrace message. */ + PTRACE_GETEVENTMSG = 0x4201, +#define PT_GETEVENTMSG PTRACE_GETEVENTMSG + + /* Get siginfo for process. */ + PTRACE_GETSIGINFO = 0x4202, +#define PT_GETSIGINFO PTRACE_GETSIGINFO + + /* Set new siginfo for process. */ + PTRACE_SETSIGINFO = 0x4203, +#define PT_SETSIGINFO PTRACE_SETSIGINFO + + /* Get register content. */ + PTRACE_GETREGSET = 0x4204, +#define PTRACE_GETREGSET PTRACE_GETREGSET + + /* Set register content. */ + PTRACE_SETREGSET = 0x4205, +#define PTRACE_SETREGSET PTRACE_SETREGSET + + /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect + signal or group stop state. */ + PTRACE_SEIZE = 0x4206, +#define PTRACE_SEIZE PTRACE_SEIZE + + /* Trap seized tracee. */ + PTRACE_INTERRUPT = 0x4207, +#define PTRACE_INTERRUPT PTRACE_INTERRUPT + + /* Wait for next group event. */ + PTRACE_LISTEN = 0x4208, +#define PTRACE_LISTEN PTRACE_LISTEN + + PTRACE_PEEKSIGINFO = 0x4209 +#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO +}; + + +/* Flag for PTRACE_LISTEN. */ +enum __ptrace_flags +{ + PTRACE_SEIZE_DEVEL = 0x80000000 +}; + +/* Options set using PTRACE_SETOPTIONS. */ +enum __ptrace_setoptions +{ + PTRACE_O_TRACESYSGOOD = 0x00000001, + PTRACE_O_TRACEFORK = 0x00000002, + PTRACE_O_TRACEVFORK = 0x00000004, + PTRACE_O_TRACECLONE = 0x00000008, + PTRACE_O_TRACEEXEC = 0x00000010, + PTRACE_O_TRACEVFORKDONE = 0x00000020, + PTRACE_O_TRACEEXIT = 0x00000040, + PTRACE_O_TRACESECCOMP = 0x00000080, + PTRACE_O_EXITKILL = 0x00100000, + PTRACE_O_MASK = 0x001000ff +}; + +/* Wait extended result codes for the above trace options. */ +enum __ptrace_eventcodes +{ + PTRACE_EVENT_FORK = 1, + PTRACE_EVENT_VFORK = 2, + PTRACE_EVENT_CLONE = 3, + PTRACE_EVENT_EXEC = 4, + PTRACE_EVENT_VFORK_DONE = 5, + PTRACE_EVENT_EXIT = 6, + PTRACE_EVENT_SECCOMP = 7 +}; + +/* Arguments for PTRACE_PEEKSIGINFO. */ +struct __ptrace_peeksiginfo_args +{ + __uint64_t off; /* From which siginfo to start. */ + __uint32_t flags; /* Flags for peeksiginfo. */ + __int32_t nr; /* How many siginfos to take. */ +}; + +enum __ptrace_peeksiginfo_flags +{ + /* Read signals from a shared (process wide) queue. */ + PTRACE_PEEKSIGINFO_SHARED = (1 << 0) }; /* Perform process tracing functions. REQUEST is one of the values -- cgit v1.2.3 From 085465e5c507822b25daec6c0fc1a78da48bff9e Mon Sep 17 00:00:00 2001 From: Gustavo Zacarias Date: Sun, 7 Sep 2014 12:01:34 -0300 Subject: sparc: update ptrace.h to latest from glibc Update sys/ptrace.h to latest glibc release for a lot of missing definitions. Signed-off-by: Gustavo Zacarias Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/sparc/sys/ptrace.h | 97 +++++++++++++++++++++++++++++++++-- 1 file changed, 92 insertions(+), 5 deletions(-) (limited to 'libc/sysdeps/linux') diff --git a/libc/sysdeps/linux/sparc/sys/ptrace.h b/libc/sysdeps/linux/sparc/sys/ptrace.h index 26fa4b38d..0f6c2ccae 100644 --- a/libc/sysdeps/linux/sparc/sys/ptrace.h +++ b/libc/sysdeps/linux/sparc/sys/ptrace.h @@ -1,5 +1,5 @@ /* `ptrace' debugger support interface. Linux/SPARC version. - Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1996-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,7 +20,7 @@ #define _SYS_PTRACE_H 1 #include - +#include #include /* Linux/SPARC kernels up to 2.3.18 do not care much @@ -147,12 +147,11 @@ enum __ptrace_request #endif /* Continue and stop at the next (return from) syscall. */ - PTRACE_SYSCALL = 24 + PTRACE_SYSCALL = 24, #define PTRACE_SYSCALL PTRACE_SYSCALL #if __WORDSIZE == 64 - , /* Get all floating point registers used by a processes. This is not supported on all machines. */ PTRACE_GETFPREGS = 25, @@ -160,10 +159,98 @@ enum __ptrace_request /* Set all floating point registers used by a processes. This is not supported on all machines. */ - PTRACE_SETFPREGS = 26 + PTRACE_SETFPREGS = 26, #define PT_SETFPREGS PTRACE_SETFPREGS #endif + + /* Set ptrace filter options. */ + PTRACE_SETOPTIONS = 0x4200, +#define PT_SETOPTIONS PTRACE_SETOPTIONS + + /* Get last ptrace message. */ + PTRACE_GETEVENTMSG = 0x4201, +#define PT_GETEVENTMSG PTRACE_GETEVENTMSG + + /* Get siginfo for process. */ + PTRACE_GETSIGINFO = 0x4202, +#define PT_GETSIGINFO PTRACE_GETSIGINFO + + /* Set new siginfo for process. */ + PTRACE_SETSIGINFO = 0x4203, +#define PT_SETSIGINFO PTRACE_SETSIGINFO + + /* Get register content. */ + PTRACE_GETREGSET = 0x4204, +#define PTRACE_GETREGSET PTRACE_GETREGSET + + /* Set register content. */ + PTRACE_SETREGSET = 0x4205, +#define PTRACE_SETREGSET PTRACE_SETREGSET + + /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect + signal or group stop state. */ + PTRACE_SEIZE = 0x4206, +#define PTRACE_SEIZE PTRACE_SEIZE + + /* Trap seized tracee. */ + PTRACE_INTERRUPT = 0x4207, +#define PTRACE_INTERRUPT PTRACE_INTERRUPT + + /* Wait for next group event. */ + PTRACE_LISTEN = 0x4208, +#define PTRACE_LISTEN PTRACE_LISTEN + + PTRACE_PEEKSIGINFO = 0x4209 +#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO +}; + + +/* Flag for PTRACE_LISTEN. */ +enum __ptrace_flags +{ + PTRACE_SEIZE_DEVEL = 0x80000000 +}; + +/* Options set using PTRACE_SETOPTIONS. */ +enum __ptrace_setoptions +{ + PTRACE_O_TRACESYSGOOD = 0x00000001, + PTRACE_O_TRACEFORK = 0x00000002, + PTRACE_O_TRACEVFORK = 0x00000004, + PTRACE_O_TRACECLONE = 0x00000008, + PTRACE_O_TRACEEXEC = 0x00000010, + PTRACE_O_TRACEVFORKDONE = 0x00000020, + PTRACE_O_TRACEEXIT = 0x00000040, + PTRACE_O_TRACESECCOMP = 0x00000080, + PTRACE_O_EXITKILL = 0x00100000, + PTRACE_O_MASK = 0x001000ff +}; + +/* Wait extended result codes for the above trace options. */ +enum __ptrace_eventcodes +{ + PTRACE_EVENT_FORK = 1, + PTRACE_EVENT_VFORK = 2, + PTRACE_EVENT_CLONE = 3, + PTRACE_EVENT_EXEC = 4, + PTRACE_EVENT_VFORK_DONE = 5, + PTRACE_EVENT_EXIT = 6, + PTRACE_EVENT_SECCOMP = 7 +}; + +/* Arguments for PTRACE_PEEKSIGINFO. */ +struct __ptrace_peeksiginfo_args +{ + __uint64_t off; /* From which siginfo to start. */ + __uint32_t flags; /* Flags for peeksiginfo. */ + __int32_t nr; /* How many siginfos to take. */ +}; + +enum __ptrace_peeksiginfo_flags +{ + /* Read signals from a shared (process wide) queue. */ + PTRACE_PEEKSIGINFO_SHARED = (1 << 0) }; /* Perform process tracing functions. REQUEST is one of the values -- cgit v1.2.3 From a9bdc5d28e692c04f51bcea1bb8e87f9c72ad09f Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 17 Sep 2014 20:45:26 +0200 Subject: m68k: libc: add fmovem* mcffpu condition add fmovem{x,.d,.*} ISA conditional Fixes assembler errors for 5206. isa_a, isa_b (or a+, don't remember) do not have emx, use em.d there. Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/m68k/__longjmp.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libc/sysdeps/linux') diff --git a/libc/sysdeps/linux/m68k/__longjmp.S b/libc/sysdeps/linux/m68k/__longjmp.S index 5033f02b4..a93d92bff 100644 --- a/libc/sysdeps/linux/m68k/__longjmp.S +++ b/libc/sysdeps/linux/m68k/__longjmp.S @@ -15,7 +15,9 @@ __longjmp: movel #1, %d0 1: moveml %a0@(JB_REGS), %d2-%d7/%a2-%a7 -#if defined __HAVE_68881__ || defined __UCLIBC_HAS_FPU__ +#if defined __mcffpu__ && defined __UCLIBC_HAS_FPU__ + fmovem %a0@(JB_FPREGS), %fp2-%fp7 +#elif defined __HAVE_68881__ || defined __UCLIBC_HAS_FPU__ fmovemx %a0@(JB_FPREGS), %fp2-%fp7 #endif movel %a0@(JB_PC), %sp@ -- cgit v1.2.3