cc/gcc: add option to enable/disable libmudflap
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Jul 28 23:55:10 2010 +0200 (2010-07-28)
changeset 2043efb1058baa31
parent 2042 d1f70bef45ba
child 2044 20dd8cef1c8a
cc/gcc: add option to enable/disable libmudflap

For some scenarii, libmudflap is not very usefull
or can break the build. Make in an optioon that
defaults to 'N' to be on the safe side.

For the core gcc-s, there is absolutely no need
to build libmidflap.

Idea from: Bernhard Pfund <bernhard@chapter7.ch>
config/cc/gcc.in.2
scripts/build/cc/gcc.sh
     1.1 --- a/config/cc/gcc.in.2	Wed Jul 28 23:53:09 2010 +0200
     1.2 +++ b/config/cc/gcc.in.2	Wed Jul 28 23:55:10 2010 +0200
     1.3 @@ -51,3 +51,17 @@
     1.4        
     1.5        It can happen that ./configure is wrong in some cases. Known
     1.6        case is for ARM big endian, where you should say 'N'.
     1.7 +
     1.8 +config CC_GCC_LIBMUDFLAP
     1.9 +    bool
    1.10 +    prompt "Compile libmudflap"
    1.11 +    default n
    1.12 +    help
    1.13 +      libmudflap is a pointer-use checking tool, which can detect
    1.14 +      various mis-usages of pointers in C and (to some extents) C++.
    1.15 +      
    1.16 +      You should say 'N' here, as libmduflap generates instrumented
    1.17 +      code (thus it is a bit bigger and a bit slower) and requires
    1.18 +      re-compilation and re-link, while it exists better run-time
    1.19 +      alternatives (eg. DUMA, dmalloc...) that need neither re-
    1.20 +      compilation nor re-link.
     2.1 --- a/scripts/build/cc/gcc.sh	Wed Jul 28 23:53:09 2010 +0200
     2.2 +++ b/scripts/build/cc/gcc.sh	Wed Jul 28 23:55:10 2010 +0200
     2.3 @@ -195,6 +195,7 @@
     2.4          --prefix="${core_prefix_dir}"               \
     2.5          --with-local-prefix="${CT_SYSROOT_DIR}"     \
     2.6          --disable-multilib                          \
     2.7 +        --disable-libmudflap                        \
     2.8          ${CC_CORE_SYSROOT_ARG}                      \
     2.9          "${extra_config[@]}"                        \
    2.10          --disable-nls                               \
    2.11 @@ -340,6 +341,11 @@
    2.12      if [ -n "${CC_ENABLE_CXX_FLAGS}" ]; then
    2.13          extra_config+=("--enable-cxx-flags=${CC_ENABLE_CXX_FLAGS}")
    2.14      fi
    2.15 +    if [ "${CT_CC_GCC_LIBMUDFLAP}" = "y" ]; then
    2.16 +        extra_config+=(--enable-libmudflap)
    2.17 +    else
    2.18 +        extra_config+=(--disable-libmudflap)
    2.19 +    fi
    2.20  
    2.21      # When companion libraries are build static (eg !shared),
    2.22      # the libstdc++ is not pulled automatically, although it