Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PIE disabled. Absolute addressing not allowed in code signed PIE

I'm working with Xcode 4.5 with a deployment target of iOS 5.1

I'm getting the following warning when I compile my app in relation to two specific methods which have significantly increased in size.

ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in -[mfile method]. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie

And subsequently the app is throwing an exception at launch with the following error:

dyld: vm_protect(0x00001000, 0x0078C000, false, 0x07) failed, result=2 for segment __TEXT in /var/mobile/Applications/8E764612-87ED-4A99-9C59-E56C934DA997/appname.app/appname

dyld dyld_fatal_error:

0x2feb20c4: trap

0x2feb20c8: nop

When I comment out the methods in question, the app runs fine.

Any suggestions?

like image 773
user1927751 Avatar asked Dec 25 '12 07:12

user1927751


1 Answers

Here is a response from the Unity forums:

In xcode 4.6 build settings change "Dont create position independent executables" from NO to Yes, thats it.

Credits go to amit-chai

like image 137
Danut Pralea Avatar answered Sep 19 '22 19:09

Danut Pralea