On Thu, 20 Mar 2014, Jakub Jelinek wrote:

> Hi!
> 
> We currently bootstrap both libsanitizer and libvtv, the former
> just in case somebody decides to --with-build-config=bootstrap-asan
> (or --with-build-config=bootstrap-ubsan), the latter if somebody decides
> to --enable-vtable-verify.
> 
> This patch changes it so that we only bootstrap libsanitizer if
> bootstrap-asan or bootstrap-ubsan is in BOOT_CONFIG, and only bootstrap
> libvtv if --enable-vtable-verify.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, on x86_64 it
> saved a few minutes of build time, neither libsanitizer nor libvtv
> has been bootstrapped, only built in stage3.
> Currently also bootstrapping on i686-linux with
> --enable-vtable-verify --with-build-config=bootstrap-asan
> but already got into stage2 and verified that both libsanitizer and libvtv
> are being bootstrapped in that case.
> 
> Ok for trunk?

Fine with me though I'd like to see the build of libvtv disabled
alltogether if not --enable-vtable-verify as the build/install is
quite useless without building the startfiles referenced at link-time
when doing -fvtable-verify=XY (Caroline also thinks that not
instrumenting libstdc++ will make most use-cases fail).

Easy to do as followup though.

Thanks,
Richard.

> 2014-03-20  Jakub Jelinek  <ja...@redhat.com>
> 
>       * configure.ac: Move BUILD_CONFIG set up earlier.  Add
>       --enable-vtable-verify option parsing.  Don't add
>       target-libsanitizer to bootstrap_target_libs unless
>       --with-build-config=bootstrap-asan or
>       --with-build-config=bootstrap-ubsan.  Don't add target-libvtv
>       to bootstrap_target_libs unless --enable-vtable-verify.
>       * configure: Regenerated.
> 
> --- configure.ac.jj   2014-03-03 08:24:36.000000000 +0100
> +++ configure.ac      2014-03-20 09:47:17.676017039 +0100
> @@ -2472,6 +2472,62 @@ else
>    GCC_SHLIB_SUBDIR=
>  fi
>  
> +# Adjust the toplevel makefile according to whether bootstrap was selected.
> +case $enable_bootstrap in
> +  yes)
> +    bootstrap_suffix=bootstrap
> +    BUILD_CONFIG=bootstrap-debug
> +    ;;
> +  no)
> +    bootstrap_suffix=no-bootstrap
> +    BUILD_CONFIG=
> +    ;;
> +esac
> +
> +AC_MSG_CHECKING(for default BUILD_CONFIG)
> +
> +AC_ARG_WITH([build-config],
> +  [AS_HELP_STRING([--with-build-config='NAME NAME2...'],
> +               [use config/NAME.mk build configuration])],
> +  [case $with_build_config in
> +   yes) with_build_config= ;;
> +   no) with_build_config= BUILD_CONFIG= ;;
> +   esac])
> +
> +if test "x${with_build_config}" != x; then
> +  BUILD_CONFIG=$with_build_config
> +else
> +  case $BUILD_CONFIG in
> +  bootstrap-debug)
> +    if echo "int f (void) { return 0; }" > conftest.c &&
> +       ${CC} -c conftest.c &&
> +       mv conftest.o conftest.o.g0 &&
> +       ${CC} -c -g conftest.c &&
> +       mv conftest.o conftest.o.g &&
> +       ${srcdir}/contrib/compare-debug conftest.o.g0 conftest.o.g > 
> /dev/null 2>&1; then
> +      :
> +    else
> +      BUILD_CONFIG=
> +    fi
> +    rm -f conftest.c conftest.o conftest.o.g0 conftest.o.g
> +    ;;
> +  esac
> +fi
> +AC_MSG_RESULT($BUILD_CONFIG)
> +AC_SUBST(BUILD_CONFIG)
> +
> +# Use same top-level configure hooks in libgcc/libstdc++/libvtv.
> +AC_MSG_CHECKING([for --enable-vtable-verify])
> +AC_ARG_ENABLE(vtable-verify,
> +[  --enable-vtable-verify    Enable vtable verification feature ],
> +[case "$enableval" in
> + yes) enable_vtable_verify=yes ;;
> + no)  enable_vtable_verify=no ;;
> + *)   enable_vtable_verify=no;;
> + esac],
> +[enable_vtable_verify=no])
> +AC_MSG_RESULT($enable_vtable_verify)
> +
>  # Record target_configdirs and the configure arguments for target and
>  # build configuration in Makefile.
>  target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
> @@ -2482,13 +2538,19 @@ if echo " ${target_configdirs} " | grep
>    bootstrap_target_libs=${bootstrap_target_libs}target-libgomp,
>  fi
>  
> -# If we are building libsanitizer, bootstrap it.
> -if echo " ${target_configdirs} " | grep " libsanitizer " > /dev/null 2>&1 ; 
> then
> -  bootstrap_target_libs=${bootstrap_target_libs}target-libsanitizer,
> +# If we are building libsanitizer and $BUILD_CONFIG contains bootstrap-asan
> +# or bootstrap-ubsan, bootstrap it.
> +if echo " ${target_configdirs} " | grep " libsanitizer " > /dev/null 2>&1; 
> then
> +  case "$BUILD_CONFIG" in
> +    *bootstrap-asan* | *bootstrap-ubsan* )
> +      bootstrap_target_libs=${bootstrap_target_libs}target-libsanitizer,
> +      ;;
> +  esac
>  fi
>  
> -# If we are building libvtv, bootstrap it.
> -if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 ; then
> +# If we are building libvtv and --enable-vtable-verify, bootstrap it.
> +if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 &&
> +   test "$enable_vtable_verify" != no; then
>    bootstrap_target_libs=${bootstrap_target_libs}target-libvtv,
>  fi
>  
> @@ -2541,50 +2603,6 @@ case "$enable_bootstrap:$ENABLE_GOLD: $c
>      ;;
>  esac
>  
> -# Adjust the toplevel makefile according to whether bootstrap was selected.
> -case $enable_bootstrap in
> -  yes)
> -    bootstrap_suffix=bootstrap
> -    BUILD_CONFIG=bootstrap-debug
> -    ;;
> -  no)
> -    bootstrap_suffix=no-bootstrap
> -    BUILD_CONFIG=
> -    ;;
> -esac
> -
> -AC_MSG_CHECKING(for default BUILD_CONFIG)
> -
> -AC_ARG_WITH([build-config],
> -  [AS_HELP_STRING([--with-build-config='NAME NAME2...'],
> -               [use config/NAME.mk build configuration])],
> -  [case $with_build_config in
> -   yes) with_build_config= ;;
> -   no) with_build_config= BUILD_CONFIG= ;;
> -   esac])
> -
> -if test "x${with_build_config}" != x; then
> -  BUILD_CONFIG=$with_build_config
> -else
> -  case $BUILD_CONFIG in
> -  bootstrap-debug)
> -    if echo "int f (void) { return 0; }" > conftest.c &&
> -       ${CC} -c conftest.c &&
> -       mv conftest.o conftest.o.g0 &&
> -       ${CC} -c -g conftest.c &&
> -       mv conftest.o conftest.o.g &&
> -       ${srcdir}/contrib/compare-debug conftest.o.g0 conftest.o.g > 
> /dev/null 2>&1; then
> -      :
> -    else
> -      BUILD_CONFIG=
> -    fi
> -    rm -f conftest.c conftest.o conftest.o.g0 conftest.o.g
> -    ;;
> -  esac
> -fi
> -AC_MSG_RESULT($BUILD_CONFIG)
> -AC_SUBST(BUILD_CONFIG)
> -
>  extrasub_build=
>  for module in ${build_configdirs} ; do
>    if test -z "${no_recursion}" \
> --- configure.jj      2014-03-03 08:24:36.000000000 +0100
> +++ configure 2014-03-20 09:47:56.351808880 +0100
> @@ -783,6 +783,7 @@ enable_objc_gc
>  with_build_sysroot
>  with_debug_prefix_map
>  with_build_config
> +enable_vtable_verify
>  enable_serial_configure
>  with_build_time_tools
>  enable_maintainer_mode
> @@ -1481,6 +1482,7 @@ Optional Features:
>                            Mostly useful for compiler development
>    --enable-objc-gc        enable use of Boehm's garbage collector with the 
> GNU
>                            Objective-C runtime
> +  --enable-vtable-verify    Enable vtable verification feature
>    --enable-serial-[{host,target,build}-]configure
>                            force sequential configuration of sub-packages for
>                            the host, target or build machine, or all
> @@ -7092,6 +7094,71 @@ else
>    GCC_SHLIB_SUBDIR=
>  fi
>  
> +# Adjust the toplevel makefile according to whether bootstrap was selected.
> +case $enable_bootstrap in
> +  yes)
> +    bootstrap_suffix=bootstrap
> +    BUILD_CONFIG=bootstrap-debug
> +    ;;
> +  no)
> +    bootstrap_suffix=no-bootstrap
> +    BUILD_CONFIG=
> +    ;;
> +esac
> +
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for default BUILD_CONFIG" 
> >&5
> +$as_echo_n "checking for default BUILD_CONFIG... " >&6; }
> +
> +
> +# Check whether --with-build-config was given.
> +if test "${with_build_config+set}" = set; then :
> +  withval=$with_build_config; case $with_build_config in
> +   yes) with_build_config= ;;
> +   no) with_build_config= BUILD_CONFIG= ;;
> +   esac
> +fi
> +
> +
> +if test "x${with_build_config}" != x; then
> +  BUILD_CONFIG=$with_build_config
> +else
> +  case $BUILD_CONFIG in
> +  bootstrap-debug)
> +    if echo "int f (void) { return 0; }" > conftest.c &&
> +       ${CC} -c conftest.c &&
> +       mv conftest.o conftest.o.g0 &&
> +       ${CC} -c -g conftest.c &&
> +       mv conftest.o conftest.o.g &&
> +       ${srcdir}/contrib/compare-debug conftest.o.g0 conftest.o.g > 
> /dev/null 2>&1; then
> +      :
> +    else
> +      BUILD_CONFIG=
> +    fi
> +    rm -f conftest.c conftest.o conftest.o.g0 conftest.o.g
> +    ;;
> +  esac
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CONFIG" >&5
> +$as_echo "$BUILD_CONFIG" >&6; }
> +
> +
> +# Use same top-level configure hooks in libgcc/libstdc++/libvtv.
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 
> --enable-vtable-verify" >&5
> +$as_echo_n "checking for --enable-vtable-verify... " >&6; }
> +# Check whether --enable-vtable-verify was given.
> +if test "${enable_vtable_verify+set}" = set; then :
> +  enableval=$enable_vtable_verify; case "$enableval" in
> + yes) enable_vtable_verify=yes ;;
> + no)  enable_vtable_verify=no ;;
> + *)   enable_vtable_verify=no;;
> + esac
> +else
> +  enable_vtable_verify=no
> +fi
> +
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_vtable_verify" >&5
> +$as_echo "$enable_vtable_verify" >&6; }
> +
>  # Record target_configdirs and the configure arguments for target and
>  # build configuration in Makefile.
>  target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
> @@ -7102,13 +7169,19 @@ if echo " ${target_configdirs} " | grep
>    bootstrap_target_libs=${bootstrap_target_libs}target-libgomp,
>  fi
>  
> -# If we are building libsanitizer, bootstrap it.
> -if echo " ${target_configdirs} " | grep " libsanitizer " > /dev/null 2>&1 ; 
> then
> -  bootstrap_target_libs=${bootstrap_target_libs}target-libsanitizer,
> +# If we are building libsanitizer and $BUILD_CONFIG contains bootstrap-asan
> +# or bootstrap-ubsan, bootstrap it.
> +if echo " ${target_configdirs} " | grep " libsanitizer " > /dev/null 2>&1; 
> then
> +  case "$BUILD_CONFIG" in
> +    *bootstrap-asan* | *bootstrap-ubsan* )
> +      bootstrap_target_libs=${bootstrap_target_libs}target-libsanitizer,
> +      ;;
> +  esac
>  fi
>  
> -# If we are building libvtv, bootstrap it.
> -if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 ; then
> +# If we are building libvtv and --enable-vtable-verify, bootstrap it.
> +if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 &&
> +   test "$enable_vtable_verify" != no; then
>    bootstrap_target_libs=${bootstrap_target_libs}target-libvtv,
>  fi
>  
> @@ -7161,54 +7234,6 @@ case "$enable_bootstrap:$ENABLE_GOLD: $c
>      ;;
>  esac
>  
> -# Adjust the toplevel makefile according to whether bootstrap was selected.
> -case $enable_bootstrap in
> -  yes)
> -    bootstrap_suffix=bootstrap
> -    BUILD_CONFIG=bootstrap-debug
> -    ;;
> -  no)
> -    bootstrap_suffix=no-bootstrap
> -    BUILD_CONFIG=
> -    ;;
> -esac
> -
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for default BUILD_CONFIG" 
> >&5
> -$as_echo_n "checking for default BUILD_CONFIG... " >&6; }
> -
> -
> -# Check whether --with-build-config was given.
> -if test "${with_build_config+set}" = set; then :
> -  withval=$with_build_config; case $with_build_config in
> -   yes) with_build_config= ;;
> -   no) with_build_config= BUILD_CONFIG= ;;
> -   esac
> -fi
> -
> -
> -if test "x${with_build_config}" != x; then
> -  BUILD_CONFIG=$with_build_config
> -else
> -  case $BUILD_CONFIG in
> -  bootstrap-debug)
> -    if echo "int f (void) { return 0; }" > conftest.c &&
> -       ${CC} -c conftest.c &&
> -       mv conftest.o conftest.o.g0 &&
> -       ${CC} -c -g conftest.c &&
> -       mv conftest.o conftest.o.g &&
> -       ${srcdir}/contrib/compare-debug conftest.o.g0 conftest.o.g > 
> /dev/null 2>&1; then
> -      :
> -    else
> -      BUILD_CONFIG=
> -    fi
> -    rm -f conftest.c conftest.o conftest.o.g0 conftest.o.g
> -    ;;
> -  esac
> -fi
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CONFIG" >&5
> -$as_echo "$BUILD_CONFIG" >&6; }
> -
> -
>  extrasub_build=
>  for module in ${build_configdirs} ; do
>    if test -z "${no_recursion}" \
> 
>       Jakub
> 
> 

-- 
Richard Biener <rguent...@suse.de>
SUSE / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746
GF: Jeff Hawn, Jennifer Guild, Felix Imend"orffer

Reply via email to