diff --git a/Makefile b/Makefile index 74ea13c..a4c1e81 100644 --- a/Makefile +++ b/Makefile @@ -144,7 +144,7 @@ MANPAGES = ${MANPAGES_3} docs: ${MANPAGES} .c.o: - $(CC) -std=gnu99 -D_BSD_SOURCE -fPIC -DPIC ${CFLAGS} ${CPPFLAGS} -c -o $@ $< + $(CC) -std=gnu99 -D_DEFAULT_SOURCE -fPIC -DPIC ${CFLAGS} ${CPPFLAGS} -c -o $@ $< .S.o: $(CC) -fPIC -DPIC ${CFLAGS} ${CPPFLAGS} ${ASFLAGS} -c -o $@ $< @@ -233,7 +233,7 @@ check_libucontext_posix: test_libucontext_posix ${LIBUCONTEXT_POSIX_SONAME} ${LI env LD_LIBRARY_PATH=$(shell pwd) ./test_libucontext_posix test_libucontext_posix: test_libucontext_posix.c ${LIBUCONTEXT_POSIX_NAME} - $(CC) -std=gnu99 -D_BSD_SOURCE ${CFLAGS} ${CPPFLAGS} $@.c -o $@ -L. -lucontext -lucontext_posix + $(CC) -std=gnu99 -D_DEFAULT_SOURCE ${CFLAGS} ${CPPFLAGS} $@.c -o $@ -L. -lucontext -lucontext_posix endif ifeq ($(EXPORT_UNPREFIXED),yes) @@ -243,7 +243,7 @@ check_libucontext_bare_posixabi: test_libucontext_bare_posixabi ${LIBUCONTEXT_SO env LD_LIBRARY_PATH=$(shell pwd) ./test_libucontext_bare_posixabi test_libucontext_bare_posixabi: test_libucontext_posix.c ${LIBUCONTEXT_NAME} - $(CC) -std=gnu99 -D_BSD_SOURCE ${CFLAGS} ${CPPFLAGS} test_libucontext_posix.c -o $@ -L. -lucontext + $(CC) -std=gnu99 -D_DEFAULT_SOURCE ${CFLAGS} ${CPPFLAGS} test_libucontext_posix.c -o $@ -L. -lucontext endif check_libucontext: test_libucontext ${LIBUCONTEXT_SONAME} @@ -252,11 +252,11 @@ check_libucontext: test_libucontext ${LIBUCONTEXT_SONAME} check: check_libucontext test_libucontext: test_libucontext.c ${LIBUCONTEXT_NAME} - $(CC) -std=gnu99 -D_BSD_SOURCE ${CFLAGS} ${CPPFLAGS} $@.c -o $@ -L. -lucontext + $(CC) -std=gnu99 -D_DEFAULT_SOURCE ${CFLAGS} ${CPPFLAGS} $@.c -o $@ -L. -lucontext examples: ${LIBUCONTEXT_EXAMPLES} examples/cooperative_threading: examples/cooperative_threading.c ${LIBUCONTEXT_NAME} - $(CC) -std=gnu99 -D_BSD_SOURCE ${CFLAGS} ${CPPFLAGS} $@.c -o $@ -L. -lucontext + $(CC) -std=gnu99 -D_DEFAULT_SOURCE ${CFLAGS} ${CPPFLAGS} $@.c -o $@ -L. -lucontext ifeq ($(FREESTANDING),no) diff --git a/arch/aarch64/include/libucontext/bits.h b/arch/aarch64/include/libucontext/bits.h index e249448..5bcedc8 100644 --- a/arch/aarch64/include/libucontext/bits.h +++ b/arch/aarch64/include/libucontext/bits.h @@ -11,10 +11,10 @@ typedef struct { } libucontext_fpregset_t; typedef struct sigcontext { - unsigned long fault_address; - unsigned long regs[31]; - unsigned long sp, pc, pstate; - long double __reserved[256]; + unsigned long long fault_address; + unsigned long long regs[31]; + unsigned long long sp, pc, pstate; + unsigned char __reserved[4096] __attribute__((aligned(16))); } libucontext_mcontext_t; typedef struct { diff --git a/arch/aarch64/makecontext.c b/arch/aarch64/makecontext.c index f6823cf..8f384cb 100644 --- a/arch/aarch64/makecontext.c +++ b/arch/aarch64/makecontext.c @@ -30,7 +30,7 @@ void libucontext_makecontext(libucontext_ucontext_t *ucp, void (*func)(void), int argc, ...) { unsigned long *sp; - unsigned long *regp; + unsigned long long *regp; va_list va; int i; @@ -48,7 +48,7 @@ libucontext_makecontext(libucontext_ucontext_t *ucp, void (*func)(void), int arg regp = &(ucp->uc_mcontext.regs[0]); for (i = 0; (i < argc && i < 8); i++) - *regp++ = va_arg (va, unsigned long); + *regp++ = va_arg (va, unsigned long long); for (; i < argc; i++) *sp++ = va_arg (va, unsigned long);