From: Philippe Waroquiers Date: Tue, 15 May 2012 21:04:31 +0000 (+0000) Subject: Bypass gcc 4.4/4.5 compilation bug by moving -fomit-frame-pointer to Makefile.all.am X-Git-Tag: svn/VALGRIND_3_8_0~304 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cad5f2ea1d5ae8609fad38de239539b737458373;p=thirdparty%2Fvalgrind.git Bypass gcc 4.4/4.5 compilation bug by moving -fomit-frame-pointer to Makefile.all.am gcc 4.4 and 4.5 has a bug which causes miscompilation of mc_main.c: args are not correctly given to VG_(am_munmap_valgrind). This causes the secondary map entries to not be unmapped (which can cause unlimited memory growth) and/or causes the assert on VG_(am_munmap_valgrind) result to fail. Removing the pragma optimize from mc_main.c and inserting it instead in Makefile.all.am for x86 solves the gcc bug. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12564 --- diff --git a/Makefile.all.am b/Makefile.all.am index 30502798fe..029f925345 100644 --- a/Makefile.all.am +++ b/Makefile.all.am @@ -133,13 +133,13 @@ AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@ = \ endif AM_FLAG_M3264_X86_LINUX = @FLAG_M32@ -AM_CFLAGS_X86_LINUX = @FLAG_M32@ @PREFERRED_STACK_BOUNDARY@ \ - $(AM_CFLAGS_BASE) +AM_CFLAGS_X86_LINUX = @FLAG_M32@ @PREFERRED_STACK_BOUNDARY@ \ + $(AM_CFLAGS_BASE) -fomit-frame-pointer AM_CCASFLAGS_X86_LINUX = @FLAG_M32@ -g AM_FLAG_M3264_AMD64_LINUX = @FLAG_M64@ -AM_CFLAGS_AMD64_LINUX = @FLAG_M64@ -fomit-frame-pointer \ - @PREFERRED_STACK_BOUNDARY@ $(AM_CFLAGS_BASE) +AM_CFLAGS_AMD64_LINUX = @FLAG_M64@ @PREFERRED_STACK_BOUNDARY@ \ + $(AM_CFLAGS_BASE) -fomit-frame-pointer AM_CCASFLAGS_AMD64_LINUX = @FLAG_M64@ -g AM_FLAG_M3264_PPC32_LINUX = @FLAG_M32@ diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index d481b5f582..804285ae60 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -50,15 +50,6 @@ #include "memcheck.h" /* for client requests */ -/* We really want this frame-pointer-less on all platforms, since the - helper functions are small and called very frequently. By default - on x86-linux, though, Makefile.all.am doesn't specify it, so do it - here. Requires gcc >= 4.4, unfortunately. */ -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) -# pragma GCC optimize("-fomit-frame-pointer") -#endif - - /* Set to 1 to do a little more sanity checking */ #define VG_DEBUG_MEMORY 0