public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] gcc: add --enable-systemtap switch [PR61257]
@ 2022-03-14 12:48 David Seifert
  2022-03-14 13:26 ` Marek Polacek
  0 siblings, 1 reply; 4+ messages in thread
From: David Seifert @ 2022-03-14 12:48 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Seifert

Bug: https://bugs.gentoo.org/654748

gcc/configure.ac
        * Add --enable-systemtap switch to explicitly allow for
        disabling systemtap even if the target libc supports it.
---
 gcc/configure.ac | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/gcc/configure.ac b/gcc/configure.ac
index 90cad309762..7dfb9a58cdd 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -6904,14 +6904,24 @@ AC_SUBST([enable_default_ssp])
 
 # Test for <sys/sdt.h> on the target.
 GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
-AC_MSG_CHECKING(sys/sdt.h in the target C library)
-have_sys_sdt_h=no
-if test -f $target_header_dir/sys/sdt.h; then
-  have_sys_sdt_h=yes
-  AC_DEFINE(HAVE_SYS_SDT_H, 1,
-            [Define if your target C library provides sys/sdt.h])
-fi
-AC_MSG_RESULT($have_sys_sdt_h)
+
+AC_ARG_ENABLE([systemtap],
+  [AS_HELP_STRING([--enable-systemtap],
+    [enable systemtap static probe points [default=auto]])])
+
+AS_IF([test x$enable_systemtap != xno], [
+  AC_MSG_CHECKING([sys/sdt.h in the target C library])
+  have_sys_sdt_h=no
+  AS_IF([test -f "$target_header_dir/sys/sdt.h"], [
+    have_sys_sdt_h=yes
+    AC_DEFINE([HAVE_SYS_SDT_H], [1],
+              [Define if your target C library provides sys/sdt.h])
+  ])
+  AC_MSG_RESULT([$have_sys_sdt_h])
+  AS_IF([test x$enable_systemtap = xyes && test x$have_sys_sdt_h = xno], [
+    AC_MSG_ERROR([sys/sdt.h was not found])
+  ])
+])
 
 # Check if TFmode long double should be used by default or not.
 # Some glibc targets used DFmode long double, but with glibc 2.4
-- 
2.35.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gcc: add --enable-systemtap switch [PR61257]
  2022-03-14 12:48 [PATCH] gcc: add --enable-systemtap switch [PR61257] David Seifert
@ 2022-03-14 13:26 ` Marek Polacek
  2022-03-14 14:12   ` Jakub Jelinek
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Polacek @ 2022-03-14 13:26 UTC (permalink / raw)
  To: David Seifert; +Cc: gcc-patches

On Mon, Mar 14, 2022 at 01:48:21PM +0100, David Seifert via Gcc-patches wrote:
> Bug: https://bugs.gentoo.org/654748
> 
> gcc/configure.ac
>         * Add --enable-systemtap switch to explicitly allow for
>         disabling systemtap even if the target libc supports it.
> ---
>  gcc/configure.ac | 26 ++++++++++++++++++--------
>  1 file changed, 18 insertions(+), 8 deletions(-)
> 
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index 90cad309762..7dfb9a58cdd 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -6904,14 +6904,24 @@ AC_SUBST([enable_default_ssp])
>  
>  # Test for <sys/sdt.h> on the target.
>  GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
> -AC_MSG_CHECKING(sys/sdt.h in the target C library)
> -have_sys_sdt_h=no
> -if test -f $target_header_dir/sys/sdt.h; then
> -  have_sys_sdt_h=yes
> -  AC_DEFINE(HAVE_SYS_SDT_H, 1,
> -            [Define if your target C library provides sys/sdt.h])
> -fi
> -AC_MSG_RESULT($have_sys_sdt_h)
> +
> +AC_ARG_ENABLE([systemtap],
> +  [AS_HELP_STRING([--enable-systemtap],
> +    [enable systemtap static probe points [default=auto]])])
> +
> +AS_IF([test x$enable_systemtap != xno], [
> +  AC_MSG_CHECKING([sys/sdt.h in the target C library])
> +  have_sys_sdt_h=no
> +  AS_IF([test -f "$target_header_dir/sys/sdt.h"], [
> +    have_sys_sdt_h=yes
> +    AC_DEFINE([HAVE_SYS_SDT_H], [1],
> +              [Define if your target C library provides sys/sdt.h])
> +  ])
> +  AC_MSG_RESULT([$have_sys_sdt_h])
> +  AS_IF([test x$enable_systemtap = xyes && test x$have_sys_sdt_h = xno], [
> +    AC_MSG_ERROR([sys/sdt.h was not found])
> +  ])
> +])

Thanks for the patch.

The new configure option needs documenting in doc/install.texi, and configure
needs to be regenerated.

Marek


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gcc: add --enable-systemtap switch [PR61257]
  2022-03-14 13:26 ` Marek Polacek
@ 2022-03-14 14:12   ` Jakub Jelinek
  2022-05-24 14:47     ` Eric Gallager
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2022-03-14 14:12 UTC (permalink / raw)
  To: Marek Polacek; +Cc: David Seifert, gcc-patches

On Mon, Mar 14, 2022 at 09:26:57AM -0400, Marek Polacek via Gcc-patches wrote:
> Thanks for the patch.
> 
> The new configure option needs documenting in doc/install.texi, and configure
> needs to be regenerated.

More importantly, I don't see explanation why the patch is needed, analysis
why did the HAVE_SYS_SDT_H configure check say that the header exists but
trying to include it in libgcc doesn't.

	Jakub


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gcc: add --enable-systemtap switch [PR61257]
  2022-03-14 14:12   ` Jakub Jelinek
@ 2022-05-24 14:47     ` Eric Gallager
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Gallager @ 2022-05-24 14:47 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Marek Polacek, David Seifert, gcc-patches

On Mon, Mar 14, 2022 at 10:13 AM Jakub Jelinek via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Mon, Mar 14, 2022 at 09:26:57AM -0400, Marek Polacek via Gcc-patches wrote:
> > Thanks for the patch.
> >
> > The new configure option needs documenting in doc/install.texi, and configure
> > needs to be regenerated.
>
> More importantly, I don't see explanation why the patch is needed,

The patch was requested in bug 61257:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61257

> analysis why did the HAVE_SYS_SDT_H configure check say that the header
> exists but trying to include it in libgcc doesn't.
>
>         Jakub
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-24 14:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14 12:48 [PATCH] gcc: add --enable-systemtap switch [PR61257] David Seifert
2022-03-14 13:26 ` Marek Polacek
2022-03-14 14:12   ` Jakub Jelinek
2022-05-24 14:47     ` Eric Gallager

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).