• 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
Re: conditionally linking to a static lib?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: conditionally linking to a static lib?


  • Subject: Re: conditionally linking to a static lib?
  • From: John Mikros <email@hidden>
  • Date: Thu, 8 Oct 2009 16:03:27 -0700


On Oct 8, 2009, at 2:34 PM, Greg Guerin wrote:


Maybe make an empty or do-nothing static lib for ppc. I'm not sure if you can get away with it being completely empty, so maybe this function, compiled for i386 and ppc:

  void nothing()
  {  ;  }

I'm not sure how I would do that without wrapping everything else in #ifdef __i386__
I would think that I can't just make a completely independent lib with the same name, because Xcode is looking for the one in the build products folder.



Or if the ppc app doesn't ever reference any of the functions residing in the i386-only lib, then just compile that lib for both ppc and i386. Since the ppc executable never references any symbol from the static lib, then it should never link any of the modules into the executable. The ppc-code doesn't even have to work; it's not referenced, so it won't be used. This exploits the inherently conditional nature of static libs, in which modules are only linked into an output if a symbol from it is referenced. If no module is referenced, then no module appears in the output.

We originally had it set up that way, but it ended up importing symbols that should have been dead stripped out, which in turn caused the app not to launch on older OS's on PPC.


thanks for the suggestions,
-john
_______________________________________________
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


References: 
 >Re: conditionally linking to a static lib? (From: Greg Guerin <email@hidden>)

  • Prev by Date: Re: Compiling a screen saver for Snow Leopard (10.6) and Leopard (10.5)
  • Next by Date: Re: conditionally linking to a static lib?
  • Previous by thread: Re: conditionally linking to a static lib?
  • Next by thread: Re: conditionally linking to a static lib?
  • Index(es):
    • Date
    • Thread