Why -O and -g in universal variants?

Salvatore Domenick Desiano sal at ri.cmu.edu
Sun Feb 25 17:44:05 PST 2007


o > designed and tested mostly at -O1, so Apple may know something we
o > don't.
o 
o Do you mean that -O2 (which normally produces faster and smaller code)
o should not be used?

I've seen programs that have trouble with -O2 and -O3, but only a small 
number and typically data-intensive programs like image manipulation. No 
reason you couldn't use it, but stability is very important to Apple, so 
I would follow their reccomendation for the default.

o > As for -g, Tiger has debugging facilities that send information to
o > Apple, and I could see this as providing hooks for Apple fetching
o > that information.
o 
o This is not specific to Apple. -g allows the compiler to produce
o debugging information. Such information is useful in bug reports
o when a program crashes and a backtrace is included in the report.

Agreed. I'm just suggesting that Apple's crash reporter on Intel may 
know how to use debug information and therefore explain why -g is on the 
TN.

o But it takes more disk space. Similarly, one may choose to strip 
o binaries or not. IMHO, the choice to do that or not should be a global
o option. Therefore those who have plenty of disk space could choose to 
o keep debugging information (in case a program crashes), and those who 
o are short of disk space could choose to remove them.

Maybe a global MP option to disable debugging info for people who are 
short on disk space and know what they're doing.

-- Sal
smile.

--------------
  Salvatore Domenick Desiano
    Doctoral Candidate
      Robotics Institute
        Carnegie Mellon University




More information about the macports-dev mailing list