On Jul 27, 2010, at 3:13 PM, Jeff Squyres wrote:
> On Jul 27, 2010, at 5:02 PM, Barrett, Brian W wrote:
>> Yes, but say I'm using a custom built version of gcc that doesn't do -gstabs quite right. Now you've screwed me.
> The configure test checks to see if -gstabs+ is accepted by the compiler.
Yes, but acceptance and usefulness are not the same thing.
If the TARGET_VERSION is 10.3, the compiler will accept -gstabs, but the executable won't be debugable on 10.3, because 10.3 didn't use gstabs. So I really, really want -g and you've just prevented me from doing what I want. That's not just bad, it's awful.
>> I'm a firm believer that our configure script should do what the user says, as exactly as possible. Changing AC behavior a little bit is a gray area, but one I'm almost ok with (since AC_PROG_CC will add -g if CFLAGS is empty).
> We override that, though -- we take out that -g if CFLAGS was empty.
> I understand what you're saying, and in general I agree -- that we should add as little as possible to what the user said. But I don't quite know how to balance:
> * adding as few flags as possible
> * making debugging symbols work for those of us who aren't familiar enough with OSX to know that you need the special/secret -gstabs+ flag (and just expect -g to be enough)
> I've been developing POSIX software on a Mac for several years (i.e., not Mac-specific software, so I never dived into the details of Mac-specific functionality) and fell into the 2nd category until about a week ago.
> Got any suggestions?
Yes, don't cause problems - if the user specified -g, assume he meant -g. I understand what you're saying, but I'm against changing what the user specified because we know better. We usually don't, and in this case, there are known use cases where that's true.
Brian W. Barrett
Dept. 1423: Scalable System Software
Sandia National Laboratories