views:

93

answers:

1

Hello,

Currently I am trying to compile native code for Android. The code is from the OpenCV port for Android. I pasted all the code correctly in my project and edited my make files accordingly. When I set android:debuggable to false everything works fine and I get my native library. When I try while android:debuggable is set to true I get an error. Here is a part of the log:

 Compile++ thumb: cxcore <= /cygdrive/c/Users/Alex/workspace/AR_Still_Image/jni/cxcore/src/cxutils.cpp
/cygdrive/c/Users/Alex/workspace/AR_Still_Image/jni/cxcore/src/cxutils.cpp: In function 'void icvSort16u(ushort*, size_t, int)':
/cygdrive/c/Users/Alex/workspace/AR_Still_Image/jni/cxcore/src/cxutils.cpp:987: internal compiler error: in reload, at reload1.c:1173
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html&gt; for instructions.
make: *** [/cygdrive/c/Users/Alex/workspace/AR_Still_Image/obj/local/armeabi/objs/cxcore/cxcore/src/cxutils.o] Error 1

From what I have found on the internet this is caused by the optimization level of the compilation. As long as the code isn't compiled so that is is debuggable afterwards everything should be fine.

Now apparently it is possible to avoid this by setting APP-OPTIM := release in the Application.mk or adding -O2 to LOCAL_CFLAGS. I have tried both and still I get this error.

Right now I don't really care that much about debugging my native code, but I would like to have basic debugging enabled. And I don't want to keep switching android:debuggable in my manifest every time I want to compile. I'm not even sure if it is okay at all if I just set android:debuggable to false pre compiling and to true post compiling, but I am sure I will forget it every second run.

Has anyone encountered a similar problem or does anyone know how to fix this? It would be a great help.