From patchwork Wed Aug 7 22:30:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 34000 Received: (qmail 71719 invoked by alias); 7 Aug 2019 22:31:04 -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 71710 invoked by uid 89); 7 Aug 2019 22:31:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway33.websitewelcome.com Received: from gateway33.websitewelcome.com (HELO gateway33.websitewelcome.com) (192.185.145.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 07 Aug 2019 22:30:59 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 5247072E1D for ; Wed, 7 Aug 2019 17:30:58 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id vUSQh1ZDLiQervUSQhOuli; Wed, 07 Aug 2019 17:30:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=c2PJMc1qdFPjMzveE3h7ClzgkutCWm3YL48jx2153QM=; b=xhb33L45jR4gqbDQK/KWu7u0yI T2OXPxp+2mT0QO1OBSVzrDBbor9ZTupRaqi92PhwuAOpr8THKeShDXHHaXOWG5IlkOgbi3cWHkrNu alC5y4rGB7hRU+9KGItxnElNo; Received: from 97-122-178-82.hlrn.qwest.net ([97.122.178.82]:56416 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hvUSQ-001YTB-2Z; Wed, 07 Aug 2019 17:30:58 -0500 From: Tom Tromey To: Pedro Alves Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 8/8] Require readline 7 or newer References: <20190806204334.13441-1-tom@tromey.com> <20190806204334.13441-9-tom@tromey.com> <91cf16b4-343b-1d47-ab5c-c8f2127cd4db@redhat.com> Date: Wed, 07 Aug 2019 16:30:56 -0600 In-Reply-To: <91cf16b4-343b-1d47-ab5c-c8f2127cd4db@redhat.com> (Pedro Alves's message of "Wed, 7 Aug 2019 15:42:14 +0100") Message-ID: <87o910ehgf.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.91 (gnu/linux) MIME-Version: 1.0 >>>>> "Pedro" == Pedro Alves writes: Pedro> I'd be much better user experience if this were done at by the Pedro> build system, at configure time, with AC_TRY_COMPILE, IMO. Something Pedro> similar to the "GNU regex" check should do it. Makes sense. Here's a new patch that addresses this and the NEWS thing. Tom commit 332eb34e3d21c1a3de2b4f6c874912321da1b3a4 Author: Tom Tromey Date: Sun Apr 21 13:58:49 2019 -0600 Require readline 7 or newer This changes gdb to require readline 7 or newer at build time. gdb/ChangeLog 2019-08-07 Tom Tromey * configure: Rebuild. * configure.ac: Check for readline 7. * NEWS: Mention readline 7 requirement. * README: Update. gdb/doc/ChangeLog 2019-04-21 Tom Tromey * gdb.texinfo (Configure Options): Document minimum version of readline. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2e05431607c..54d35df7a01 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2019-08-07 Tom Tromey + + * configure: Rebuild. + * configure.ac: Check for readline 7. + * NEWS: Mention readline 7 requirement. + * README: Update. + 2019-08-04 Tom Tromey * mingw-hdep.c (gdb_select): Remove readline hack. diff --git a/gdb/NEWS b/gdb/NEWS index fa01adf6e89..9f37e7c1079 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -299,6 +299,11 @@ maint show test-options-completion-result Using another implementation of the make program or an earlier version of GNU make to build GDB or GDBserver is not supported. +* Building GDB and GDBserver now requires GNU readline >= 7.0. + + GDB now bundles GNU readline 8.0, but if you choose to use + --with-system-readline, only readline >= 7.0 can be used. + *** Changes in GDB 8.3 * GDB and GDBserver now support access to additional registers on diff --git a/gdb/README b/gdb/README index 8a91aab2a4c..8883a8a09e3 100644 --- a/gdb/README +++ b/gdb/README @@ -439,7 +439,8 @@ more obscure GDB `configure' options are not listed here. `--with-system-readline' Use the readline library installed on the host, rather than the - library supplied as part of GDB. + library supplied as part of GDB. Readline 7 or newer is required; + this is enforced by the build system. `--with-system-zlib Use the zlib library installed on the host, rather than the diff --git a/gdb/configure b/gdb/configure index 9206f0e7f88..2832c836177 100755 --- a/gdb/configure +++ b/gdb/configure @@ -8952,6 +8952,38 @@ fi if test "$with_system_readline" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system readline is new enough" >&5 +$as_echo_n "checking whether system readline is new enough... " >&6; } +if ${gdb_cv_readline_ok+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +#if RL_VERSION_MAJOR < 7 +# error "readline version 7 required" +#endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gdb_cv_readline_ok=yes +else + gdb_cv_readline_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_readline_ok" >&5 +$as_echo "$gdb_cv_readline_ok" >&6; } + if test "$gdb_cv_readline_ok" != yes; then + as_fn_error $? "system readline is not new enough" "$LINENO" 5 + fi + READLINE=-lreadline READLINE_DEPS= READLINE_CFLAGS= diff --git a/gdb/configure.ac b/gdb/configure.ac index 05b722b7f11..0979109d976 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -581,6 +581,20 @@ AC_ARG_WITH([system-readline], [use installed readline library])]) if test "$with_system_readline" = yes; then + AC_CACHE_CHECK([whether system readline is new enough], + [gdb_cv_readline_ok], + [AC_TRY_COMPILE( + [#include +#include ], + [#if RL_VERSION_MAJOR < 7 +# error "readline version 7 required" +#endif], + gdb_cv_readline_ok=yes, + gdb_cv_readline_ok=no)]) + if test "$gdb_cv_readline_ok" != yes; then + AC_MSG_ERROR([system readline is not new enough]) + fi + READLINE=-lreadline READLINE_DEPS= READLINE_CFLAGS= diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 702bb7c7a02..f25b468468b 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2019-04-21 Tom Tromey + + * gdb.texinfo (Configure Options): Document minimum version of + readline. + 2019-08-07 Alan Hayward * gdb.texinfo (AArch64 Pointer Authentication): New subsection. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 7f8c0aff1cd..e36b2d59745 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -36905,7 +36905,8 @@ details. @item --with-system-readline Use the readline library installed on the host, rather than the -library supplied as part of @value{GDBN}. +library supplied as part of @value{GDBN}. Readline 7 or newer is +required; this is enforced by the build system. @item --with-system-zlib Use the zlib library installed on the host, rather than the library