Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the correct Xcode setting for Position Independent Executables

Just recently started getting a post appstore submission email with the following advice.

Please ensure that your build settings are configured to create PIE executables.

However the setting in XCode appears correct, In the linking section I found

"Don't Create Position Independent Executables" which is set to NO.

(Double negatives YUK).

like image 718
user2239244 Avatar asked Nov 03 '22 22:11

user2239244


1 Answers

You may be receiving this Apple warning not because your Application itself, but because a 3rd party library that was not compiled as PIE. For example, if you are using Marmalade SDK Engine you will receive this warning (they will fix it in september).

But you can try adding more compiler flags in your Build Settings:

In Other C flags you may put the flag: -fPIC

In Other Warning flags you may put: -Wl,--emit-relocs and -Wl,--warn-shared-textrel

To see if your app is PIE:

otool -hf /path/to/your/App.app/app

Reference: https://developer.apple.com/library/ios/qa/qa1788/_index.html

like image 53
Paulo Cheque Avatar answered Nov 10 '22 15:11

Paulo Cheque