--- /dev/null
+--- gdb-4.18/gdb/infptrace.c.sparc Wed Apr 14 17:36:29 1999
++++ gdb-4.18/gdb/infptrace.c Wed Apr 14 17:38:03 1999
+@@ -39,6 +39,15 @@
+ # include <ptrace.h>
+ #else
+ # ifdef HAVE_SYS_PTRACE_H
++
++#if defined(__sparc__) && defined(__linux__)
++#undef PTRACE_GETREGS /* XXX noise from <sys/ptrace.h> */
++#undef PTRACE_SETREGS
++#undef PTRACE_GETFPREGS
++#undef PTRACE_SETFPREGS
++#undef PT_DETACH
++#endif
++
+ # include <sys/ptrace.h>
+ # endif
+ #endif
+@@ -69,6 +78,11 @@
+ #endif
+ #if !defined (PT_KILL)
+ #define PT_KILL 8 /* Send child a SIGKILL signal */
++#endif
++
++#if defined(__sparc__) && defined(__linux__)
++#undef PT_DETACH
++#define PT_DETACH PTRACE_SUNDETACH
+ #endif
+
+ #ifndef PT_ATTACH
+--- gdb-4.18/gdb/sparc-nat.c.sparc Wed Apr 14 17:38:52 1999
++++ gdb-4.18/gdb/sparc-nat.c Wed Apr 14 17:39:43 1999
+@@ -23,7 +23,23 @@
+ #include "gdbcore.h"
+
+ #include <signal.h>
++
++#if defined(__sparc__) && defined(__linux__)
++#undef PTRACE_GETREGS /* XXX noise from <sys/ptrace.h> */
++#undef PTRACE_SETREGS
++#undef PTRACE_GETFPREGS
++#undef PTRACE_SETFPREGS
++#undef PT_ATTACH
++#undef PT_DETACH
++#endif
++
+ #include <sys/ptrace.h>
++
++#if defined(__sparc__) && defined(__linux__)
++#undef PT_DETACH
++#define PT_DETACH PTRACE_SUNDETACH
++#endif
++
+ #include <sys/wait.h>
+ #ifdef __linux__
+ #include <asm/reg.h>