Why -O and -g in universal variants?

Salvatore Domenick Desiano sal at ri.cmu.edu
Sun Feb 25 08:12:48 PST 2007


o > Neither of those seem to me to have any
o > bearing on a universal binary. That is: if -g or -O are useful, then
o > they would be useful for all ports at all times, and not just in the
o > +universal variants of some ports.
o 
o You are absolutely right about the whole thing. I don't understand why
o "-g -O" are used in the example. They could as well have added
o "-funroll-loop -fanother-option etc." and hundreds other gcc flags
o that are irrelevant to a universal build to confuse readers even more.

Peering into the minds of Apple's documentation writers (I know, my 
eyes will be burned), there may be a reason for this. -O turns on 
optimization. The default is -O0 (no optimization), and there are 
libraries that actually fail when built that way. The compiler is 
designed and tested mostly at -O1, so Apple may know something we don't.

As for -g, Tiger has debugging facilities that send information to Apple, 
and I could see this as providing hooks for Apple fetching that 
information.

I am just speculating, but I would follow the TN unless given a reason 
to do otherwise.

-- Sal
smile.


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




More information about the macports-dev mailing list