about summary refs log tree commit diff
path: root/configure
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-08-01 17:12:23 -0400
committerRich Felker <dalias@aerifal.cx>2013-08-01 17:12:23 -0400
commit4a1f55e92fa74ee382909baa96302231f566b5e1 (patch)
tree0b0cc0ee79ce1a859f1a62a3e0b79c8fde411450 /configure
parent5db951ef80cae8b627f95b995811bf916c069757 (diff)
downloadmusl-4a1f55e92fa74ee382909baa96302231f566b5e1.tar.gz
musl-4a1f55e92fa74ee382909baa96302231f566b5e1.tar.xz
musl-4a1f55e92fa74ee382909baa96302231f566b5e1.zip
work around gcc 4.8's generation of self-referential mem* functions at -O3
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure10
1 files changed, 10 insertions, 0 deletions
diff --git a/configure b/configure
index 87207b62..1d734726 100755
--- a/configure
+++ b/configure
@@ -104,6 +104,7 @@ fi
 
 CFLAGS_C99FSE=
 CFLAGS_AUTO=
+CFLAGS_MEMOPS=
 LDFLAGS_AUTO=
 OPTIMIZE_GLOBS=
 prefix=/usr/local/musl
@@ -236,6 +237,14 @@ tryflag CFLAGS_C99FSE -fexcess-precision=standard \
 || { test "$ARCH" = i386 && tryflag CFLAGS_C99FSE -ffloat-store ; }
 tryflag CFLAGS_C99FSE -frounding-math
 
+#
+# Check for options that may be needed to prevent the compiler from
+# generating self-referential versions of memcpy,, memmove, memcmp,
+# and memset. Really, we should add a check to determine if this
+# option is sufficient, and if not, add a macro to cripple these
+# functions with volatile...
+#
+tryflag CFLAGS_MEMOPS -fno-tree-loop-distribute-patterns
 
 #
 # If debugging is explicitly enabled, don't auto-enable optimizations
@@ -403,6 +412,7 @@ syslibdir = $syslibdir
 CC = $CC
 CFLAGS= $CFLAGS_AUTO $CFLAGS
 CFLAGS_C99FSE = $CFLAGS_C99FSE
+CFLAGS_MEMOPS = $CFLAGS_MEMOPS
 CPPFLAGS = $CPPFLAGS
 LDFLAGS = $LDFLAGS_AUTO $LDFLAGS
 CROSS_COMPILE = $CROSS_COMPILE