From patchwork Mon Nov 9 18:05:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 9616 Received: (qmail 9087 invoked by alias); 9 Nov 2015 18:05:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 9077 invoked by uid 89); 9 Nov 2015 18:05:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS, URIBL_BLACK autolearn=no version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 09 Nov 2015 18:05:32 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id B867529720 for ; Mon, 9 Nov 2015 13:05:30 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Ao-YWgS0EmZU for ; Mon, 9 Nov 2015 13:05:30 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 89631292DC for ; Mon, 9 Nov 2015 13:05:30 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 256C3405BA; Mon, 9 Nov 2015 10:05:29 -0800 (PST) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFA/gdbserver] disable Elf32_auxv_t/Elf64_auxv_t AC_CHECK_TYPES check on Android Date: Mon, 9 Nov 2015 10:05:25 -0800 Message-Id: <1447092325-20362-1-git-send-email-brobecker@adacore.com> Hello, This patch fixes a GDBserver build failure on Android when using NDK version 9 or later. See the comment added in configure.ac for more details behind this change. gdb/gdbserver/ChangeLog: * configure.ac: Do not call AC_CHECK_TYPES for Elf32_auxv_t and Elf64_auxv_t if the target is Android. Tested on arm-android. OK to commit? Thanks! diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index 409f42b..f1b0e90 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -6444,7 +6444,20 @@ _ACEOF fi -ac_fn_c_check_type "$LINENO" "Elf32_auxv_t" "ac_cv_type_Elf32_auxv_t" "#include +case "${target}" in + *-android*) + # Starting with NDK version 9, actually includes definitions + # of Elf32_auxv_t and Elf64_auxv_t. But sadly, includes + # which defines some of the ELF types incorrectly, + # leading to conflicts with the defintions from . + # This makes it impossible for us to include both and + # , which means that, in practice, we do not have + # access to Elf32_auxv_t and Elf64_auxv_t on this platform. + # Therefore, do not try to auto-detect availability, as it would + # get it wrong on this platform. + ;; + *) + ac_fn_c_check_type "$LINENO" "Elf32_auxv_t" "ac_cv_type_Elf32_auxv_t" "#include " if test "x$ac_cv_type_Elf32_auxv_t" = x""yes; then : @@ -6467,6 +6480,7 @@ _ACEOF fi +esac diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac index 0fe0a35..2a69db5 100644 --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac @@ -236,9 +236,23 @@ AC_CHECK_TYPES(socklen_t, [], [], #include ]) -AC_CHECK_TYPES([Elf32_auxv_t, Elf64_auxv_t], [], [], -#include -) +case "${target}" in + *-android*) + # Starting with NDK version 9, actually includes definitions + # of Elf32_auxv_t and Elf64_auxv_t. But sadly, includes + # which defines some of the ELF types incorrectly, + # leading to conflicts with the defintions from . + # This makes it impossible for us to include both and + # , which means that, in practice, we do not have + # access to Elf32_auxv_t and Elf64_auxv_t on this platform. + # Therefore, do not try to auto-detect availability, as it would + # get it wrong on this platform. + ;; + *) + AC_CHECK_TYPES([Elf32_auxv_t, Elf64_auxv_t], [], [], + #include + ) +esac ACX_PKGVERSION([GDB]) ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])