What is the correct Xcode setting for Position Independent Executables

烈酒焚心 提交于 2019-12-12 12:17:44

问题


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).


回答1:


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




回答2:


I got respond from Apple with

Non-PIE Binary - The executable 'ProductManualApp.app' is not a Position Independent Executable. Please ensure that your build settings are configured to create PIE executables.

From my research from Google, lots of people said it related "Don't Create Position Independent Executables". I think should keep it default, which is 'No'



来源:https://stackoverflow.com/questions/16518204/what-is-the-correct-xcode-setting-for-position-independent-executables

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!