Skip to content

Instantly share code, notes, and snippets.

@LWSS
Created April 23, 2020 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LWSS/fae2d3c34205dc0074ddd9ed767e7e99 to your computer and use it in GitHub Desktop.
Save LWSS/fae2d3c34205dc0074ddd9ed767e7e99 to your computer and use it in GitHub Desktop.
patches for gcc 4.6.3. Tested and working
--- gcc/config/i386/linux-unwind_old.h 2020-04-23 01:24:02.340521262 -0700
+++ gcc/config/i386/linux-unwind.h 2020-04-23 01:25:27.189316948 -0700
@@ -47,7 +47,7 @@
if (*(unsigned char *)(pc+0) == 0x48
&& *(unsigned long *)(pc+1) == 0x050f0000000fc0c7)
{
- struct ucontext *uc_ = context->cfa;
+ ucontext_t *uc_ = context->cfa;
/* The void * cast is necessary to avoid an aliasing warning.
The aliasing warning is correct, but should not be a problem
because it does not alias anything. */
@@ -133,10 +133,10 @@
{
struct rt_sigframe {
int sig;
- struct siginfo *pinfo;
+ siginfo_t *pinfo;
void *puc;
- struct siginfo info;
- struct ucontext uc;
+ siginfo_t info;
+ ucontext_t uc;
} *rt_ = context->cfa;
/* The void * cast is necessary to avoid an aliasing warning.
The aliasing warning is correct, but should not be a problem
--- libjava/include/i386-signal_old.h 2020-04-23 01:44:22.270333520 -0700
+++ libjava/include/i386-signal.h 2020-04-23 01:44:39.510698282 -0700
@@ -26,7 +26,7 @@
#define HANDLE_DIVIDE_OVERFLOW \
do \
{ \
- struct ucontext *_uc = (struct ucontext *)_p; \
+ ucontext_t *_uc = (ucontext_t *)_p; \
gregset_t &_gregs = _uc->uc_mcontext.gregs; \
unsigned char *_eip = (unsigned char *)_gregs[REG_EIP]; \
\
--- libjava/include/x86_64-signal_old.h 2020-04-23 01:40:42.281679031 -0700
+++ libjava/include/x86_64-signal.h 2020-04-23 01:41:10.129268256 -0700
@@ -28,7 +28,7 @@
#define HANDLE_DIVIDE_OVERFLOW \
do \
{ \
- struct ucontext *_uc = (struct ucontext *)_p; \
+ ucontext_t *_uc = (ucontext_t *)_p; \
gregset_t &_gregs = _uc->uc_mcontext.gregs; \
unsigned char *_rip = (unsigned char *)_gregs[REG_RIP]; \
\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment