* [2/2] RFC: build machoread.c in more cases
@ 2012-12-13 19:53 Tom Tromey
2012-12-13 20:03 ` Pedro Alves
2013-01-02 14:54 ` Tom Tromey
0 siblings, 2 replies; 3+ messages in thread
From: Tom Tromey @ 2012-12-13 19:53 UTC (permalink / raw)
To: gdb-patches
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [2/2] RFC: build machoread.c in more cases
2012-12-13 19:53 [2/2] RFC: build machoread.c in more cases Tom Tromey
@ 2012-12-13 20:03 ` Pedro Alves
2013-01-02 14:54 ` Tom Tromey
1 sibling, 0 replies; 3+ messages in thread
From: Pedro Alves @ 2012-12-13 20:03 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
On 12/13/2012 07:53 PM, Tom Tromey wrote:
> 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?
Looks fine to me.
--
Pedro Alves
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [2/2] RFC: build machoread.c in more cases
2012-12-13 19:53 [2/2] RFC: build machoread.c in more cases Tom Tromey
2012-12-13 20:03 ` Pedro Alves
@ 2013-01-02 14:54 ` Tom Tromey
1 sibling, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2013-01-02 14:54 UTC (permalink / raw)
To: gdb-patches
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
Tom> I noticed that machoread.c is only built for Darwin.
Tom> This seems wrong to me. It seems like it should instead be built
Tom> whenever the needed BFD code is built. This is what we do for
Tom> elfread.c.
I'm checking this in now.
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-02 14:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-13 19:53 [2/2] RFC: build machoread.c in more cases Tom Tromey
2012-12-13 20:03 ` Pedro Alves
2013-01-02 14:54 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox