aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-09-20 02:32:38 -0400
committerMike Frysinger <vapier@gentoo.org>2015-09-20 02:32:38 -0400
commit5923bf16687481d275aa8d2e8ebaf4d9c5b32676 (patch)
tree3d91e5bd3390d7ad97074c40808bf4b1c9d05889 /configure.ac
parentlibsandbox: avoid leaking memory when extracting strings (diff)
downloadsandbox-5923bf16687481d275aa8d2e8ebaf4d9c5b32676.tar.gz
sandbox-5923bf16687481d275aa8d2e8ebaf4d9c5b32676.tar.bz2
sandbox-5923bf16687481d275aa8d2e8ebaf4d9c5b32676.zip
build: do not let gcc rewrite memory calls
We don't want gcc to rewrite malloc/memset calls to calloc as it will make calloc recursively call itself. Add other memory calls just to be safe. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac4
1 files changed, 4 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 686ae4d..73227db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -391,6 +391,10 @@ AC_DEFUN([SB_CHECK_CFLAG],[AX_CHECK_COMPILE_FLAG([$1],[CFLAGS="$CFLAGS $1"])])
SB_CHECK_CFLAG([-Winvalid-pch])
SB_CHECK_CFLAG([-fdata-sections])
SB_CHECK_CFLAG([-ffunction-sections])
+dnl We have our own wrapped memory functions.
+SB_CHECK_CFLAG([-fno-builtin-calloc])
+SB_CHECK_CFLAG([-fno-builtin-malloc])
+SB_CHECK_CFLAG([-fno-builtin-realloc])
AC_DEFUN([SB_CHECK_LDFLAG],[AX_CHECK_LINK_FLAG([-Wl,$1],[LDFLAGS="$LDFLAGS -Wl,$1"])])
SB_CHECK_LDFLAG([--as-needed])
SB_CHECK_LDFLAG([--gc-sections])