GCC 5.1 is too smart. Disable Identical Code Folding for preload libs.

We want to disabled Identical Code Folding for the tools preload shared
objects to get better backraces. For GCC 5.1 -fipa-icf is enabled by
default at -O2.

    The optimization reduces code size and may disturb
    unwind stacks by replacing a function by equivalent
    one with a different name.

Add a configure check to see if GCC supports -fno-ipa-icf.
If it does then add the flag to AM_CFLAGS_PSO_BASE.

Without this GCC will notice some of the preload replacement functions
in vg_replace_strmem are identical and fold them all into one picking
a random (existing) function name. This causes backtraces showing
completely unexpected function names.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15305 a5019735-40e9-0310-863c-91ae7b9d1cf9
2 files changed