public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] gcc/configure.ac: add --disable-systemtap switch
@ 2018-05-12 17:37 Sergei Trofimovich via gcc-patches
  2018-05-14 17:40 ` Joseph Myers
  2018-05-24 22:35 ` Jeff Law
  0 siblings, 2 replies; 4+ messages in thread
From: Sergei Trofimovich via gcc-patches @ 2018-05-12 17:37 UTC (permalink / raw)
  To: Gcc Patch List; +Cc: Sergei Trofimovich

From: Sergei Trofimovich <slyfox@gentoo.org>

Before the change systemtap probes were enabled
if target headers had sys/sdt.h at ./configure time.

After the change explicitly ask to enable or disable
for probe support and not rely on automagic dependency
discovery.

Bug: https://bugs.gentoo.org/654748
Bug: https://gcc.gnu.org/bugzilla/PR61257
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
 gcc/configure    | 34 ++++++++++++++++++++++++++--------
 gcc/configure.ac | 30 ++++++++++++++++++++++--------
 2 files changed, 48 insertions(+), 16 deletions(-)

diff --git a/gcc/configure b/gcc/configure
index 7d69faf549d..5e96c4f99fc 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -946,6 +946,7 @@ enable_gnu_unique_object
 enable_linker_build_id
 enable_libssp
 enable_default_ssp
+enable_systemtap
 with_long_double_128
 with_long_double_format
 with_gc
@@ -1688,6 +1689,7 @@ Optional Features:
                           compiler will always pass --build-id to linker
   --enable-libssp         enable linking against libssp
   --enable-default-ssp    enable Stack Smashing Protection as default
+  --disable-systemtap     enable systemtap static probe points [default=auto]
   --enable-maintainer-mode
                           enable make rules and dependencies not useful (and
                           sometimes confusing) to the casual installer
@@ -18448,7 +18450,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18451 "configure"
+#line 18453 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18554,7 +18556,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18557 "configure"
+#line 18559 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -29297,17 +29299,33 @@ fi
 
 # Test for <sys/sdt.h> on the target.
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
+
+# Check whether --enable-systemtap was given.
+if test "${enable_systemtap+set}" = set; then :
+  enableval=$enable_systemtap; enable_systemtap=$enableval
+else
+  enable_systemtap=auto
+fi
+
+
+if test x$enable_systemtap != xno; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
 $as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
-have_sys_sdt_h=no
-if test -f $target_header_dir/sys/sdt.h; then
-  have_sys_sdt_h=yes
+  have_sys_sdt_h=no
+  if test -f $target_header_dir/sys/sdt.h ; then
+    have_sys_sdt_h=yes
 
 $as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
 $as_echo "$have_sys_sdt_h" >&6; }
+  if test x$enable_systemtap = xyes ; then
+    if test x$have_sys_sdt_h = xno ; then
+      as_fn_error "sys/sdt.h was not found" "$LINENO" 5
+    fi
+  fi
+fi
 
 # Check if TFmode long double should be used by default or not.
 # Some glibc targets used DFmode long double, but with glibc 2.4
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 36124b8ce90..8356e579a20 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -5965,14 +5965,28 @@ 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([--disable-systemtap],
+  [enable systemtap static probe points [default=auto]])],
+      enable_systemtap=$enableval,
+      enable_systemtap=auto)
+
+if test x$enable_systemtap != xno; then
+  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)
+  if test x$enable_systemtap = xyes ; then
+    if test x$have_sys_sdt_h = xno ; then
+      AC_MSG_ERROR([sys/sdt.h was not found])
+    fi
+  fi
+fi
 
 # 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.17.0

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

* Re: [PATCH] gcc/configure.ac: add --disable-systemtap switch
  2018-05-12 17:37 [PATCH] gcc/configure.ac: add --disable-systemtap switch Sergei Trofimovich via gcc-patches
@ 2018-05-14 17:40 ` Joseph Myers
  2018-05-24 22:35 ` Jeff Law
  1 sibling, 0 replies; 4+ messages in thread
