]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Compile everything with -fno-builtin, so as to disable LLVM's
authorJulian Seward <jseward@acm.org>
Thu, 29 Sep 2011 17:29:53 +0000 (17:29 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 29 Sep 2011 17:29:53 +0000 (17:29 +0000)
idiom-recognition optimisation.  This identifies memset-style
loops and turns them into calls to memset, which in this case
leads to infinite recursion because it does this transformations
in VG_(memset), which is called from memset(), which we also define.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12065

Makefile.all.am

index 513b810b458ccac616c355e344532f40ea972aad..fe6fccd20101ac44f801b391c0350faad47620ab 100644 (file)
@@ -80,6 +80,8 @@ clean-noinst_DSYMS:
 
 # Baseline flags for all compilations.  Aim here is to maximise
 # performance and get whatever useful warnings we can out of gcc.
+# -fno-builtin is important for defeating LLVM's idiom recognition
+# that somehow causes VG_(memset) to get into infinite recursion.
 AM_CFLAGS_BASE = \
        -O2 -g \
        -Wall \
@@ -89,7 +91,8 @@ AM_CFLAGS_BASE = \
        -Wstrict-prototypes \
        -Wmissing-declarations \
        @FLAG_W_NO_FORMAT_ZERO_LENGTH@ \
-       -fno-strict-aliasing
+       -fno-strict-aliasing \
+       -fno-builtin
 
 # These flags are used for building the preload shared objects.
 # The aim is to give reasonable performance but also to have good
@@ -97,9 +100,11 @@ AM_CFLAGS_BASE = \
 # into (and through) the preloads.
 if VGCONF_OS_IS_DARWIN
 AM_CFLAGS_PIC = -dynamic -O -g -fno-omit-frame-pointer -fno-strict-aliasing \
-               -mno-dynamic-no-pic -fpic -fPIC
+               -mno-dynamic-no-pic -fpic -fPIC \
+               -fno-builtin
 else
-AM_CFLAGS_PIC = -fpic -O -g -fno-omit-frame-pointer -fno-strict-aliasing
+AM_CFLAGS_PIC = -fpic -O -g -fno-omit-frame-pointer -fno-strict-aliasing \
+               -fno-builtin
 endif