NDK error when compiling for ARM

I am following the instructions given here to generate the apk for the Android RPC app. When I do a gradle clean build, I am getting the following error

/usr/local/tvm/apps/android_rpc/app/src/main/jni
make: Entering directory '/usr/local/tvm/apps/android_rpc/app/src/main/jni'
[arm64-v8a] Compile++      : tvm4j_runtime_packed <= ml_dmlc_tvm_native_c_api.cc
cc1plus: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'

I check the Application.mk file in /usr/local/tvm/apps/android_rpc/app/src/main/jni and in the line -
APP_CPPFLAGS += -DDMLC_LOG_STACK_TRACE=0 -DTVM4J_ANDROID=1 -std=c++11 -Oz -frtti
I noticed that -O passes an argument z. Can anyone shed some light on this?

This looks like gcc is being called instead of ndk/clang, which would support -Oz?

I have the same problem. Have you solved it?

I met the same problem, anyone solved it?

I have the same question now, do you have the solution?