将自定义编译器添加到 XCode 3.2
我有一个适用于 ARM Cortex-m3 的有效 gcc 4.3.3 工具链,并希望将其集成到 XCode 中。
有没有办法设置 XCode (3.2) 以使用此 gcc 工具链而不是内置的 GCC 4.2?
到目前为止我尝试过的: 我添加了 GCC 4.2.xcplugin
的修改副本,并更改了名称、版本和可执行路径。它显示在 XCode 中,但每当我将“C/C++ 编译器版本”设置为自定义编译器时,它都会失败
GCC_VERSION 的值“4.3.3”无效
似乎有效的版本号被硬编码在其他地方,因为即使当我删除原始的 GCC 4.2.xcplugin
时,值 4.2
仍然存在有效(但在“C/C++ 编译器版本”下拉列表中不再可见)。
I have a working gcc 4.3.3 toolchain for an ARM Cortex-m3 and would like to integrate it into XCode.
Is there a way to set up XCode (3.2) to use this gcc toolchain instead of the built-in GCC 4.2?
What I've tried so far:
I've added a modified copy of the GCC 4.2.xcplugin
and changed the name, version and executable path. It shows up in XCode but whenever I set the "C/C++ Compiler Version" to the custom compiler it fails with
Invalid value '4.3.3' for GCC_VERSION
It seems like the valid version numbers are hardcoded somewhere else because even when I remove the original GCC 4.2.xcplugin
, the value 4.2
remains valid (but is not visible in the "C/C++ Compiler Version" drop down anymore).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
仅供参考 - 我将 gcc 4.4 集成到最新的 Xcode 3.2.4 中,包括标志 - 请参阅博客 http://skurganov.blogspot.com /
FYI - I got gcc 4.4 integrated into latest Xcode 3.2.4 including flags - see blog at http://skurganov.blogspot.com/
我自己正在做这件事。
目前,看起来您必须继承内置的编译器引用规范。
添加以下键:
使插件正确加载。然而,由于苹果特定的编译器补丁,存在无效标志的问题。我现在正在研究那部分。
I'm working on this myself.
Currently, it's looking like you have to inherit a built in compiler ref spec.
Adding a key of:
Makes the plugin load correctly. However, there's the issue of invalid flags due to the apple specific compiler patches. I'm working on that part right now.
我已经让编译阶段开始工作了。为此:
由于 wiki 重新格式化,上面的差异并不准确,但相关信息是存在的。我注意到的关键部分(以及您在上面出现的错误)是标识符更改必须与版本号更改相对应(将“.”替换为“_”)。
摆脱 -arch 参数适用于编译,但不适用于链接。由于我的 gcc 不接受此参数,因此我目前无法链接。除非我找到另一种方法来解决这个问题,否则我可能会放入一个脚本而不是 gcc 可执行文件来删除此选项。
I've gotten the compile phase to work. To do this:
Due to wiki reformatting, the diff's above are not exact, but the relevant information is there. The critical piece that I've noted (and what you appear to have wrong above) is that the Identifier change must correspond with the version number change (with "." replaced with "_").
Getting rid of the -arch parameter works for compiles, but not for linking. Since my gcc won't accept this parameter I can't link at the moment. Unless I find another way to fix this, I'll probably put in a script instead of the gcc executable to yank out this option.