diff --git a/tests/ckb-c-stdlib-tests/Makefile b/tests/ckb-c-stdlib-tests/Makefile index e7adf2e..4464442 100644 --- a/tests/ckb-c-stdlib-tests/Makefile +++ b/tests/ckb-c-stdlib-tests/Makefile @@ -2,7 +2,7 @@ TARGET := riscv64-unknown-linux-gnu CC := $(TARGET)-gcc LD := $(TARGET)-gcc OBJCOPY := $(TARGET)-objcopy -CFLAGS := -fPIC -O3 -fno-builtin -nostdinc -nostdlib -nostartfiles -fvisibility=hidden -fdata-sections -ffunction-sections -I ../../include/ckb-c-stdlib -I ../../include/ckb-c-stdlib/libc -Wall -Werror -Wno-nonnull -Wno-nonnull-compare -Wno-unused-function -g +CFLAGS := -fPIC -O3 -fno-builtin -nostdinc -nostdlib -nostartfiles -fvisibility=hidden -fdata-sections -ffunction-sections -I ../../lualib/c-stdlib -I ../../lualib/c-stdlib/src -I ../../include/ckb-c-stdlib -I ../../include/ckb-c-stdlib/libc -Wall -Werror -Wno-nonnull -Wno-nonnull-compare -Wno-unused-function -g LDFLAGS := -nostartfiles -Wl,-static -Wl,--gc-sections # docker pull nervos/ckb-riscv-gnu-toolchain:gnu-bionic-20191012 diff --git a/tests/ckb-c-stdlib-tests/test_malloc.c b/tests/ckb-c-stdlib-tests/test_malloc.c index 15ff9f3..40ba3d2 100644 --- a/tests/ckb-c-stdlib-tests/test_malloc.c +++ b/tests/ckb-c-stdlib-tests/test_malloc.c @@ -1,16 +1,15 @@ -#define CKB_C_STDLIB_PRINTF -#define CKB_C_STDLIB_MALLOC -#define PRINTF_DISABLE_SUPPORT_FLOAT +#define CKB_MALLOC_DECLARATION_ONLY 1 +#define CKB_C_STDLIB_PRINTF 1 #include #include #include #include +#include "malloc_impl.h" #include "ckb_syscalls.h" #include "helper.h" -extern void malloc_config(uintptr_t min, uintptr_t max); #define COUNT_OF(a) (sizeof(a) / sizeof(a[0])) void check_heap(void) {