Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix aarch64 build proposal #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@ $<
Expand Down Expand Up @@ -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} [email protected] -o $@ -L. -lucontext -lucontext_posix
$(CC) -std=gnu99 -D_DEFAULT_SOURCE ${CFLAGS} ${CPPFLAGS} [email protected] -o $@ -L. -lucontext -lucontext_posix
endif

ifeq ($(EXPORT_UNPREFIXED),yes)
Expand All @@ -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}
Expand All @@ -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} [email protected] -o $@ -L. -lucontext
$(CC) -std=gnu99 -D_DEFAULT_SOURCE ${CFLAGS} ${CPPFLAGS} [email protected] -o $@ -L. -lucontext

examples: ${LIBUCONTEXT_EXAMPLES}
examples/cooperative_threading: examples/cooperative_threading.c ${LIBUCONTEXT_NAME}
$(CC) -std=gnu99 -D_BSD_SOURCE ${CFLAGS} ${CPPFLAGS} [email protected] -o $@ -L. -lucontext
$(CC) -std=gnu99 -D_DEFAULT_SOURCE ${CFLAGS} ${CPPFLAGS} [email protected] -o $@ -L. -lucontext

ifeq ($(FREESTANDING),no)

Expand Down
8 changes: 4 additions & 4 deletions arch/aarch64/include/libucontext/bits.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions arch/aarch64/makecontext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down