如何构建利用X code 3.2.2 OSX通用二进制文件(PPC / I386)? [英] How do I build Universal binaries (ppc/i386) using Xcode 3.2.2 for OSX?

查看:169
本文介绍了如何构建利用X code 3.2.2 OSX通用二进制文件(PPC / I386)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图建立工作项目通用二进制,但我似乎无法得到X code设置正确这样做。

I am trying to build a universal binary for a project at work, but I can't seem to get Xcode set up properly to do so.

我熟悉这方面苹果文档,但显然我没有正确地阅读它。

I am familiar with the Apple Documentation regarding this, but apparently I am not reading it correctly.

在X code编译问题的选项似乎是:

The Xcode build options in question seem to be:


  • 架构

  • 基础SDK

  • C / C ++编译器版本<​​/ li>
  • Mac OS X上部署目标

在我的设置,我有以下有效的体系结构:i386的PPC PPC64 ppc7400 PPC970的x86_64

In my settings I have the following Valid Architectures: i386 ppc ppc64 ppc7400 ppc970 x86_64.

如果我用下面的选项,我得到一个二进制的 386 PPC970

If I use the following options, I get a binary with i386 and ppc970:


  • 体系结构: I386 PPC

  • 基础SDK:的Mac OS X 10.5

  • C / C ++编译器版本: GCC 4.0

  • Mac OS X上部署目标:的Mac OS X 10.5

  • Architectures: i386 ppc
  • Base SDK: Mac OS X 10.5
  • C/C++ Compiler Version: GCC 4.0
  • Mac OS X Deployment Target: Mac OS X 10.5

我对这个几个问题:


  1. 为什么PPC970,而不是ppc7400(或简称PPC)?

  2. 有什么PPCS(PPC,PPC64,ppc7400,PPC970)有何区别?

  3. 如何获得任何的PPC二进制?

显然,我需要一个ppc7400二进制Mac mini上我们有测试工作。迷你拥有G4和运行OSX 10.5.8。从我可以告诉,与ppc7400作品二进制却没有一个只PPC970。

Apparently, I need a binary with ppc7400 to work on the Mac Mini we have for testing. The Mini has a G4 and is running OSX 10.5.8. From what I can tell, a binary with ppc7400 works but not one with only ppc970.

我都试过上面构建选项几种组合,其中包括改变我的基地SDK为10.4u。上述结构是,即使建立了唯一的一个。其它构建失败,不能识别的头文件或明确提供的#define常因。例如,如果我改变我的编译器与gcc 4.2,我得到的搜索STDARG.H因为#include_next指令,并以正确的头没有明确的路径错误。如果我放弃我的基地SDK 4.0,#定义FSIZE长长不再承认,尽管不改变任何包含

I have tried several combinations of the above build options, including changing my Base SDK to 10.4u. The above configuration is the only one that even builds. Other builds fail, often because of not recognizing header files or clearly available #defines. For example, if I change my compiler to gcc 4.2, I get errors searching for stdarg.h because of the #include_next directive and no clear path to correct headers. If I drop my Base SDK to 4.0, #define FSIZE long long is no longer recognized despite not changing any includes.

我真的AP preciate任何见解,你可以给我在此。

I'd really appreciate any insight you can give me on this.

修改更新

EDIT UPDATE

感谢您的信息。我现在明白了标志。但我得到一个奇怪的结果。

Thanks for the info. I understand the flags now. But I get a strange result.

这是我的构建标志现在:

These are my build flags now:

GCC_VERSION = 4.0
MACOSX_DEPLOYMENT_TARGET = 10.4
SDKROOT = macosx10.5
GCC_MODEL_TUNING = G3

GCC_VERSION = 4.0 MACOSX_DEPLOYMENT_TARGET = 10.4 SDKROOT = macosx10.5 GCC_MODEL_TUNING = G3

这会产生有拱'竞价排名'如由脂目标文件(.o)。所有包含库和框架,或者是'PPC'或'ppc7400(再次由脂所示)。但是,最后的版本是PPC970。

This produces object file (.o) that have arch 'ppc' as shown by lipo. All the included libs and frameworks are either 'ppc' or 'ppc7400' (again as shown by lipo). But, the final build is 'ppc970'.

我已经在这个非常小心,以确保我得到的一切。谁能想到一个原因PPC架构区别?

I have gone over this very carefully to ensure I got everything. Can anyone think of a reason for the ppc architecture differences?

我甚至这么远,创建一个新的项目(的Hello World),并将其链接到所有的库和第一个项目的框架了。你好构建为'竞价排名'而不是'PPC970。

I've even gone so far as to create a new project (Hello World) and link it to all the libs and frameworks of the first project. Hello builds as 'ppc' not 'ppc970'.

这只是没有任何意义了我。

This just makes no sense to me.

推荐答案

PPC970 == G5 。如果你需要支持早在 G4 然后只是建立 ppc7400

ppc970 == G5. If you need to support as far back as the G4 then just build for ppc7400.

而不是单独的架构设置搞乱,不过,你可以选择 32位通用(或标准(32/64位通用),如果合适的话),从弹出菜单中,而且应该给你你所需要的。

Rather than messing with individual architecture settings, though, you can just select 32-bit Universal (or Standard (32/64-bit Universal), if appropriate) from the popup menu, and that should give you what you need.

这篇关于如何构建利用X code 3.2.2 OSX通用二进制文件(PPC / I386)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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