Skip to main content
Participant
Mar 9, 2012 2:36 PM UTC
Answered

Problems creating a Native Extension linking to a static library

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 is closed to new replies. Start a new post to keep the conversation going.
Correct answer
Mar 13, 2012 5:42 AM UTC

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

3 replies

Correct answer
Mar 13, 2012 5:42 AM UTC

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

Translate
Participant
Mar 15, 2012 11:26 AM UTC

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

Translate
chris.campbell
Legend
Mar 12, 2012 11:37 PM UTC

Forwarded to the iOS team for their review.

Chris

Translate