From a01d83d78380e84b04d62ca34a142a7e3d8e390d Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Mon, 6 Jan 2014 11:09:06 +0800 Subject: [PATCH] Don't enable bound check if libgcc is used Bound check rely on some functions provided by libtcc. It should therefore not be enabled when libgcc is used. --- tcc-doc.texi | 2 +- tcc.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tcc-doc.texi b/tcc-doc.texi index dbfbb4a..fbb0220 100644 --- a/tcc-doc.texi +++ b/tcc-doc.texi @@ -338,7 +338,7 @@ Generate additional support code to check memory allocations and array/pointer bounds. @option{-g} is implied. Note that the generated code is slower and bigger in this case. -Note: @option{-b} is only available on i386 for the moment. +Note: @option{-b} is only available on i386 when using libtcc for the moment. @item -bt N Display N callers in stack traces. This is useful with @option{-g} or diff --git a/tcc.h b/tcc.h index 92e528d..50642b7 100644 --- a/tcc.h +++ b/tcc.h @@ -128,7 +128,8 @@ #endif #if !defined(TCC_UCLIBC) && !defined(TCC_TARGET_ARM) && \ - !defined(TCC_TARGET_C67) && !defined(TCC_TARGET_X86_64) + !defined(TCC_TARGET_C67) && !defined(TCC_TARGET_X86_64) && \ + !defined(CONFIG_USE_LIBGCC) #define CONFIG_TCC_BCHECK /* enable bound checking code */ #endif