From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: [2/2] RFC: build machoread.c in more cases
Date: Thu, 13 Dec 2012 19:53:00 -0000 [thread overview]
Message-ID: <87fw394tl1.fsf@fleche.redhat.com> (raw)
I noticed that machoread.c is only built for Darwin.
This seems wrong to me. It seems like it should instead be built
whenever the needed BFD code is built. This is what we do for
elfread.c.
This patch has two benefits. First, it means building with a Darwin
target is more possible. Second, it means that --enable-targets=all
will build machoread.c, leading to fewer chances for build regressions
there. The is the case I ran into...
Comments?
Tom
* config/i386/darwin.mh (NATDEPFILES): Remove machoread.o.
* configure.ac: Check for Mach-O support in BFD. Update
CONFIG_OBS.
* configure: Rebuild.
---
gdb/config/i386/darwin.mh | 2 +-
gdb/configure | 52 +++++++++++++++++++++++++++++++++++++++++++++
gdb/configure.ac | 7 ++++++
3 files changed, 60 insertions(+), 1 deletions(-)
diff --git a/gdb/config/i386/darwin.mh b/gdb/config/i386/darwin.mh
index cd7f248..190d56c 100644
--- a/gdb/config/i386/darwin.mh
+++ b/gdb/config/i386/darwin.mh
@@ -1,4 +1,4 @@
# Host: IA86 running Darwin
-NATDEPFILES = fork-child.o machoread.o darwin-nat.o \
+NATDEPFILES = fork-child.o darwin-nat.o \
i386-darwin-nat.o i386-nat.o amd64-nat.o darwin-nat-info.o
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 26c88f4..0468f3b 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -2027,6 +2027,13 @@ if test $gdb_cv_var_elf = yes; then
fi
fi
+# Add macho support to GDB, but only if BFD includes it.
+GDB_AC_CHECK_BFD([for Mach-O support in BFD], gdb_cv_var_macho,
+ [bfd_mach_o_lookup_command (NULL, 0, NULL)], mach-o.h)
+if test $gdb_cv_var_macho = yes; then
+ CONFIG_OBS="$CONFIG_OBS machoread.o"
+fi
+
# Add any host-specific objects to GDB.
CONFIG_OBS="${CONFIG_OBS} ${gdb_host_obs}"
--
1.7.7.6
next reply other threads:[~2012-12-13 19:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-13 19:53 Tom Tromey [this message]
2012-12-13 20:03 ` Pedro Alves
2013-01-02 14:54 ` Tom Tromey
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=87fw394tl1.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
/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