From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11785 invoked by alias); 25 Feb 2013 14:33:04 -0000 Received: (qmail 11769 invoked by uid 22791); 25 Feb 2013 14:33:03 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,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; Mon, 25 Feb 2013 14:32:49 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1PEWlfW031863 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 25 Feb 2013 09:32:47 -0500 Received: from host2.jankratochvil.net (ovpn-116-19.ams2.redhat.com [10.36.116.19]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r1PEWhqM027118 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 25 Feb 2013 09:32:46 -0500 Date: Mon, 25 Feb 2013 14:33:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: Philippe Waroquiers , gdb-patches@sourceware.org Subject: Re: [patch+NEWS] Avoid false valgrind warnings on linux_ptrace_test_ret_to_nx Message-ID: <20130225143242.GB25286@host2.jankratochvil.net> References: <20130220140520.GA10822@host2.jankratochvil.net> <5124E66D.3060606@redhat.com> <20130220152331.GA16617@host2.jankratochvil.net> <5124F214.7020506@redhat.com> <20130220160808.GA19181@host2.jankratochvil.net> <5125082A.8040901@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5125082A.8040901@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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: 2013-02/txt/msg00627.txt.bz2 On Wed, 20 Feb 2013 18:30:18 +0100, Pedro Alves wrote: > On 02/20/2013 04:08 PM, Jan Kratochvil wrote: > > OTOH here you ask for the opposite, unchecked inclusion of include file > > which is very complicated > > with compiler-dependent parts and arch-specific code, > > which all seem to me to possibly cause compilation failures. > > Now I'm at a total loss. I have no idea what you're considering > very complicated, and what needs to be compiler dependent. > All I was thinking was something like the patch below. It primarily misses the --with-valgrind feature: to error out when user does want the (valgrind) support but system does not have the prerequisite files. As the packaging system may omit some of the prerequisites (such as when PKG splits out its PKG-devel subpackage) one needs to ensure such build will fail. We do not want to quietly build new GDB missing some of the expected features. --with-valgrind makes this easy. Otherwise the packager needs to place in the .spec file: grep HAVE_VALGRIND_VALGRIND_H gdb/config.h Moreover multiple times as config.h gets sometimes rebuilt during some build scenarios. For example Fedora gdb.spec already has such a hack because there is no corresponding --with-*/--enable-* option for this one: ! grep '_RELOCATABLE.*1' gdb/config.h It may be clear I do not want to introduce more such greps there. So with the --with-valgrind requirement we end up discussing whether these 8 lines of code should or should not be there: + AC_MSG_CHECKING([for RUNNING_ON_VALGRIND macro]) + AC_CACHE_VAL(gdb_cv_check_running_on_valgrind, [ + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[return RUNNING_ON_VALGRIND;]])], + [gdb_cv_check_running_on_valgrind=yes], + [gdb_cv_check_running_on_valgrind=no])]) + AC_MSG_RESULT($gdb_cv_check_running_on_valgrind) I believe there is a real risk there can exist old system(s) on non-x86* arch having valgrind/valgrind.h available but failing to build RUNNING_ON_VALGRIND. Sure people have different opinions what is useful and what is just a bloat. Although when I already wrote the code I do not find such a serious problem to put there such 8 lines to sanity check the compatibility. Jan