Skip to content

Commit c9857ef

Browse files
author
Sergei Trofimovich
committed
src/libmain/stack.cc: fix 'ucontext' usage on glibc-2.26
Build fails as: $ make CXX src/libmain/stack.o src/libmain/stack.cc: In function 'void nix::sigsegvHandler(int, siginfo_t*, void*)': src/libmain/stack.cc:21:21: error: 'ucontext' was not declared in this scope sp = (char *) ((ucontext *) ctx)->uc_mcontext.gregs[REG_RSP]; ^~~~~~~~ src/libmain/stack.cc:21:21: note: suggested alternative: 'ucontext_t' sp = (char *) ((ucontext *) ctx)->uc_mcontext.gregs[REG_RSP]; ^~~~~~~~ ucontext_t It's caused by upstream rename: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=251287734e89a52da3db682a8241eb6bccc050c9 which basically changes typedef struct ucontext {} ucontext_t; to typedef struct ucontext_t {} ucontext_t; The change uses ucontext_t. Signed-off-by: Sergei Trofimovich <[email protected]>
1 parent bbdf08b commit c9857ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libmain/stack.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ static void sigsegvHandler(int signo, siginfo_t * info, void * ctx)
1818
bool haveSP = true;
1919
char * sp = 0;
2020
#if defined(__x86_64__) && defined(REG_RSP)
21-
sp = (char *) ((ucontext *) ctx)->uc_mcontext.gregs[REG_RSP];
21+
sp = (char *) ((ucontext_t *) ctx)->uc_mcontext.gregs[REG_RSP];
2222
#elif defined(REG_ESP)
23-
sp = (char *) ((ucontext *) ctx)->uc_mcontext.gregs[REG_ESP];
23+
sp = (char *) ((ucontext_t *) ctx)->uc_mcontext.gregs[REG_ESP];
2424
#else
2525
haveSP = false;
2626
#endif

0 commit comments

Comments
 (0)