• 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: Stripping out unused code from linked static library
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stripping out unused code from linked static library


  • Subject: Re: Stripping out unused code from linked static library
  • From: Dimitri Schoolwerth <email@hidden>
  • Date: Sat, 02 Apr 2011 18:18:17 +0400

On Sat, Apr 2, 2011 at 5:21 PM, Darrell Blake <email@hidden> wrote:
>> 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.
>
> Cool, thanks. Just enabled the -dead_strip option and it's now down to
> 30mb. I'm probably not going to get it much smaller than that, am I?

My wxWidgets apps are around 20-25 MB using wx 2.9 (x86_64+i386+PPC,
using Cocoa) and 10-15 MB with wx 2.8 (i386+PPC, using Carbon).
If you're on wxWidgets 2.9+ asserts by default are always enabled. In
your wx/setup.h you might then want to set wxDEBUG_LEVEL to 0 for
Release mode. Disabling features such as XRC and AUI may also help if
you don't use them. Furthermore I have these in my .xcconfig file for
Release mode:

"
DEAD_CODE_STRIPPING = YES
KEEP_PRIVATE_EXTERNS = NO

GCC_SYMBOLS_PRIVATE_EXTERN = YES
GCC_INLINES_ARE_PRIVATE_EXTERN = YES
GCC_GENERATE_DEBUGGING_SYMBOLS = NO
"

You can also change these through the Build Settings in Xcode by
searching for the names.


Regards,
Dimitri
 _______________________________________________
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: Stripping out unused code from linked static library
      • From: Darrell Blake <email@hidden>
References: 
 >Stripping out unused code from linked static library (From: Darrell Blake <email@hidden>)
 >Re: Stripping out unused code from linked static library (From: Jonas Maebe <email@hidden>)
 >Re: Stripping out unused code from linked static library (From: Darrell Blake <email@hidden>)

  • Prev by Date: Re: Stripping out unused code from linked static library
  • Next by Date: Re: XCode 3 and XCode 4 on the same machine
  • Previous by thread: Re: Stripping out unused code from linked static library
  • Next by thread: Re: Stripping out unused code from linked static library
  • Index(es):
    • Date
    • Thread