Re: [PATCH] gcc: add --enable-systemtap switch [PR61257]

2022-05-24 Thread Eric Gallager via Gcc-patches
On Mon, Mar 14, 2022 at 10:13 AM Jakub Jelinek via Gcc-patches
 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
>


Re: [PATCH] gcc: add --enable-systemtap switch [PR61257]

2022-03-14 Thread Jakub Jelinek via 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



Re: [PATCH] gcc: add --enable-systemtap switch [PR61257]

2022-03-14 Thread Marek Polacek via 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  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



[PATCH] gcc: add --enable-systemtap switch [PR61257]

2022-03-14 Thread David Seifert via Gcc-patches
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  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