From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nx224.node01.secure-mailgate.com (nx224.node01.secure-mailgate.com [89.22.108.224]) by sourceware.org (Postfix) with ESMTPS id D131E384B808 for ; Thu, 11 Mar 2021 02:51:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D131E384B808 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 node01.secure-mailgate.com with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1lKBPj-00F5HU-1Y for gdb-patches@sourceware.org; Thu, 11 Mar 2021 03:51:03 +0100 X-SecureMailgate-Identity: host202.checkdomain.de Received: from Trande0001.fritz.box (x4db421df.dyn.telefonica.de [77.180.33.223]) (Authenticated sender: zied.guermazi@trande.de) by host202.checkdomain.de (Postfix) with ESMTPSA id 415432A2211; Thu, 11 Mar 2021 03:51:02 +0100 (CET) X-SecureMailgate-Identity: host202.checkdomain.de From: Zied Guermazi To: gdb-patches@sourceware.org Cc: Zied Guermazi Subject: [PATCH v2 1/8] configure gdb build system for supporting btrace on arm processors Date: Thu, 11 Mar 2021 03:50:32 +0100 Message-Id: <20210311025039.57112-2-zied.guermazi@trande.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210311025039.57112-1-zied.guermazi@trande.de> References: <20210311025039.57112-1-zied.guermazi@trande.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-PPP-Message-ID: <20210311025102.3191974.61240@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 (3.22745658953e-05) X-Recommended-Action: accept X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT/Ugfi4UrKax91Ckl5xswN9PUtbdvnXkggZ 3YnVId/Y5jcf0yeVQAvfjHznO7+bT5wgSQOko5ya3orWH1MkzQXa2oPZqVS5i0KNMNtVCi0tRw/C h5SE4jAyhe1COeASyU9FBBlF2TCLXbr4lwsyDVOe5WCy5VkstzhnxgTXqsdmp3A0NH/6iljXi3jy DmD40ddQQhQ3cXtTqZg6zYv+9efsqr/s5zF19+UXUogLDrjW+YlBQocFPxBPK5u69qs1KHSDwIE7 VKe+bqpcdCns72R1C8W9Qv5Ob6hMlioou5xNe3JXHWitmq7s0hPA8SBD/xqcmuBJwe36CN1gwFhC KkEevvsTbUnBm4eP/gSAGzl23zQs97AdIVve+jKtF/zYjiQj/uhxevoI3QdrXqZXgzUSeFCgjm3k HTZZa/hYJaCZ8ZhFXLQmsoZNrSfnDL2e/fg2rRldRnnnohbUS3YD3JmeBSvj/5nWFRTIoiZn7WWk OKOaJL2HnhdW7wc2yJ7rwfs6rDn0tTOVcmJwqI8Ju2neEVBannnL7tRRK/uB8nvA5f9YHKhbAqA3 sOZGg6FORQB+mBa4cVcOYt9AmTHtPiSq2Wq2InZGQXRwgp4DivepysN6jYX/nXkLyQnRCh0nB+uY UazmWajDqA7NT8Js52zSASJFC/49WOPBr5nlEUI4xEN0aDQkpuyycSB2ujilFJKCd5iXYJuZDVz9 Fg6INCqeOZHEorRW8eD+R4l5jQo+2B9GSV21bpzNDcWn73QgfqmbkymvE2zapBzDzNo6mjLLLPde C2osMQ2uc367tvJ8uqBlkBL2blkAqDWoat5k50UTrk9wwq6nH7z/b3gCyLA3OYyHnLaieaTHu47N QK6DG441w9kXmQx3njZC1mM/Sy0fLTFd+45UpByl/LWN4iHJwD/3EaCPu1onFa0dn3u5ihBk5esg nrjfJcDjFNArNy1sYzB6zs3Ie5gF1CN3Vi14yJ4ss/5Hs2w3TS6AS3W+Y1Rduek4Axj+tKuWrB15 fu7eNHk15VolAGHS5rCXQKDygoYFPq0OTYX5+iNtRMfoAGKrYNH+EMhzOGacfQYLNb82O0vPa9+l bdeuoMpR7RbWK0qQ84xLY31/Pjh5eHMlOn5gPT+ycveMURJ69oZoA+A= X-Report-Abuse-To: spam@node04.secure-mailgate.com X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_LINEPADDING, RCVD_IN_BARRACUDACENTRAL, 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: Thu, 11 Mar 2021 02:51:12 -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: undefine it if libopenocsd library is available. * 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/ChangeLog | 11 + gdb/Makefile.in | 5 +- gdb/config.in | 3 + gdb/configure | 545 +++++++++++++++++++++++++++++++++++++++++ gdb/configure.nat | 4 +- gdb/top.c | 10 +- gdbserver/ChangeLog | 4 + gdbserver/config.in | 3 + gdbserver/configure | 545 +++++++++++++++++++++++++++++++++++++++++ gdbsupport/ChangeLog | 6 + gdbsupport/Makefile.in | 3 + gdbsupport/common.m4 | 39 +++ gdbsupport/config.in | 3 + gdbsupport/configure | 545 +++++++++++++++++++++++++++++++++++++++++ 14 files changed, 1722 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2ca7d3c6a05..7178c30affb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2021-02-25 Zied Guermazi + + * Makefile.in LIBOPENCSD_C_API: set the flag. + * config.in LIBOPENCSD_C_API: undefine it if + libopenocsd library is available. + * 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. + 2021-02-24 Tom de Vries PR symtab/27336 diff --git a/gdb/Makefile.in b/gdb/Makefile.in index ae89b85eb56..9120f4fa958 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 14a77c661d5..8777899dd06 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -247,6 +247,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 51b4d1921c5..b073f66a7a8 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_included_regex with_sysroot with_system_gdbinit @@ -1661,6 +1667,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) --without-included-regex don't use included regex; this is the default on systems with version 2 of the GNU C library (use @@ -15317,6 +15328,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 286975966da..c17b6697b05 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" ;; arc) @@ -245,7 +245,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 3be95079654..a5aab3202c5 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -1526,7 +1526,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/ChangeLog b/gdbserver/ChangeLog index 0e713cc6abb..bafdc7685c3 100644 --- a/gdbserver/ChangeLog +++ b/gdbserver/ChangeLog @@ -1,3 +1,7 @@ +2021-02-01 Zied Guermazi + + * gdbserver/configure: Regenerated. + 2021-02-23 Simon Marchi * linux-low.cc (linux_process_target::filter_event): Return diff --git a/gdbserver/config.in b/gdbserver/config.in index 99391b4acff..7871c6faa32 100644 --- a/gdbserver/config.in +++ b/gdbserver/config.in @@ -143,6 +143,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 0db0ad3f4fb..e57cfebfb5c 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 @@ -8623,6 +8634,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/ChangeLog b/gdbsupport/ChangeLog index c8fa9e73148..f27b57c2fa9 100644 --- a/gdbsupport/ChangeLog +++ b/gdbsupport/ChangeLog @@ -1,3 +1,9 @@ +2021-02-25 Zied Guermazi + + * gdbsupport/common.m4: check --with-arm-cs configuration + flag, perf_event and opencsd_c_api to set compilation flags. + * gdbsupport/configure: Regenerated + 2021-02-05 Paul E. Murphy * common-defs.h (ATTRIBUTE_PRINTF): Rename diff --git a/gdbsupport/Makefile.in b/gdbsupport/Makefile.in index c47b2004996..6f49cf46b00 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 3ed95dabc85..4a5f82a61b2 100644 --- a/gdbsupport/common.m4 +++ b/gdbsupport/common.m4 @@ -186,6 +186,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 ecc6fa559f7..a4ff12e772a 100644 --- a/gdbsupport/config.in +++ b/gdbsupport/config.in @@ -121,6 +121,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 9c5e59c5f10..939be79b824 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 @@ -9637,6 +9648,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