位置独立可执行文件的正确Xcode设置是什么 [英] What is the correct Xcode setting for Position Independent Executables

查看:114
本文介绍了位置独立可执行文件的正确Xcode设置是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近才开始收到带有以下建议的应用商店发布后提交电子邮件.

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

请确保将您的构建设置配置为创建PIE可执行文件.

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

但是XCode中的设置看起来正确,在链接部分,我找到了

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

不创建与位置无关的可执行文件",设置为否".

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

(双底片YUK).

推荐答案

您可能会收到此Apple警告不是因为您的应用程序本身,而是因为没有编译为PIE的第3方库.例如,如果您使用的是Marmalade SDK Engine,则会收到此警告(它们将在9月修复).

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:

其他C标志中,您可以放置​​标志: -fPIC

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

其他警告标记中,您可以输入: -Wl,-emit-relocs -Wl,-warn-shared-textrel

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

要查看您的应用程序是否为PIE:

To see if your app is PIE:

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

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

这篇关于位置独立可执行文件的正确Xcode设置是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