• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How do I build universal binaries for libraries with endian-specific code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I build universal binaries for libraries with endian-specific code


  • Subject: How do I build universal binaries for libraries with endian-specific code
  • From: Norm Schuster <email@hidden>
  • Date: Fri, 30 Sep 2005 16:33:59 -0700

Title: How do I build universal binaries for libraries with endian-specific code
I'm currently in the process of migrating to XCode and probably the biggest stumbling block is how to deal with c/c++ libraries that have endian-specific code that is included or removed at compile time.  For example:

#if __LITTLE_ENDIAN__
    // do this
#elif __BIG_ENDIAN__
    // do that
#endif

Apple's "Universal Binary Programming Guidelines" doesn't say much about this except "Use the __BIG_ENDIAN__ and __LITTLE_ENDIAN__ macros only if you must" but I fail to see how this works unless it builds two separate variants for running on PowerPC and Intel.  Can anyone enlighten me on how exactly this works.

Also, why didn't Apple just add another folder in the bundle containing two different executable files like it did with PEF and Mach-)?  Why not have a bundle structure like this:

/Contents/MacOSClassic/PEF_Executable_PPC
/Contents/MacOS/MachO_Exectuable_PPC
/Contents/MacOSIntel/MachO_Executable_Intel

This would have made more sense rather than having a "fat" application with no obvious way to make it leaner.

Thanks in advance.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How do I build universal binaries for libraries with endian-specific code
      • From: Eric Albert <email@hidden>
  • Prev by Date: Re: Xcode debugger has new magical powers?
  • Next by Date: Re: How do I build universal binaries for libraries with endian-specific code
  • Previous by thread: Re: Visual Diagrams & Relationships in Xcode
  • Next by thread: Re: How do I build universal binaries for libraries with endian-specific code
  • Index(es):
    • Date
    • Thread