Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@gnat.com>
To: gdb-patches@sources.redhat.com
Subject: gdbserver build broken on amd64-linux
Date: Wed, 20 Oct 2004 05:32:00 -0000	[thread overview]
Message-ID: <20041020053216.GB3527@gnat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1249 bytes --]

The compiler fails to find a couple of macros:

> gcc -c -Wall -g -O2    -I. -I. -I./../regformats -I./../../include -I../../bfd -I./../../bfd linux-x86-64-low.c
> linux-x86-64-low.c: In function 'ps_get_thread_area':
> linux-x86-64-low.c:70: error: 'ARCH_GET_FS' undeclared (first use in this function)
> linux-x86-64-low.c:70: error: (Each undeclared identifier is reported only once
> linux-x86-64-low.c:70: error: for each function it appears in.)
> linux-x86-64-low.c:74: error: 'ARCH_GET_GS' undeclared (first use in this function)

I found the definitions in asm-x86_64/prctl.h. So I #included that file,
and the build succeeded. Looking at the name, I wasn't too enthusiastic
about it, as it didn't look too standard, so I looked around, and saw
that this file is included from asm/prctl.h. So I changed the #include
to that file instead, and got the builds again.

2004-10-19  Joel Brobecker  <brobecker@gnat.com>

        * linux-x86-64-low.c: Include asm/prctl.h.

I hope this is the right fix, but at the same time, I can't help but
wonder how it did work before... Let me know if this is OK to apply
or if it is the wrong fix (I am hoping that the location of these
macros is not dependent on the Linux distribution).

Thanks,
-- 
Joel

[-- Attachment #2: linux-x86-64-low.c.diff --]
[-- Type: text/plain, Size: 537 bytes --]

Index: linux-x86-64-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-x86-64-low.c,v
retrieving revision 1.8
diff -u -p -r1.8 linux-x86-64-low.c
--- linux-x86-64-low.c	16 Oct 2004 17:42:00 -0000	1.8
+++ linux-x86-64-low.c	20 Oct 2004 05:27:24 -0000
@@ -41,6 +41,7 @@
 #include <sys/reg.h>
 #include <sys/procfs.h>
 #include <sys/ptrace.h>
+#include <asm/prctl.h>
 
 /* This definition comes from prctl.h, but some kernels may not have it.  */
 #ifndef PTRACE_ARCH_PRCTL

             reply	other threads:[~2004-10-20  5:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-20  5:32 Joel Brobecker [this message]
2004-10-20 14:26 ` Daniel Jacobowitz
2004-10-20 15:24   ` Joel Brobecker
2004-10-20 15:47     ` Mark Kettenis
2004-10-20 15:53       ` Daniel Jacobowitz
2004-10-21  4:15         ` Joel Brobecker
2004-10-21  4:38           ` Joel Brobecker
2004-10-21 13:48             ` Daniel Jacobowitz
2004-10-21 17:27               ` Joel Brobecker
2004-10-21 13:49           ` Daniel Jacobowitz
2004-10-21 17:33             ` Joel Brobecker
2004-10-21 17:36               ` Daniel Jacobowitz
2004-10-21 18:09                 ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041020053216.GB3527@gnat.com \
    --to=brobecker@gnat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox