Skip to main content
Participant
March 9, 2012
Answered

Problems creating a Native Extension linking to a static library

  • March 9, 2012
  • 2 replies
  • 898 views

Hi,

I'm trying to create my own Native Extension for iOs that will use another static library.

My problem occurs when I try to package my app with ADT: after a lot of "ld warning: unexpected srelocation type 9" , I get a final error : "ld: thumb bl/blx out of range (-4468380 max is +/-4M)"

This may be caused by the fact that the static library I am using needs the gcc setting "compile for thumb" turned off. I've done that in XCode to get my .a file to generate my .ane, but how could I tell ADT to take it into account ?

Thank you for your help !

This topic has been closed for replies.
Correct answer

Are you compiling for ARMv6 or ARMv7?

With armv7, you do not need to switch off the "compile for thumb" anyways.

Also, I guess you are using an iOS version greater than 4.3 to compile your native library. In this case, using -platformsdk switch of adt, while packaging your application might  just resolve your issue.(You will see some ld 4-byte alignment warnings, but thats ok)

-Neha

2 replies

Correct answer
March 13, 2012

Are you compiling for ARMv6 or ARMv7?

With armv7, you do not need to switch off the "compile for thumb" anyways.

Also, I guess you are using an iOS version greater than 4.3 to compile your native library. In this case, using -platformsdk switch of adt, while packaging your application might  just resolve your issue.(You will see some ld 4-byte alignment warnings, but thats ok)

-Neha

Participant
March 15, 2012

Yes, using -platformsdk resolved my issue. Thank you very much for your help and reactivity!

chris.campbell
Legend
March 12, 2012

Forwarded to the iOS team for their review.

Chris