Re: Stripping out unused code from linked static library
Re: Stripping out unused code from linked static library
- Subject: Re: Stripping out unused code from linked static library
- From: Jonas Maebe <email@hidden>
- Date: Sat, 02 Apr 2011 15:09:30 +0200
On 02 Apr 2011, at 15:01, Darrell Blake wrote:
> I've been trying to think of ways to get the binary size down and
> something that came to mind is that I know in Visual Studio in Windows
> if you select a high enough optimisation level it only uses the code
> from linked static libs that it has to. I'm assuming there's something
> similar in XCode (or GCC) but no matter what I change (I've tried all
> the "optimization level" settings) it's spitting out binaries around
> 36mb every time.
The linker will by default only link in object files from the static library that contain symbols referenced by the application. If you want the selection to happen at symbol rather than at object level granularity, enable dead code stripping in Xcode. This corresponds to the gcc option -Wl,-dead_strip (= linker option -dead_strip). It's probably already enabled by default in Xcode though.
Jonas _______________________________________________
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