From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115733 invoked by alias); 6 Aug 2015 13:06:57 -0000 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 Received: (qmail 115716 invoked by uid 89); 6 Aug 2015 13:06:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mga09.intel.com Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Aug 2015 13:06:50 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 06 Aug 2015 06:06:47 -0700 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 06 Aug 2015 06:06:47 -0700 Received: from ulvlx001.iul.intel.com (ulvlx001.iul.intel.com [172.28.207.17]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t76D6kiq003526; Thu, 6 Aug 2015 14:06:46 +0100 Received: from ulvlx001.iul.intel.com (localhost [127.0.0.1]) by ulvlx001.iul.intel.com with ESMTP id t76D6jJx022887; Thu, 6 Aug 2015 15:06:45 +0200 Received: (from mmetzger@localhost) by ulvlx001.iul.intel.com with œ id t76D6jgg022883; Thu, 6 Aug 2015 15:06:45 +0200 From: Markus Metzger To: palves@redhat.com Cc: gdb-patches@sourceware.org Subject: [PATCH] configure: check for perf_event.h version Date: Thu, 06 Aug 2015 13:06:00 -0000 Message-Id: <1438866405-22616-1-git-send-email-markus.t.metzger@intel.com> X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00146.txt.bz2 Intel(R) Processor Trace support requires a recent linux/perf_event.h header. When GDB is built on an older system, Intel(R) Processor Trace will not be available and there is no indication in the configure and build log as to what went wrong. Check for a compatible linux/perf_event.h at configure-time. 2015-08-06 Markus Metzger gdb/ * configure.ac: Check for PERF_ATTR_SIZE_VER5 in linux/perf_event.h * configure: Regenerate. --- gdb/configure | 27 ++++++++++++++++++++++++++- gdb/configure.ac | 14 ++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/gdb/configure b/gdb/configure index e1b778b..ddff555 100755 --- a/gdb/configure +++ b/gdb/configure @@ -1558,7 +1558,8 @@ Optional Packages: (auto/yes/no/) --with-guile[=GUILE] include guile support (auto/yes/no//) - --with-intel-pt include Intel(R) Processor Trace support (auto/yes/no) + --with-intel-pt include Intel(R) Processor Trace support + (auto/yes/no) --with-libipt-prefix[=DIR] search for libipt in DIR/include and DIR/lib --without-libipt-prefix don't search for libipt in includedir and libdir --without-included-regex @@ -9732,6 +9733,30 @@ if test "${with_intel_pt}" = no; then $as_echo "$as_me: WARNING: Intel(R) Processor Trace support disabled; some features may be unavailable." >&2;} HAVE_LIBIPT=no else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef PERF_ATTR_SIZE_VER5 +# error +#endif + +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + perf_event=no +else + perf_event=yes +fi +rm -f conftest.err conftest.$ac_ext + if test "$perf_event" != yes; then + if test "$with_intel_pt" = yes; then + as_fn_error "linux/perf_event.h missing or too old" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&5 +$as_echo "$as_me: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&2;} + fi + fi + diff --git a/gdb/configure.ac b/gdb/configure.ac index 905c27b..d867e85 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1252,6 +1252,20 @@ if test "${with_intel_pt}" = no; then AC_MSG_WARN([Intel(R) Processor Trace support disabled; some features may be unavailable.]) HAVE_LIBIPT=no else + AC_PREPROC_IFELSE(AC_LANG_SOURCE([[ +#include +#ifdef PERF_ATTR_SIZE_VER5 +# error +#endif + ]]), [perf_event=no], [perf_event=yes]) + if test "$perf_event" != yes; then + if test "$with_intel_pt" = yes; then + AC_MSG_ERROR([linux/perf_event.h missing or too old]) + else + AC_MSG_WARN([linux/perf_event.h missing or too old; some features may be unavailable.]) + fi + fi + AC_LIB_HAVE_LINKFLAGS([ipt], [], [#include "intel-pt.h"], [pt_insn_alloc_decoder (0);]) if test "$HAVE_LIBIPT" != yes; then if test "$with_intel_pt" = yes; then -- 1.8.3.1