-
Notifications
You must be signed in to change notification settings - Fork 375
Execution build: card.io-Android-source/card.io/src/main/obj/local/armeabi-v7a/objs/cardioRecognizer_tegra2/card.io-dmz/dmz_all.o] Error 1 #60
Comments
What ndk are you using? You mentioned it worked before - what version did you upgrade from? I saw this error before when adding 64 bit support. Be sure you've updated to the latest dmz submodule, if you've included this module as a submodule itself. |
I am using NDK rev 11. I just upgraded Android Support Library and Local Maven repository for Support Libraries, after upgrade I got the error. And I have followed your instruction for first build to update dmz submodule. |
Same problem here, giving the command " ./gradlew buildNative" results in this error:
I also recently updated to ndk rev11 but I didn't try to build card.io before that. |
Looks like something changed in ndk 11. ndk |
I think x86 and armeabi-v7a made the error, when I removed them I did not get the error. But I need armeabi-v7a since that processor is prolific usage in many devices. |
I managed to successfully build ( ./gradlew buildNative runs with no errors) but I had to remove:
|
I ran into this issue too, on Mac.Like @braebot said, it seems to be something wrong with the latest ndk version, r11b. After changing to r10e, it works fine now. |
Its not something wrong, its just that a deprecated usage of a destination CPU register has been removed (r13, r15). It still works (on a obsolete basis) by using the old NDK. Register r13 is used as the stackpointer. So the new NDK just requires the stackpointer to be controlled by itself ont not by some inline assembler code. So we really need to find out which part it is that generates ARM r13/r15 destination register usage and puts it into the dmz_all shared object. Maybe one of the dmz/cv See: https://sourceware.org/ml/binutils/2010-06/msg00309.html Update: I tested the asm stuff in the cv directory and the error is not caused by one of them. |
The error is located within the complex Eigen header files in the DMZ sub repository. ei_declare_aligned_stack_constructed_variable(RhsScalar,actualRhsPtr,actualRhs.size(),
DirectlyUseRhs ? const_cast<RhsScalar*>(actualRhs.data()) : static_rhs.data()); From what I understand is that there is weird stack memory allocation done by using the stackpointer r13 register manually. (see http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0435a/index.html (search for "C2076E: illegal write to SP")). What it does is that it uses the POSIX
I suspect that these created ASM inlined sinppets are the root cause of the problem, since they are required to use the r13 stackpointer register. The reason why the stack allocator function is used is that the library can decide if to use stack or heap during runtime based on a threshold of the requested memory size. Maybe we can fiddle around with the PreProcessor directives Update: undefining the preprocessor directive called |
card-io/card.io-Android-source#60 Using newer Android NDK versions (11+) to compile DMZ result in errors: - Eigen: inline assembler that is generated by using POSIX alloca function (artificially writing r13 stackpointer register is now forbidden) - Eigen: posix_memalign seems to be missing I wrote pre-processor directives that bypass the issues on Android. We can remove them once the Android NDK team fixes it. Performance impact seems to be minimal.
I have followed your steps in first build, but when I executed, I got these error:
/var/folders/fy/2_ssmh6d7fqb96jqx_hy8c5w0000gp/T/dmz_all-18fe4c.s: Assembler messages:
/var/folders/fy/2_ssmh6d7fqb96jqx_hy8c5w0000gp/T/dmz_all-18fe4c.s:38966: Error: r13 not allowed here --
sub.w sp,r2,#832' /var/folders/fy/2_ssmh6d7fqb96jqx_hy8c5w0000gp/T/dmz_all-18fe4c.s:41459: Error: r13 not allowed here --
sub.w sp,r2,#1296'/var/folders/fy/2_ssmh6d7fqb96jqx_hy8c5w0000gp/T/dmz_all-18fe4c.s:41573: Error: r13 not allowed here --
sub.w sp,r2,#144' clang++: error: assembler command failed with exit code 1 (use -v to see invocation) make: *** [/Users/budi/Documents/card.io-Android-source/card.io/src/main/obj/local/armeabi-v7a/objs/cardioRecognizer_tegra2/card.io-dmz/dmz_all.o] Error 1 make: *** Waiting for unfinished jobs.... /var/folders/fy/2_ssmh6d7fqb96jqx_hy8c5w0000gp/T/dmz_all-4cd441.s: Assembler messages: /var/folders/fy/2_ssmh6d7fqb96jqx_hy8c5w0000gp/T/dmz_all-4cd441.s:65504: Error: r13 not allowed here --
sub.w sp,r2,#832'/var/folders/fy/2_ssmh6d7fqb96jqx_hy8c5w0000gp/T/dmz_all-4cd441.s:71284: Error: r13 not allowed here --
sub.w sp,r2,#1296' /var/folders/fy/2_ssmh6d7fqb96jqx_hy8c5w0000gp/T/dmz_all-4cd441.s:71398: Error: r13 not allowed here --
sub.w sp,r2,#144'/var/folders/fy/2_ssmh6d7fqb96jqx_hy8c5w0000gp/T/dmz_all-4cd441.s:91752: Error: r13 not allowed here --
sub.w sp,r2,#720' /var/folders/fy/2_ssmh6d7fqb96jqx_hy8c5w0000gp/T/dmz_all-4cd441.s:97277: Error: r13 not allowed here --
sub.w sp,r2,#496'/var/folders/fy/2_ssmh6d7fqb96jqx_hy8c5w0000gp/T/dmz_all-4cd441.s:97391: Error: r13 not allowed here -- `sub.w sp,r2,#720'
clang++: error: assembler command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/budi/Documents/card.io-Android-source/card.io/src/main/obj/local/armeabi-v7a/objs/cardioRecognizer/card.io-dmz/dmz_all.o] Error 1
:card.io:buildNative FAILED
FAILURE: Build failed with an exception.
Execution failed for task ':card.io:buildNative'.
The error occurred when I used latest Android SDK, before I updated Android SDK, the error did not occur.
what should i do to fix the error? Thank you so much for your help.
The text was updated successfully, but these errors were encountered: