From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21942 invoked by alias); 13 Dec 2012 19:53:38 -0000 Received: (qmail 21932 invoked by uid 22791); 13 Dec 2012 19:53:37 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 13 Dec 2012 19:53:31 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBDJrV59028954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 13 Dec 2012 14:53:31 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qBDJrUF7001947 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 13 Dec 2012 14:53:30 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Subject: [2/2] RFC: build machoread.c in more cases Date: Thu, 13 Dec 2012 19:53:00 -0000 Message-ID: <87fw394tl1.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-12/txt/msg00465.txt.bz2 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