views:

69

answers:

0

I currently have a JNI application on the market and was looking to use the neon instructions to further improve performance. I am able to compile and build the neon sample and some basic changes but whenever I choose to do something more complex the assembler crashes with the following output (i've stripped the file names):

.0/ProjectTree/libs/armeabi Compile++ thumb: <= /cygdrive/e/Dev/Projects//Release_1.0/Pro jectTree/jni/.cpp arm-eabi-g++: Internal error: Segmentation fault (program as) Please submit a full bug report. See <://gcc.gnu.org/bugs.html> for instructions. make: * [/cygdrive/e/Dev/Projects//Release_1.0/ProjectTree/obj/local/arm eabi-v7a/objs/Native/.o] Error 1

I have a very basic example (not perfect but you get the idea) that causes the assembler to segfault:

float32x4_t val; float32x4_t array2[3]; array[0] = vmlaq_f32(array2[0], array2[1], array2[2]);

I did some more research and ran into this article:

http://developer.qualcomm.com/blog/android-3d-use-opengl-es-20-and-neon-compiler-options

so I have attempted to re-build gcc and as under cygwin but get the following errors when building the NDK from the git:

checking for main in -lm... yes checking for wctype... yes checking for library containing gethostbyname... none required checking for library containing socketpair... none required checking for library containing waddstr... no checking for library containing tgetent... no configure: error: no termcap library found make[2]: * [configure-gdb] Error 1 make[2]: Leaving directory /tmp/ndk-toolchain-MeSLmt/toolchain-arm-eabi-4.2.1/g db-6.6' make[1]: *** [all] Error 2 make[1]: Leaving directory/tmp/ndk-toolchain-MeSLmt/toolchain-arm-eabi-4.2.1/g db-6.6' make: * [stmp-build-target-gdb] Error 2 Error while building toolchain. See /tmp/ndk-log-5000.log ERROR: Could not build arm-eabi-4.2.1 toolchain!

After I edited the build .sh to actually create a log file, all that is logged is this:

HOST_ARCH=x86 HOST_OS=cygwin HOST_EXE=.exe HOST_TAG=windows HOST_NUM_CPUS=1 BUILD_NUM_CPUS=2 new option: type='long_flag' name='--help' value='' new option: type='long_flag' name='--verbose' value='' new option: type='long_setting' name='--build-out' value='' new option: type='long_setting' name='--sysroot' value='' new option: type='long_setting' name='--platform' value='' new option: type='long_setting' name='--gdb-version' value='' new option: type='long_setting' name='--binutils-version' value='' new option: type='short_setting' name='-j' value='' Configure: arm-eabi-4.2.1 toolchain build Building : arm-eabi-4.2.1 toolchain [this can take a long time].

My make version is 3.81 and I am using cygwin 1.7.7 under windows 7 64bit with the NDK 4b. I have also tried using the assembler from CodeSourcery but have had no luck. I'm at a loss as to why the NDK provided by google isnt working out of the box for all neon instructions. Besides the example above the assembler segfaults whenever I assign to the return result of a function (that returns a float32x4_t) or whenever using arrays of float32x4_t.

I can find cases to work around but it seems strange that there would be limitations imposed by what google provides?