From: Joseph Myers @ 2018-05-14 17:40 UTC (permalink / raw)
  To: Sergei Trofimovich; +Cc: Gcc Patch List, Sergei Trofimovich

Any new configure options need to be documented in install.texi.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH] gcc/configure.ac: add --disable-systemtap switch
  2018-05-12 17:37 [PATCH] gcc/configure.ac: add --disable-systemtap switch Sergei Trofimovich via gcc-patches
  2018-05-14 17:40 ` Joseph Myers
@ 2018-05-24 22:35 ` Jeff Law
  2018-05-25 14:02   ` Eric Gallager
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff Law @ 2018-05-24 22:35 UTC (permalink / raw)
  To: Sergei Trofimovich, Gcc Patch List; +Cc: Sergei Trofimovich

On 05/12/2018 08:00 AM, Sergei Trofimovich via gcc-patches wrote:
> From: Sergei Trofimovich <slyfox@gentoo.org>
> 
> Before the change systemtap probes were enabled
> if target headers had sys/sdt.h at ./configure time.
> 
> After the change explicitly ask to enable or disable
> for probe support and not rely on automagic dependency
> discovery.
I'm not terribly concerned about the uninstalling systemtap while
compiling gcc problem.   That seems like a package management problem on
the distro side.

61257 does raise the issue of header file usability which is a much
bigger concern.  c#1 indicates autoconf-2.70 introduces code which
instead of testing for header file existence instead checks for
usability.  So I'd rather see us moving towards making that happen
rather than explicit enable/disable of systemtap headers/probes.

jeff

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

* Re: [PATCH] gcc/configure.ac: add --disable-systemtap switch
  2018-05-24 22:35 ` Jeff Law
@ 2018-05-25 14:02   ` Eric Gallager
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Gallager @ 2018-05-25 14:02 UTC (permalink / raw)
  To: Jeff Law; +Cc: Sergei Trofimovich, Gcc Patch List, Sergei Trofimovich

On 5/24/18, Jeff Law <law@redhat.com> wrote:
> On 05/12/2018 08:00 AM, Sergei Trofimovich via gcc-patches wrote:
>> From: Sergei Trofimovich <slyfox@gentoo.org>
>>
>> Before the change systemtap probes were enabled
>> if target headers had sys/sdt.h at ./configure time.
>>
>> After the change explicitly ask to enable or disable
>> for probe support and not rely on automagic dependency
>> discovery.
> I'm not terribly concerned about the uninstalling systemtap while
> compiling gcc problem.   That seems like a package management problem on
> the distro side.
>
> 61257 does raise the issue of header file usability which is a much
> bigger concern.  c#1 indicates autoconf-2.70 introduces code which
> instead of testing for header file existence instead checks for
> usability.  So I'd rather see us moving towards making that happen
> rather than explicit enable/disable of systemtap headers/probes.
>
> jeff
>

I retracted c#1 in c#4. What autoconf-2.70 changes is how the
AC_CHECK_HEADERS macro is expanded. In current versions of autoconf,
AC_CHECK_HEADERS checks for header file usability, presence, and
existence, but allows the latter 2 to override the usability check. In
autoconf-2.70, however, AC_CHECK_HEADERS will *only* do the usability
check. However, after looking at the code in question, I found that
AC_CHECK_HEADERS is not even used here, but rather it just does `test
-f`. Thus the autoconf-2.70 changes won't automatically fix anything,
since `test -f` is at the shellcode level rather than the m4 level. So
we don't need to wait for it to be released, and probably shouldn't
anyways, considering how many years its release has been pending.

Eric

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

end of thread, other threads:[~2018-05-25 13:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-12 17:37 [PATCH] gcc/configure.ac: add --disable-systemtap switch Sergei Trofimovich via gcc-patches
2018-05-14 17:40 ` Joseph Myers
2018-05-24 22:35 ` Jeff Law
2018-05-25 14:02   ` 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).