# HG changeset patch # User "Yann E. MORIN" # Date 1280354110 -7200 # Node ID efb1058baa31aa8004bba8fa545189d24bcc33bd # Parent d1f70bef45ba518dafffcbf21d43f640889e5668 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 diff -r d1f70bef45ba -r efb1058baa31 config/cc/gcc.in.2 --- a/config/cc/gcc.in.2 Wed Jul 28 23:53:09 2010 +0200 +++ b/config/cc/gcc.in.2 Wed Jul 28 23:55:10 2010 +0200 @@ -51,3 +51,17 @@ It can happen that ./configure is wrong in some cases. Known case is for ARM big endian, where you should say 'N'. + +config CC_GCC_LIBMUDFLAP + bool + prompt "Compile libmudflap" + default n + help + libmudflap is a pointer-use checking tool, which can detect + various mis-usages of pointers in C and (to some extents) C++. + + You should say 'N' here, as libmduflap generates instrumented + code (thus it is a bit bigger and a bit slower) and requires + re-compilation and re-link, while it exists better run-time + alternatives (eg. DUMA, dmalloc...) that need neither re- + compilation nor re-link. diff -r d1f70bef45ba -r efb1058baa31 scripts/build/cc/gcc.sh --- a/scripts/build/cc/gcc.sh Wed Jul 28 23:53:09 2010 +0200 +++ b/scripts/build/cc/gcc.sh Wed Jul 28 23:55:10 2010 +0200 @@ -195,6 +195,7 @@ --prefix="${core_prefix_dir}" \ --with-local-prefix="${CT_SYSROOT_DIR}" \ --disable-multilib \ + --disable-libmudflap \ ${CC_CORE_SYSROOT_ARG} \ "${extra_config[@]}" \ --disable-nls \ @@ -340,6 +341,11 @@ if [ -n "${CC_ENABLE_CXX_FLAGS}" ]; then extra_config+=("--enable-cxx-flags=${CC_ENABLE_CXX_FLAGS}") fi + if [ "${CT_CC_GCC_LIBMUDFLAP}" = "y" ]; then + extra_config+=(--enable-libmudflap) + else + extra_config+=(--disable-libmudflap) + fi # When companion libraries are build static (eg !shared), # the libstdc++ is not pulled automatically, although it