What is the correct Xcode setting for Position Ind

2019-06-25 04:13发布

问题:

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'