commit: 5923bf16687481d275aa8d2e8ebaf4d9c5b32676 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> AuthorDate: Sun Sep 20 06:32:38 2015 +0000 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> CommitDate: Sun Sep 20 06:32:38 2015 +0000 URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=5923bf16
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 <AT> gentoo.org> configure.ac | 4 ++++ 1 file changed, 4 insertions(+) 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])
