Skip to content

Commit 769cabf

Browse files
committed
fix aarch64 build proposal
1 parent be80075 commit 769cabf

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ MANPAGES = ${MANPAGES_3}
144144
docs: ${MANPAGES}
145145

146146
.c.o:
147-
$(CC) -std=gnu99 -D_BSD_SOURCE -fPIC -DPIC ${CFLAGS} ${CPPFLAGS} -c -o $@ $<
147+
$(CC) -std=gnu99 -D_DEFAULT_SOURCE -fPIC -DPIC ${CFLAGS} ${CPPFLAGS} -c -o $@ $<
148148

149149
.S.o:
150150
$(CC) -fPIC -DPIC ${CFLAGS} ${CPPFLAGS} ${ASFLAGS} -c -o $@ $<
@@ -233,7 +233,7 @@ check_libucontext_posix: test_libucontext_posix ${LIBUCONTEXT_POSIX_SONAME} ${LI
233233
env LD_LIBRARY_PATH=$(shell pwd) ./test_libucontext_posix
234234

235235
test_libucontext_posix: test_libucontext_posix.c ${LIBUCONTEXT_POSIX_NAME}
236-
$(CC) -std=gnu99 -D_BSD_SOURCE ${CFLAGS} ${CPPFLAGS} $@.c -o $@ -L. -lucontext -lucontext_posix
236+
$(CC) -std=gnu99 -D_DEFAULT_SOURCE ${CFLAGS} ${CPPFLAGS} $@.c -o $@ -L. -lucontext -lucontext_posix
237237
endif
238238

239239
ifeq ($(EXPORT_UNPREFIXED),yes)
@@ -243,7 +243,7 @@ check_libucontext_bare_posixabi: test_libucontext_bare_posixabi ${LIBUCONTEXT_SO
243243
env LD_LIBRARY_PATH=$(shell pwd) ./test_libucontext_bare_posixabi
244244

245245
test_libucontext_bare_posixabi: test_libucontext_posix.c ${LIBUCONTEXT_NAME}
246-
$(CC) -std=gnu99 -D_BSD_SOURCE ${CFLAGS} ${CPPFLAGS} test_libucontext_posix.c -o $@ -L. -lucontext
246+
$(CC) -std=gnu99 -D_DEFAULT_SOURCE ${CFLAGS} ${CPPFLAGS} test_libucontext_posix.c -o $@ -L. -lucontext
247247
endif
248248

249249
check_libucontext: test_libucontext ${LIBUCONTEXT_SONAME}
@@ -252,11 +252,11 @@ check_libucontext: test_libucontext ${LIBUCONTEXT_SONAME}
252252
check: check_libucontext
253253

254254
test_libucontext: test_libucontext.c ${LIBUCONTEXT_NAME}
255-
$(CC) -std=gnu99 -D_BSD_SOURCE ${CFLAGS} ${CPPFLAGS} $@.c -o $@ -L. -lucontext
255+
$(CC) -std=gnu99 -D_DEFAULT_SOURCE ${CFLAGS} ${CPPFLAGS} $@.c -o $@ -L. -lucontext
256256

257257
examples: ${LIBUCONTEXT_EXAMPLES}
258258
examples/cooperative_threading: examples/cooperative_threading.c ${LIBUCONTEXT_NAME}
259-
$(CC) -std=gnu99 -D_BSD_SOURCE ${CFLAGS} ${CPPFLAGS} $@.c -o $@ -L. -lucontext
259+
$(CC) -std=gnu99 -D_DEFAULT_SOURCE ${CFLAGS} ${CPPFLAGS} $@.c -o $@ -L. -lucontext
260260

261261
ifeq ($(FREESTANDING),no)
262262

arch/aarch64/include/libucontext/bits.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ typedef struct {
1111
} libucontext_fpregset_t;
1212

1313
typedef struct sigcontext {
14-
unsigned long fault_address;
15-
unsigned long regs[31];
16-
unsigned long sp, pc, pstate;
17-
long double __reserved[256];
14+
unsigned long long fault_address;
15+
unsigned long long regs[31];
16+
unsigned long long sp, pc, pstate;
17+
unsigned char __reserved[4096] __attribute__((aligned(16)));
1818
} libucontext_mcontext_t;
1919

2020
typedef struct {

arch/aarch64/makecontext.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void
3030
libucontext_makecontext(libucontext_ucontext_t *ucp, void (*func)(void), int argc, ...)
3131
{
3232
unsigned long *sp;
33-
unsigned long *regp;
33+
unsigned long long *regp;
3434
va_list va;
3535
int i;
3636

@@ -48,7 +48,7 @@ libucontext_makecontext(libucontext_ucontext_t *ucp, void (*func)(void), int arg
4848
regp = &(ucp->uc_mcontext.regs[0]);
4949

5050
for (i = 0; (i < argc && i < 8); i++)
51-
*regp++ = va_arg (va, unsigned long);
51+
*regp++ = va_arg (va, unsigned long long);
5252

5353
for (; i < argc; i++)
5454
*sp++ = va_arg (va, unsigned long);

0 commit comments

Comments
 (0)