我已经让编译阶段工作了。要做到这一点:
- 在/Developer/Library/Xcode/Plug-ins中
- cp "GCC 4.2.xcplugin" "GCC Arm 4.4.1.xcplugin"
- cd "GCC Arm 4.4.1.xcplugin"/Contents
- 修改Info.plist(可能不是严格必要的)
8c8
- com.apple.xcode.compilers.gcc.arm-4_4_1
---
+ com.apple.xcode.compilers.gcc.4_2
12c12
- GCC Arm 4.4.1 Compiler Xcode Plug-in
---
+ GCC 4.2 Compiler Xcode Plug-in
- cd Resources
- mv "GCC 4.2.xcspec" "GCC Arm 4.4.1.xcspec"
- 修改“GCC Arm 4.4.1.xcspec”
10c10
- Identifier = "com.apple.compilers.gcc.arm-4_4_1";
---
+ Identifier = "com.apple.compilers.gcc.4_2";
13,16c13,16
- Name = "GCC Arm 4.4.1";
- Description = "GNU Arm C/C++ Compiler 4.4.1";
- Version = "arm-4.4.1";
---
+ Name = "GCC 4.2";
+ Description = "GNU C/C++ Compiler 4.2";
+ Version = "4.2";
39c39
- "com.apple.compilers.gcc.headers.arm_4_4_1",
---
+ "com.apple.compilers.gcc.headers.4_2",
42c42
- ExecPath = "$(PLATFORM_DEVELOPER_BIN_DIR)/gcc-arm.4.4.1";
---
+ ExecPath = "$(PLATFORM_DEVELOPER_BIN_DIR)/gcc-4.2";
48,49c48,49
- SupportsZeroLink = No;
- "SupportsPredictiveCompilation" = No;
---
+ SupportsZeroLink = Yes;
+ "SupportsPredictiveCompilation" = Yes;
52,53c52,53
- "SupportsMacOSXDeploymentTarget" = No;
- "SupportsMacOSXMinVersionFlag" = No;
---
+ "SupportsMacOSXDeploymentTarget" = Yes;
+ "SupportsMacOSXMinVersionFlag" = Yes;
88a89,90
- "-arch",
- "$(value)",
将编译器链接到/Developer/usr/bin/gcc-arm.4.4.1。
由于维基百科的重新格式化,上述差异并不完全准确,但相关信息已经在那里。我注意到的关键部分(以及您上面似乎弄错了的地方)是标识符更改必须与版本号更改相对应(用“_”替换“.”)。
去掉-arch参数可以用于编译,但不能用于链接。由于我的gcc不接受此参数,我目前无法进行链接。除非我找到另一种解决方法,否则我可能会使用脚本来替代gcc可执行文件,以删除此选项。