Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix build with glibc 2.26. Tracking issue: #31696
- Loading branch information
Showing
3 changed files
with
128 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 121 additions & 0 deletions
121
pkgs/tools/security/afl/qemu-patches/qemu-2.3.0-glibc-2.26.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
diff --git a/user-exec.c b/user-exec.c | ||
index 8f57e8a..957f9f7 100644 | ||
--- a/user-exec.c | ||
+++ b/user-exec.c | ||
@@ -57,7 +57,7 @@ static void exception_action(CPUState *cpu) | ||
void cpu_resume_from_signal(CPUState *cpu, void *puc) | ||
{ | ||
#ifdef __linux__ | ||
- struct ucontext *uc = puc; | ||
+ ucontext_t *uc = puc; | ||
#elif defined(__OpenBSD__) | ||
struct sigcontext *uc = puc; | ||
#endif | ||
@@ -171,7 +171,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
#elif defined(__OpenBSD__) | ||
struct sigcontext *uc = puc; | ||
#else | ||
- struct ucontext *uc = puc; | ||
+ ucontext_t *uc = puc; | ||
#endif | ||
unsigned long pc; | ||
int trapno; | ||
@@ -226,7 +226,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
#elif defined(__OpenBSD__) | ||
struct sigcontext *uc = puc; | ||
#else | ||
- struct ucontext *uc = puc; | ||
+ ucontext_t *uc = puc; | ||
#endif | ||
|
||
pc = PC_sig(uc); | ||
@@ -288,7 +288,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
|
||
#ifdef __APPLE__ | ||
#include <sys/ucontext.h> | ||
-typedef struct ucontext SIGCONTEXT; | ||
+typedef ucontext_t SIGCONTEXT; | ||
/* All Registers access - only for local access */ | ||
#define REG_sig(reg_name, context) \ | ||
((context)->uc_mcontext->ss.reg_name) | ||
@@ -331,7 +331,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) | ||
ucontext_t *uc = puc; | ||
#else | ||
- struct ucontext *uc = puc; | ||
+ ucontext_t *uc = puc; | ||
#endif | ||
unsigned long pc; | ||
int is_write; | ||
@@ -358,7 +358,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
void *puc) | ||
{ | ||
siginfo_t *info = pinfo; | ||
- struct ucontext *uc = puc; | ||
+ ucontext_t *uc = puc; | ||
uint32_t *pc = uc->uc_mcontext.sc_pc; | ||
uint32_t insn = *pc; | ||
int is_write = 0; | ||
@@ -456,7 +456,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
#if defined(__NetBSD__) | ||
ucontext_t *uc = puc; | ||
#else | ||
- struct ucontext *uc = puc; | ||
+ ucontext_t *uc = puc; | ||
#endif | ||
unsigned long pc; | ||
int is_write; | ||
@@ -483,7 +483,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
int cpu_signal_handler(int host_signum, void *pinfo, void *puc) | ||
{ | ||
siginfo_t *info = pinfo; | ||
- struct ucontext *uc = puc; | ||
+ ucontext_t *uc = puc; | ||
uintptr_t pc = uc->uc_mcontext.pc; | ||
uint32_t insn = *(uint32_t *)pc; | ||
bool is_write; | ||
@@ -512,7 +512,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
void *puc) | ||
{ | ||
siginfo_t *info = pinfo; | ||
- struct ucontext *uc = puc; | ||
+ ucontext_t *uc = puc; | ||
unsigned long pc; | ||
int is_write; | ||
|
||
@@ -534,7 +534,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
int cpu_signal_handler(int host_signum, void *pinfo, void *puc) | ||
{ | ||
siginfo_t *info = pinfo; | ||
- struct ucontext *uc = puc; | ||
+ ucontext_t *uc = puc; | ||
unsigned long ip; | ||
int is_write = 0; | ||
|
||
@@ -565,7 +565,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
void *puc) | ||
{ | ||
siginfo_t *info = pinfo; | ||
- struct ucontext *uc = puc; | ||
+ ucontext_t *uc = puc; | ||
unsigned long pc; | ||
uint16_t *pinsn; | ||
int is_write = 0; | ||
@@ -618,7 +618,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
void *puc) | ||
{ | ||
siginfo_t *info = pinfo; | ||
- struct ucontext *uc = puc; | ||
+ ucontext_t *uc = puc; | ||
greg_t pc = uc->uc_mcontext.pc; | ||
int is_write; | ||
|
||
@@ -634,7 +634,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
void *puc) | ||
{ | ||
siginfo_t *info = pinfo; | ||
- struct ucontext *uc = puc; | ||
+ ucontext_t *uc = puc; | ||
unsigned long pc = uc->uc_mcontext.sc_iaoq[0]; | ||
uint32_t insn = *(uint32_t *)pc; | ||
int is_write = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters