Can Xcode build and intel-only app?

Discussion in 'Mac Programming' started by tuartboy, Apr 19, 2006.

  1. macrumors 6502a

    tuartboy

    Joined:
    May 10, 2005
    #1
    I'm running PPC and have no access to an intel mac as of now. I know the standard is universal binaries and I thought that it was possible to build PPC only or universal, but not just for intel (using Xcode as I know you can just use GCC). Other than 1 sentence in wikipedia, google has failed me and I know somebody knows so:

    Is it possible to build an app in Xcode for just x86?
     
  2. macrumors regular

    Joined:
    Sep 29, 2005
    #2
    There are applications that are Intel-only, such as Parallels Workstation and the experimental builds of VLC. So I think it is possible for Apple Xcode to compile for Intel processors only.
     
  3. macrumors 603

    gekko513

    Joined:
    Oct 16, 2003
  4. macrumors 68030

    Benjamindaines

    Joined:
    Mar 24, 2005
    Location:
    A religiously oppressed state
    #4
    Yes, open info on the project, double click Architecture and just check the Intel box.
     
  5. thread starter macrumors 6502a

    tuartboy

    Joined:
    May 10, 2005
    #5
    did it used to not allow it?

    Now I'm wondering why I thought this?
     
  6. macrumors 68030

    Benjamindaines

    Joined:
    Mar 24, 2005
    Location:
    A religiously oppressed state
    #6
    Ever since Xcode 2 you have been able to build Intel only apps. You probably thought that you couldn't because Apple just advertised that you can do universal binaries.
     
  7. thread starter macrumors 6502a

    tuartboy

    Joined:
    May 10, 2005
    #7
    I just swear it used to be either PPC or PPC/Intel.

    Either way, I stand corrected.

    Thanks for the info!
     
  8. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #8
    A real world example of Intel-only .apps made from Xcode: Apple's firmware updates for their Intel Macs.
     
  9. macrumors newbie

    Joined:
    Nov 27, 2005
    Location:
    Where the land meets the sea.
    #9
    You can also strip universal apps of their x86 or PPC code. (Useful if your running low on disk space, or do not want an application running on a certain architecture)

    To get rid of x86 code, type the following into the terminal:
    Code:
    ditto --rsrc --arch ppc Safari.app Safari_PPC.app
    To get grid of PPC code, type:
    Code:
    ditto --rsrc --arch x86 Safari.app Safari_x86.app
     
  10. macrumors 6502

    Joined:
    Sep 27, 2005
    #10
    I Hope NOT!

    Apple should have made compiling Universal Binaries for PowerPC mandatory until the last PowerPC ships and for at least two years after that. Anyone who only compiles for Intel, when Xcode can compile for both will not get my money--ever.
     
  11. Guest

    caveman_uk

    Joined:
    Feb 17, 2003
    Location:
    Hitchin, Herts, UK
    #11
    Why should it be mandatory? There are perfectly good reasons why, on occasions, one would not want a PPC binary as it would be irrelevant (the Parallels VM was given as an example earlier). Developers are not stupid and if there is still a commercially worthwhile market in making a universal binary most will continue to do so.
     
  12. macrumors 604

    Joined:
    Sep 23, 2003
    #12
    It would be impossible and impractical to make it mandatory. Some apps use features that are specific to certain hardware and simply won't run on other hardware. Checking a box isn't going to magically add compatibility.
     
  13. macrumors 68030

    Benjamindaines

    Joined:
    Mar 24, 2005
    Location:
    A religiously oppressed state
    #13
    I would advise against that... it can make some apps unusable.
     
  14. macrumors newbie

    Joined:
    Nov 27, 2005
    Location:
    Where the land meets the sea.
    #14
    Oh yes, I believe that is a given. I cannot imagine many situations where one would want to build just a PPC or just an x86 program; but the option is there, just in case someone finds it useful. :)
     
  15. macrumors 6502a

    Sayer

    Joined:
    Jan 4, 2002
    Location:
    Austin, TX
    #15
    Developing for both PPC and Intel Macs will significantly increase development costs, as the software will need to be tested on two completely different hardware setups with two divergent OSes.

    While Mac OS X is making it less-painful to develop for Intel CPUs, it is not as simple as checking a box in Xcode.

    File formats that were designed with Big-endianness in mind need to be carefully handled on the Little-endianness Macs and vice versa. Network-transmitted data may need to be swapped depending on the CPU in use by the app.

    Lastly any low-level (assembly) optimizations will need to be duplicated for the other platform in hardware-specific ISA.

    I predict that once the Power Mac and Xserve are Intel-CPU a lot of PowerPC/Universal apps will drop off with the next major version releases from some of the bigger/more popular developers. At that point the PowerPC-based Mac will be seen merely as a legacy system only and serious thought will need to be given to the increased cost of developing, testing and supporting a dead-end platform.

    If you think not, take a look at what happened to Be when the Be OS went Intel-native after being PowerPC-only in software and hardware since its creation.
     
  16. macrumors 603

    janey

    Joined:
    Dec 20, 2002
    Location:
    sunny los angeles
    #16
  17. macrumors 68000

    Joined:
    Oct 8, 2003
    #17
    All these issues can be avoided easily by good programming practice and using the Frameworks provided by Apple. For example, endianness of data shouldn't be an issue because you should be using CoreData/XML/something else to store your data, no writing raw bytes to a file.

    Plenty of software is developed to not care about endianness (like most Open Source software, that doesn't necessarily know what kind of CPU its going to be compiled on). A little bit of extra care goes a long way towards making programs that are not only portable, but will end up being easier to maintain for the future.
     
  18. Guest

    caveman_uk

    Joined:
    Feb 17, 2003
    Location:
    Hitchin, Herts, UK
    #18
    Whilst you're right about increased testing costs of having a universal binary, I would suggest that once the developer has invested time in creating the universal binary in the first place the major expenditure has been made. The cost of maintaining both builds is rather lower than the initial expense.

    As another reply as said you can give a lot of the lower level endianness rubbish to Apple to sort out. Currently I only have one piece of code (in-house for the time being) that has to deal with endianness issues as it decodes a binary file format created by a windows program. Apple supplies routines to swap most C types (except float as far as I can see).

    I can see the real drop off coming after Apple drops PPC in Mac OS. The smaller third party developers generally write new apps for the current OS and support just the current OS and the previous version in existing apps. I expect Leopard to be the last PPC OS.
     

Share This Page