diff --git a/native/jni/Android.mk b/native/jni/Android.mk index bd8171a03..ed3472cd9 100755 --- a/native/jni/Android.mk +++ b/native/jni/Android.mk @@ -85,13 +85,13 @@ include $(CLEAR_VARS) # All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library. LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static +LOCAL_LDFLAGS += -llog + ifeq ($(FLAG_DO_PROFILE), true) $(warning Making profiling version of native library) - LOCAL_LDFLAGS += -llog else # FLAG_DO_PROFILE ifeq ($(FLAG_DBG), true) $(warning Making debug version of native library) - LOCAL_LDFLAGS += -llog endif # FLAG_DBG endif # FLAG_DO_PROFILE diff --git a/native/jni/src/ggml/ggml.h b/native/jni/src/ggml/ggml.h index 150bbbf64..dfcaeab66 100644 --- a/native/jni/src/ggml/ggml.h +++ b/native/jni/src/ggml/ggml.h @@ -207,9 +207,6 @@ #include #include #include -#include -#define GAKLOGE(fmt, ...) __android_log_print(ANDROID_LOG_ERROR, "GGML", fmt, ##__VA_ARGS__) -#define GAKLOGI(fmt, ...) __android_log_print(ANDROID_LOG_INFO, "GGML", fmt, ##__VA_ARGS__) #define GGML_FILE_MAGIC 0x67676d6c // "ggml" #define GGML_FILE_VERSION 1 @@ -244,11 +241,11 @@ #define GGML_PAD(x, n) (((x) + (n) - 1) & ~((n) - 1)) +#include #define GGML_ASSERT(x) \ do { \ if (!(x)) { \ - GAKLOGE("GGML_ASSERT: %s:%d: %s\n", __FILE__, __LINE__, #x); \ - ggml_print_backtrace(); \ + __android_log_assert("", "GGML_ASSERT: ", "%s:%d: %s\n", __FILE__, __LINE__, #x); \ exit(1); \ } \ } while (0)