bpf: do not --enable-gcov for bpf-*-* targets
authorJose E. Marchesi <jose.marchesi@oracle.com>
Wed, 23 Feb 2022 19:48:30 +0000 (20:48 +0100)
committerJose E. Marchesi <jose.marchesi@oracle.com>
Thu, 24 Feb 2022 15:43:57 +0000 (16:43 +0100)
This patch changes the build machinery in order to disable the build
of GCOV (both compiler and libgcc) in bpf-*-* targets.  The reason for
this change is that BPF is (currently) too restricted in order to
support the coverage instrumentalization.

Tested in bpf-unknown-none and x86_64-linux-gnu targets.

2022-02-23  Jose E. Marchesi  <jose.marchesi@oracle.com>

gcc/ChangeLog

PR target/104656
* configure.ac: --disable-gcov if targetting bpf-*.
* configure: Regenerate.

libgcc/ChangeLog

PR target/104656
* configure.ac: --disable-gcov if targetting bpf-*.
* configure: Regenerate.

gcc/configure
gcc/configure.ac
libgcc/configure
libgcc/configure.ac

index 258b17a..22eb345 100755 (executable)
@@ -8085,12 +8085,20 @@ fi
 if test "${enable_gcov+set}" = set; then :
   enableval=$enable_gcov;
 else
-  enable_gcov=yes
+  case $target in
+       bpf-*-*)
+         enable_gcov=no
+       ;;
+       *)
+         enable_gcov=yes
+       ;;
+     esac
 fi
 
 
 
 
+
 # Check whether --with-specs was given.
 if test "${with_specs+set}" = set; then :
   withval=$with_specs; CONFIGURE_SPECS=$withval
@@ -19659,7 +19667,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19662 "configure"
+#line 19670 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19765,7 +19773,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19768 "configure"
+#line 19776 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index 06750ce..20da909 100644 (file)
@@ -1041,7 +1041,15 @@ AC_SUBST(enable_shared)
 
 AC_ARG_ENABLE(gcov,
 [  --disable-gcov          don't provide libgcov and related host tools],
-[], [enable_gcov=yes])
+[], [case $target in
+       bpf-*-*)
+         enable_gcov=no
+       ;;
+       *)
+         enable_gcov=yes
+       ;;
+     esac])
+
 AC_SUBST(enable_gcov)
 
 AC_ARG_WITH(specs,
index 4919a56..52bf25d 100755 (executable)
@@ -630,6 +630,7 @@ LIPO
 AR
 toolexeclibdir
 toolexecdir
+enable_gcov
 target_subdir
 host_subdir
 build_subdir
@@ -653,7 +654,6 @@ build_cpu
 build
 with_aix_soname
 enable_vtable_verify
-enable_gcov
 enable_shared
 libgcc_topdir
 target_alias
@@ -701,7 +701,6 @@ with_target_subdir
 with_cross_host
 with_ld
 enable_shared
-enable_gcov
 enable_vtable_verify
 with_aix_soname
 enable_version_specific_runtime_libs
@@ -709,6 +708,7 @@ with_toolexeclibdir
 with_slibdir
 enable_maintainer_mode
 with_build_libsubdir
+enable_gcov
 enable_largefile
 enable_decimal_float
 with_system_libunwind
@@ -1342,12 +1342,12 @@ Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --disable-shared        don't provide a shared libgcc
-  --disable-gcov          don't provide libgcov and related host tools
   --enable-vtable-verify    Enable vtable verification feature
   --enable-version-specific-runtime-libs    Specify that runtime libraries should be installed in a compiler-specific directory
   --enable-maintainer-mode
                           enable make rules and dependencies not useful (and
                           sometimes confusing) to the casual installer
+  --disable-gcov          don't provide libgcov and related host tools
   --disable-largefile     omit support for large files
   --enable-decimal-float={no,yes,bid,dpd}
                        enable decimal float extension to C.  Selecting 'bid'
@@ -2252,15 +2252,6 @@ fi
 
 
 
-# Check whether --enable-gcov was given.
-if test "${enable_gcov+set}" = set; then :
-  enableval=$enable_gcov;
-else
-  enable_gcov=yes
-fi
-
-
-
 # Check whether --enable-vtable-verify was given.
 if test "${enable_vtable_verify+set}" = set; then :
   enableval=$enable_vtable_verify; case "$enableval" in
@@ -2713,6 +2704,22 @@ fi
 target_subdir=${target_noncanonical}
 
 
+# Check whether --enable-gcov was given.
+if test "${enable_gcov+set}" = set; then :
+  enableval=$enable_gcov;
+else
+  case $target in
+       bpf-*-*)
+         enable_gcov=no
+       ;;
+       *)
+         enable_gcov=yes
+       ;;
+     esac
+fi
+
+
+
 # Calculate toolexeclibdir
 # Also toolexecdir, though it's only used in toolexeclibdir
 case ${version_specific_libs} in
index 13a80b2..6f0b67c 100644 (file)
@@ -68,11 +68,6 @@ AC_ARG_ENABLE(shared,
 ], [enable_shared=yes])
 AC_SUBST(enable_shared)
 
-AC_ARG_ENABLE(gcov,
-[  --disable-gcov          don't provide libgcov and related host tools],
-[], [enable_gcov=yes])
-AC_SUBST(enable_gcov)
-
 AC_ARG_ENABLE(vtable-verify,
 [  --enable-vtable-verify    Enable vtable verification feature ],
 [case "$enableval" in
@@ -163,6 +158,18 @@ ACX_NONCANONICAL_HOST
 ACX_NONCANONICAL_TARGET
 GCC_TOPLEV_SUBDIRS
 
+AC_ARG_ENABLE(gcov,
+[  --disable-gcov          don't provide libgcov and related host tools],
+[], [case $target in
+       bpf-*-*)
+         enable_gcov=no
+       ;;
+       *)
+         enable_gcov=yes
+       ;;
+     esac])
+AC_SUBST(enable_gcov)
+
 # Calculate toolexeclibdir
 # Also toolexecdir, though it's only used in toolexeclibdir
 case ${version_specific_libs} in