From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nx232.node02.secure-mailgate.com (nx232.node02.secure-mailgate.com [192.162.87.232]) by sourceware.org (Postfix) with ESMTPS id 64A613858004 for ; Mon, 31 May 2021 21:33:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 64A613858004 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=trande.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=zied.guermazi@trande.de Received: from host202.checkdomain.de ([185.137.168.148]) by node02.secure-mailgate.com with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1lnpXO-00AeU8-3T; Mon, 31 May 2021 23:33:31 +0200 X-SecureMailgate-Identity: zied.guermazi@trande.de;host202.checkdomain.de Received: from Trande0001.fritz.box (x4dbe295e.dyn.telefonica.de [77.190.41.94]) (Authenticated sender: zied.guermazi@trande.de) by host202.checkdomain.de (Postfix) with ESMTPSA id A2D37300417; Mon, 31 May 2021 23:33:27 +0200 (CEST) X-SecureMailgate-Identity: zied.guermazi@trande.de;host202.checkdomain.de From: Zied Guermazi To: gdb-patches@sourceware.org, markus.t.metzger@intel.com Cc: Zied Guermazi Subject: [PATCH v6 1/7] configure gdb build system for supporting btrace on arm processors Date: Mon, 31 May 2021 23:33:01 +0200 Message-Id: <20210531213307.275079-2-zied.guermazi@trande.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210531213307.275079-1-zied.guermazi@trande.de> References: <20210531213307.275079-1-zied.guermazi@trande.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-PPP-Message-ID: <20210531213328.2005916.91052@host202.checkdomain.de> X-PPP-Vhost: trande.de X-Originating-IP: 185.137.168.148 X-SecureMailgate-Domain: host202.checkdomain.de X-SecureMailgate-Username: 185.137.168.148 Authentication-Results: secure-mailgate.com; auth=pass smtp.auth=185.137.168.148@host202.checkdomain.de X-SecureMailgate-Outgoing-Class: ham X-SecureMailgate-Outgoing-Evidence: SB/global_tokens (0.000105954723611) X-Recommended-Action: accept X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT8NPEcsHHq+Jvg3ja17w+bzPUtbdvnXkggZ 3YnVId/Y5jcf0yeVQAvfjHznO7+bT5xepKJyYLZISh0ScmnJxtOQL++T0fzDkcbraJCnPSgcQrqW ghmgrvbuYBMbgPFqhEjKF590ee3aGyyzch48U9RYPumU89c8OaxcWLmp7ynpEglWYkflasVSPhVO vJcPBc5kg5BhoNcHfSWweO3uPweQOspDufM3ay4ktP0suaVr4qkN1tR5WGFFI2Zu1mFmj/jWuw/Y Jn6sireiT/nV8ihOURqb7MAH1NrJot1V9507yrhIMSED2KQswkkU6IgfmBj8Hz+Eg3Qmi4KAfpBm FUZXT+7z4pJHJBN9765lPkUMmhqXSHvjdU6ko1j7gyOKOKF7y9KyMhs+dROCnF0qWM2TLX4i2bdm Lrt/fdDS9Ii3kWdcYUysm0ld2GCJTCinOsqiQcaylmhK3EEc7P+KlnTxQJtR4QxWMOifmt9LOcQX 1afTF2zzHOUj1s00F3rRRpqf2Enr8123wW1PIBoO0QaQo4b0r//Ut6pPpczZ8zP+0qdA6ZrmnK8d nrZIOzPOFCMHPCNOxUxXI6XX1/yXK/O3SA6y1K1EOm1MYByprvQ6e6ADS3r2wjjEGtaal+lgW0dK YRw2uzZSa4zLNGy8qUnY7v1vYyCRi03s0e/l06zibHcSpbwKA/DsSgtEvE/FmwCAUuNAukfKnqWf +PWMOlMhSYJHRHso2yGjpoJSangIKIr+lR/w6FHDWndix5xHxZ1nmoxyAoGYX8dPEJrR14Qe8z2k Q+5bHeJMrvavv7KlPjYfTH509XQw8Xdr+MnJzzYQZOXrIJ643yXA4xTQKzctWLK7RM6POoZTEOxN db+wT31ohERjPYghQyMtiLHQ6cL0xRuYGXV1F5K4Z9MooNnsyvEtvqrbjFCWDrm3HaFWfAt8gP4i 3ZcbuTuh/o13fme9waUEA8xcITmWdAm8n/WsXPWlFdaGOH191uXjgjQN/WD174tW8+eNkgg2Ai2o +8F5OXPQ3Y+JdKAvUlJRDJL2pXm9WYNUuH9yxKni8nfrVr734QDJ3HhluVo9DS81JHEyw9MUVUR8 Hoq0Jqemj8x0vo/tbxkEQkkk6f8p8qlRXxqXSHvjdU6ko1j7gyOKOKHVN0GmGphzs9bpXefqEDQr pVlO2PleJC8SzWxZvoPW//kaAyqYy1dVq7+gA5DTwtMxL7hrJSk60SF3F6RYOYr2 X-Report-Abuse-To: spam@node04.secure-mailgate.com X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LINEPADDING, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2021 21:33:39 -0000 This patch adds the possibility to build GDB with support for branch tracing using ARM CoreSight traces. New flag is --with-arm-cs gdb/ChangeLog * Makefile.in LIBOPENCSD_C_API: Regenerated. * config.in LIBOPENCSD_C_API: Regenerated. * configure: Regenerated. * configure.nat: add nat/linux-btrace.o to the build for aarch64 and arm * top.c (print_gdb_configuration): add --with-arm-cs or --without-arm-cs according to the configuration. gdbserver/ChangeLog * gdbserver/configure: Regenerated. * gdbserver/config.in: Regenerated. gdbsupport/ChangeLog * gdbsupport/common.m4: check --with-arm-cs configuration flag, perf_event and opencsd_c_api to set compilation flags. * gdbsupport/config.in: Regenerated. * gdbsupport/Makefile.in: Regenerated. * gdbsupport/configure: Regenerated. --- gdb/Makefile.in | 5 +- gdb/config.in | 3 + gdb/configure | 549 +++++++++++++++++++++++++++++++++++++++++ gdb/configure.nat | 4 +- gdb/top.c | 10 +- gdbserver/config.in | 3 + gdbserver/configure | 545 ++++++++++++++++++++++++++++++++++++++++ gdbsupport/Makefile.in | 3 + gdbsupport/common.m4 | 39 +++ gdbsupport/config.in | 3 + gdbsupport/configure | 545 ++++++++++++++++++++++++++++++++++++++++ 11 files changed, 1705 insertions(+), 4 deletions(-) diff --git a/gdb/Makefile.in b/gdb/Makefile.in index bb6c5dfa784..04680a22e5c 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -203,6 +203,9 @@ LIBXXHASH = @LIBXXHASH@ # Where is libipt? This will be empty if libipt was not available. LIBIPT = @LIBIPT@ +#where is libopencsd? this will be empty if libopencsd was not available +LIBOPENCSD_C_API = @LIBOPENCSD_C_API@ + # Where is libgmp? LIBGMP = @LIBGMP@ @@ -636,7 +639,7 @@ CLIBS = $(SIM) $(READLINE) $(OPCODES) $(LIBCTF) $(BFD) $(ZLIB) \ $(LIBSUPPORT) $(INTL) $(LIBIBERTY) $(LIBDECNUMBER) \ $(XM_CLIBS) $(GDBTKLIBS) \ @LIBS@ @GUILE_LIBS@ @PYTHON_LIBS@ \ - $(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \ + $(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) $(LIBOPENCSD_C_API) \ $(WIN32LIBS) $(LIBGNU) $(LIBGNU_EXTRA_LIBS) $(LIBICONV) \ $(LIBMPFR) $(LIBGMP) $(SRCHIGH_LIBS) $(LIBXXHASH) $(PTHREAD_LIBS) \ $(DEBUGINFOD_LIBS) diff --git a/gdb/config.in b/gdb/config.in index 99c924f9ba0..0373689a3ce 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -246,6 +246,9 @@ /* Define if you have the mpfr library. */ #undef HAVE_LIBMPFR +/* Define if you have the opencsd_c_api library. */ +#undef HAVE_LIBOPENCSD_C_API + /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_IA64_H diff --git a/gdb/configure b/gdb/configure index cdc112e10dc..26b075a7c61 100755 --- a/gdb/configure +++ b/gdb/configure @@ -705,6 +705,9 @@ SYSTEM_GDBINIT TARGET_SYSTEM_ROOT CONFIG_LDFLAGS RDYNAMIC +LTLIBOPENCSD_C_API +LIBOPENCSD_C_API +HAVE_LIBOPENCSD_C_API LTLIBIPT LIBIPT HAVE_LIBIPT @@ -911,6 +914,9 @@ enable_source_highlight with_intel_pt with_libipt_prefix with_libipt_type +with_arm_cs +with_libopencsd_c_api_prefix +with_libopencsd_c_api_type with_sysroot with_system_gdbinit with_system_gdbinit_dir @@ -1660,6 +1666,15 @@ Optional Packages: --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 --with-libipt-type=TYPE type of library to search for (auto/static/shared) + --with-arm-cs include ARM CoreSight Processor Trace support + (auto/yes/no) + --with-libopencsd_c_api-prefix[=DIR] search for libopencsd_c_api in DIR/include and DIR/lib + --without-libopencsd_c_api-prefix don't search for libopencsd_c_api in includedir and libdir + --with-libopencsd_c_api-type=TYPE type of library to search for (auto/static/shared) + --without-included-regex + don't use included regex; this is the default on + systems with version 2 of the GNU C library (use + with caution on other system) --with-sysroot[=DIR] search for usr/lib et al within DIR --with-system-gdbinit=PATH automatically load a system-wide gdbinit file @@ -15238,6 +15253,540 @@ fi fi fi + # ARM CoreSight trace # + + +# Check whether --with-arm_cs was given. +if test "${with_arm_cs+set}" = set; then : + withval=$with_arm_cs; +else + with_arm_cs=auto +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use ARM CoreSight Processor Trace " >&5 +$as_echo_n "checking whether to use ARM CoreSight Processor Trace ... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_arm_cs" >&5 +$as_echo "$with_arm_cs" >&6; } + + if test "${with_arm_cs}" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ARM CoreSight Processor Trace support disabled; CoreSight Tracing will be unavailable." >&5 +$as_echo "$as_me: WARNING: ARM CoreSight Processor Trace support disabled; CoreSight Tracing will be unavailable." >&2;} + HAVE_LIBOPENCSD=no + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef PERF_ATTR_SIZE_VER5 + # error + #endif + +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + perf_event=yes +else + perf_event=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext + if test "$perf_event" != yes; then + if test "$with_arm_cs" = 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; CoreSight Tracing will be unavailable." >&5 +$as_echo "$as_me: WARNING: linux/perf_event.h missing or too old; CoreSight Tracing will be unavailable." >&2;} + fi + fi + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libopencsd_c_api-prefix was given. +if test "${with_libopencsd_c_api_prefix+set}" = set; then : + withval=$with_libopencsd_c_api_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + +fi + + +# Check whether --with-libopencsd_c_api-type was given. +if test "${with_libopencsd_c_api_type+set}" = set; then : + withval=$with_libopencsd_c_api_type; with_libopencsd_c_api_type=$withval +else + with_libopencsd_c_api_type=auto +fi + + lib_type=`eval echo \$with_libopencsd_c_api_type` + + LIBOPENCSD_C_API= + LTLIBOPENCSD_C_API= + INCOPENCSD_C_API= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='opencsd_c_api ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext" && test x$lib_type != xstatic; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + elif test x$lib_type != xshared; then + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBOPENCSD_C_API; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext" && test x$lib_type != xstatic; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + elif test x$lib_type != xshared; then + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBOPENCSD_C_API; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$found_so" + else + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$found_a" + else + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCOPENCSD_C_API; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCOPENCSD_C_API="${INCOPENCSD_C_API}${INCOPENCSD_C_API:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBOPENCSD_C_API; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBOPENCSD_C_API; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$dep" + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }$dep" + ;; + esac + done + fi + else + if test "x$lib_type" = "xauto" || test "x$lib_type" = "xshared"; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-l$name" + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }-l$name" + else + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-l:lib$name.$libext" + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }-l:lib$name.$libext" + fi + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }-R$found_dir" + done + fi + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCOPENCSD_C_API; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libopencsd_c_api" >&5 +$as_echo_n "checking for libopencsd_c_api... " >&6; } +if ${ac_cv_libopencsd_c_api+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIBOPENCSD_C_API" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "opencsd/c_api/opencsd_c_api.h" +int +main () +{ +ocsd_get_version(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_libopencsd_c_api=yes +else + ac_cv_libopencsd_c_api=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libopencsd_c_api" >&5 +$as_echo "$ac_cv_libopencsd_c_api" >&6; } + if test "$ac_cv_libopencsd_c_api" = yes; then + HAVE_LIBOPENCSD_C_API=yes + +$as_echo "#define HAVE_LIBOPENCSD_C_API 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libopencsd_c_api" >&5 +$as_echo_n "checking how to link with libopencsd_c_api... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBOPENCSD_C_API" >&5 +$as_echo "$LIBOPENCSD_C_API" >&6; } + else + HAVE_LIBOPENCSD_C_API=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBOPENCSD_C_API= + LTLIBOPENCSD_C_API= + fi + + + + + + + if test "$HAVE_LIBOPENCSD_C_API" != yes; then + if test "$with_arm_cs" = yes; then + as_fn_error $? "libopencsd_c_api is missing or unusable" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libopencsd_c_api is missing or unusable; CoreSight Tracing will be unavailable." >&5 +$as_echo "$as_me: WARNING: libopencsd_c_api is missing or unusable; CoreSight Tracing will be unavailable." >&2;} + fi + else + LIBS="$LIBS $LIBOPENCSD_C_API" + fi + fi + + $as_echo "#define _STRUCTURED_PROC 1" >>confdefs.h diff --git a/gdb/configure.nat b/gdb/configure.nat index e34cccffd98..135041bd031 100644 --- a/gdb/configure.nat +++ b/gdb/configure.nat @@ -235,7 +235,7 @@ case ${gdb_host} in # Host: AArch64 based machine running GNU/Linux NATDEPFILES="${NATDEPFILES} aarch64-linux-nat.o \ aarch32-linux-nat.o nat/aarch64-linux-hw-point.o \ - nat/aarch64-linux.o \ + nat/aarch64-linux.o nat/linux-btrace.o \ nat/aarch64-sve-linux-ptrace.o \ nat/aarch64-mte-linux-ptrace.o" ;; @@ -246,7 +246,7 @@ case ${gdb_host} in arm) # Host: ARM based machine running GNU/Linux NATDEPFILES="${NATDEPFILES} arm-linux-nat.o \ - aarch32-linux-nat.o" + aarch32-linux-nat.o nat/linux-btrace.o" ;; i386) # Host: Intel 386 running GNU/Linux. diff --git a/gdb/top.c b/gdb/top.c index 6e0f43d2fd9..53f04ee29af 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -1538,7 +1538,15 @@ This GDB was configured as follows:\n\ --without-intel-pt\n\ ")); #endif - +#if HAVE_LIBOPENCSD_C_API + fprintf_filtered (stream, _("\ + --with-arm-cs\n\ +")); +#else + fprintf_filtered (stream, _("\ + --without-arm-cs\n\ +")); +#endif #if HAVE_LIBMPFR fprintf_filtered (stream, _("\ --with-mpfr\n\ diff --git a/gdbserver/config.in b/gdbserver/config.in index 611bfd7aa76..fbcdf896ef7 100644 --- a/gdbserver/config.in +++ b/gdbserver/config.in @@ -139,6 +139,9 @@ /* Define if you have the ipt library. */ #undef HAVE_LIBIPT +/* Define if you have the opencsd_c_api library. */ +#undef HAVE_LIBOPENCSD_C_API + /* Define if the target supports branch tracing. */ #undef HAVE_LINUX_BTRACE diff --git a/gdbserver/configure b/gdbserver/configure index aab72c0b8c5..e8265116c8c 100755 --- a/gdbserver/configure +++ b/gdbserver/configure @@ -656,6 +656,9 @@ am__leading_dot host_noncanonical target_noncanonical WIN32APILIBS +LTLIBOPENCSD_C_API +LIBOPENCSD_C_API +HAVE_LIBOPENCSD_C_API LTLIBIPT LIBIPT HAVE_LIBIPT @@ -751,6 +754,9 @@ with_gnu_ld enable_rpath with_libipt_prefix with_libipt_type +with_arm_cs +with_libopencsd_c_api_prefix +with_libopencsd_c_api_type enable_unit_tests with_ust with_ust_include @@ -1415,6 +1421,11 @@ Optional Packages: --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 --with-libipt-type=TYPE type of library to search for (auto/static/shared) + --with-arm-cs include ARM CoreSight Processor Trace support + (auto/yes/no) + --with-libopencsd_c_api-prefix[=DIR] search for libopencsd_c_api in DIR/include and DIR/lib + --without-libopencsd_c_api-prefix don't search for libopencsd_c_api in includedir and libdir + --with-libopencsd_c_api-type=TYPE type of library to search for (auto/static/shared) --with-ust=PATH Specify prefix directory for the installed UST package Equivalent to --with-ust-include=PATH/include plus --with-ust-lib=PATH/lib @@ -8549,6 +8560,540 @@ fi fi fi + # ARM CoreSight trace # + + +# Check whether --with-arm_cs was given. +if test "${with_arm_cs+set}" = set; then : + withval=$with_arm_cs; +else + with_arm_cs=auto +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use ARM CoreSight Processor Trace " >&5 +$as_echo_n "checking whether to use ARM CoreSight Processor Trace ... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_arm_cs" >&5 +$as_echo "$with_arm_cs" >&6; } + + if test "${with_arm_cs}" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ARM CoreSight Processor Trace support disabled; CoreSight Tracing will be unavailable." >&5 +$as_echo "$as_me: WARNING: ARM CoreSight Processor Trace support disabled; CoreSight Tracing will be unavailable." >&2;} + HAVE_LIBOPENCSD=no + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef PERF_ATTR_SIZE_VER5 + # error + #endif + +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + perf_event=yes +else + perf_event=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext + if test "$perf_event" != yes; then + if test "$with_arm_cs" = 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; CoreSight Tracing will be unavailable." >&5 +$as_echo "$as_me: WARNING: linux/perf_event.h missing or too old; CoreSight Tracing will be unavailable." >&2;} + fi + fi + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libopencsd_c_api-prefix was given. +if test "${with_libopencsd_c_api_prefix+set}" = set; then : + withval=$with_libopencsd_c_api_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + +fi + + +# Check whether --with-libopencsd_c_api-type was given. +if test "${with_libopencsd_c_api_type+set}" = set; then : + withval=$with_libopencsd_c_api_type; with_libopencsd_c_api_type=$withval +else + with_libopencsd_c_api_type=auto +fi + + lib_type=`eval echo \$with_libopencsd_c_api_type` + + LIBOPENCSD_C_API= + LTLIBOPENCSD_C_API= + INCOPENCSD_C_API= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='opencsd_c_api ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext" && test x$lib_type != xstatic; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + elif test x$lib_type != xshared; then + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBOPENCSD_C_API; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext" && test x$lib_type != xstatic; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + elif test x$lib_type != xshared; then + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBOPENCSD_C_API; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$found_so" + else + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$found_a" + else + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCOPENCSD_C_API; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCOPENCSD_C_API="${INCOPENCSD_C_API}${INCOPENCSD_C_API:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBOPENCSD_C_API; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBOPENCSD_C_API; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$dep" + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }$dep" + ;; + esac + done + fi + else + if test "x$lib_type" = "xauto" || test "x$lib_type" = "xshared"; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-l$name" + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }-l$name" + else + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-l:lib$name.$libext" + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }-l:lib$name.$libext" + fi + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }-R$found_dir" + done + fi + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCOPENCSD_C_API; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libopencsd_c_api" >&5 +$as_echo_n "checking for libopencsd_c_api... " >&6; } +if ${ac_cv_libopencsd_c_api+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIBOPENCSD_C_API" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "opencsd/c_api/opencsd_c_api.h" +int +main () +{ +ocsd_get_version(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_libopencsd_c_api=yes +else + ac_cv_libopencsd_c_api=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libopencsd_c_api" >&5 +$as_echo "$ac_cv_libopencsd_c_api" >&6; } + if test "$ac_cv_libopencsd_c_api" = yes; then + HAVE_LIBOPENCSD_C_API=yes + +$as_echo "#define HAVE_LIBOPENCSD_C_API 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libopencsd_c_api" >&5 +$as_echo_n "checking how to link with libopencsd_c_api... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBOPENCSD_C_API" >&5 +$as_echo "$LIBOPENCSD_C_API" >&6; } + else + HAVE_LIBOPENCSD_C_API=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBOPENCSD_C_API= + LTLIBOPENCSD_C_API= + fi + + + + + + + if test "$HAVE_LIBOPENCSD_C_API" != yes; then + if test "$with_arm_cs" = yes; then + as_fn_error $? "libopencsd_c_api is missing or unusable" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libopencsd_c_api is missing or unusable; CoreSight Tracing will be unavailable." >&5 +$as_echo "$as_me: WARNING: libopencsd_c_api is missing or unusable; CoreSight Tracing will be unavailable." >&2;} + fi + else + LIBS="$LIBS $LIBOPENCSD_C_API" + fi + fi + + $as_echo "#define _STRUCTURED_PROC 1" >>confdefs.h diff --git a/gdbsupport/Makefile.in b/gdbsupport/Makefile.in index d7f2d4914b0..cdb7ba2f0ac 100644 --- a/gdbsupport/Makefile.in +++ b/gdbsupport/Makefile.in @@ -250,6 +250,7 @@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_LIBIPT = @HAVE_LIBIPT@ +HAVE_LIBOPENCSD_C_API = @HAVE_LIBOPENCSD_C_API@ INCINTL = @INCINTL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -263,9 +264,11 @@ LIBINTL = @LIBINTL@ LIBINTL_DEP = @LIBINTL_DEP@ LIBIPT = @LIBIPT@ LIBOBJS = @LIBOBJS@ +LIBOPENCSD_C_API = @LIBOPENCSD_C_API@ LIBS = @LIBS@ LTLIBIPT = @LTLIBIPT@ LTLIBOBJS = @LTLIBOBJS@ +LTLIBOPENCSD_C_API = @LTLIBOPENCSD_C_API@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4 index 2e709dbbdbb..856fb9bc31b 100644 --- a/gdbsupport/common.m4 +++ b/gdbsupport/common.m4 @@ -163,6 +163,45 @@ AC_DEFUN([GDB_AC_COMMON], [ fi fi + # ARM CoreSight trace # + + AC_ARG_WITH(arm_cs, + AS_HELP_STRING([--with-arm-cs], [include ARM CoreSight Processor Trace support (auto/yes/no)]), + [], [with_arm_cs=auto]) + AC_MSG_CHECKING([whether to use ARM CoreSight Processor Trace ]) + AC_MSG_RESULT([$with_arm_cs]) + + if test "${with_arm_cs}" = no; then + AC_MSG_WARN([ARM CoreSight Processor Trace support disabled; CoreSight Tracing will be unavailable.]) + HAVE_LIBOPENCSD=no + else + AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ + #include + #ifndef PERF_ATTR_SIZE_VER5 + # error + #endif + ]])], [perf_event=yes], [perf_event=no]) + if test "$perf_event" != yes; then + if test "$with_arm_cs" = 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; CoreSight Tracing will be unavailable.]) + fi + fi + + AC_LIB_HAVE_LINKFLAGS([opencsd_c_api], [], [#include "opencsd/c_api/opencsd_c_api.h"], [ocsd_get_version();]) + if test "$HAVE_LIBOPENCSD_C_API" != yes; then + if test "$with_arm_cs" = yes; then + AC_MSG_ERROR([libopencsd_c_api is missing or unusable]) + else + AC_MSG_WARN([libopencsd_c_api is missing or unusable; CoreSight Tracing will be unavailable.]) + fi + else + LIBS="$LIBS $LIBOPENCSD_C_API" + fi + fi + + BFD_SYS_PROCFS_H if test "$ac_cv_header_sys_procfs_h" = yes; then BFD_HAVE_SYS_PROCFS_TYPE(gregset_t) diff --git a/gdbsupport/config.in b/gdbsupport/config.in index c44a2a1e5de..2259ada7fdb 100644 --- a/gdbsupport/config.in +++ b/gdbsupport/config.in @@ -117,6 +117,9 @@ /* Define if you have the ipt library. */ #undef HAVE_LIBIPT +/* Define if you have the opencsd_c_api library. */ +#undef HAVE_LIBOPENCSD_C_API + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_ELF_H diff --git a/gdbsupport/configure b/gdbsupport/configure index 60643c80b5a..08bc0e6a86d 100755 --- a/gdbsupport/configure +++ b/gdbsupport/configure @@ -628,6 +628,9 @@ WERROR_CFLAGS WARN_CFLAGS SELFTEST_FALSE SELFTEST_TRUE +LTLIBOPENCSD_C_API +LIBOPENCSD_C_API +HAVE_LIBOPENCSD_C_API LTLIBIPT LIBIPT HAVE_LIBIPT @@ -772,6 +775,9 @@ with_gnu_ld enable_rpath with_libipt_prefix with_libipt_type +with_arm_cs +with_libopencsd_c_api_prefix +with_libopencsd_c_api_type enable_unit_tests enable_werror enable_build_warnings @@ -1436,6 +1442,11 @@ Optional Packages: --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 --with-libipt-type=TYPE type of library to search for (auto/static/shared) + --with-arm-cs include ARM CoreSight Processor Trace support + (auto/yes/no) + --with-libopencsd_c_api-prefix[=DIR] search for libopencsd_c_api in DIR/include and DIR/lib + --without-libopencsd_c_api-prefix don't search for libopencsd_c_api in includedir and libdir + --with-libopencsd_c_api-type=TYPE type of library to search for (auto/static/shared) Some influential environment variables: CC C compiler command @@ -9563,6 +9574,540 @@ fi fi fi + # ARM CoreSight trace # + + +# Check whether --with-arm_cs was given. +if test "${with_arm_cs+set}" = set; then : + withval=$with_arm_cs; +else + with_arm_cs=auto +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use ARM CoreSight Processor Trace " >&5 +$as_echo_n "checking whether to use ARM CoreSight Processor Trace ... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_arm_cs" >&5 +$as_echo "$with_arm_cs" >&6; } + + if test "${with_arm_cs}" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ARM CoreSight Processor Trace support disabled; CoreSight Tracing will be unavailable." >&5 +$as_echo "$as_me: WARNING: ARM CoreSight Processor Trace support disabled; CoreSight Tracing will be unavailable." >&2;} + HAVE_LIBOPENCSD=no + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef PERF_ATTR_SIZE_VER5 + # error + #endif + +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + perf_event=yes +else + perf_event=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext + if test "$perf_event" != yes; then + if test "$with_arm_cs" = 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; CoreSight Tracing will be unavailable." >&5 +$as_echo "$as_me: WARNING: linux/perf_event.h missing or too old; CoreSight Tracing will be unavailable." >&2;} + fi + fi + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libopencsd_c_api-prefix was given. +if test "${with_libopencsd_c_api_prefix+set}" = set; then : + withval=$with_libopencsd_c_api_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + +fi + + +# Check whether --with-libopencsd_c_api-type was given. +if test "${with_libopencsd_c_api_type+set}" = set; then : + withval=$with_libopencsd_c_api_type; with_libopencsd_c_api_type=$withval +else + with_libopencsd_c_api_type=auto +fi + + lib_type=`eval echo \$with_libopencsd_c_api_type` + + LIBOPENCSD_C_API= + LTLIBOPENCSD_C_API= + INCOPENCSD_C_API= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='opencsd_c_api ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext" && test x$lib_type != xstatic; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + elif test x$lib_type != xshared; then + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBOPENCSD_C_API; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext" && test x$lib_type != xstatic; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + elif test x$lib_type != xshared; then + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBOPENCSD_C_API; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$found_so" + else + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$found_a" + else + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCOPENCSD_C_API; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCOPENCSD_C_API="${INCOPENCSD_C_API}${INCOPENCSD_C_API:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBOPENCSD_C_API; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBOPENCSD_C_API; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$dep" + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }$dep" + ;; + esac + done + fi + else + if test "x$lib_type" = "xauto" || test "x$lib_type" = "xshared"; then + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-l$name" + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }-l$name" + else + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }-l:lib$name.$libext" + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }-l:lib$name.$libext" + fi + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBOPENCSD_C_API="${LIBOPENCSD_C_API}${LIBOPENCSD_C_API:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBOPENCSD_C_API="${LTLIBOPENCSD_C_API}${LTLIBOPENCSD_C_API:+ }-R$found_dir" + done + fi + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCOPENCSD_C_API; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libopencsd_c_api" >&5 +$as_echo_n "checking for libopencsd_c_api... " >&6; } +if ${ac_cv_libopencsd_c_api+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIBOPENCSD_C_API" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "opencsd/c_api/opencsd_c_api.h" +int +main () +{ +ocsd_get_version(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_libopencsd_c_api=yes +else + ac_cv_libopencsd_c_api=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libopencsd_c_api" >&5 +$as_echo "$ac_cv_libopencsd_c_api" >&6; } + if test "$ac_cv_libopencsd_c_api" = yes; then + HAVE_LIBOPENCSD_C_API=yes + +$as_echo "#define HAVE_LIBOPENCSD_C_API 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libopencsd_c_api" >&5 +$as_echo_n "checking how to link with libopencsd_c_api... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBOPENCSD_C_API" >&5 +$as_echo "$LIBOPENCSD_C_API" >&6; } + else + HAVE_LIBOPENCSD_C_API=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBOPENCSD_C_API= + LTLIBOPENCSD_C_API= + fi + + + + + + + if test "$HAVE_LIBOPENCSD_C_API" != yes; then + if test "$with_arm_cs" = yes; then + as_fn_error $? "libopencsd_c_api is missing or unusable" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libopencsd_c_api is missing or unusable; CoreSight Tracing will be unavailable." >&5 +$as_echo "$as_me: WARNING: libopencsd_c_api is missing or unusable; CoreSight Tracing will be unavailable." >&2;} + fi + else + LIBS="$LIBS $LIBOPENCSD_C_API" + fi + fi + + $as_echo "#define _STRUCTURED_PROC 1" >>confdefs.h -- 2.25.1