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.march...@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 | 10 ++++++++-- gcc/configure.ac | 6 ++++++ libgcc/configure | 31 +++++++++++++++++++------------ libgcc/configure.ac | 17 ++++++++++++----- 4 files changed, 45 insertions(+), 19 deletions(-) diff --git a/gcc/configure b/gcc/configure index 258b17a226e..c129d118d27 100755 --- a/gcc/configure +++ b/gcc/configure @@ -8089,6 +8089,12 @@ else fi +case $target in + bpf-*-*) + enable_gcov=no + ;; +esac + # Check whether --with-specs was given. @@ -19659,7 +19665,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 19668 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19765,7 +19771,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 19774 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 06750cee977..a892e170997 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1042,6 +1042,12 @@ 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 + ;; +esac AC_SUBST(enable_gcov) AC_ARG_WITH(specs, diff --git a/libgcc/configure b/libgcc/configure index 4919a56f518..4e3c25cbad5 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -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 + enable_gcov=yes +fi + + +case $target in + bpf-*-*) + enable_gcov=no + ;; +esac + + + # Calculate toolexeclibdir # Also toolexecdir, though it's only used in toolexeclibdir case ${version_specific_libs} in diff --git a/libgcc/configure.ac b/libgcc/configure.ac index 13a80b2551b..c7a2d89c426 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -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], +[], [enable_gcov=yes]) + +case $target in + bpf-*-*) + enable_gcov=no + ;; +esac + +AC_SUBST(enable_gcov) + # Calculate toolexeclibdir # Also toolexecdir, though it's only used in toolexeclibdir case ${version_specific_libs} in -- 2.11.0