How to preserve debug flags?


It seems that when building with clang, Homebrew removes all debug option switches from the compiler command line. It looks like this action is performed from Library/Homebrew/shims/super/cc:refurbish_arg.

How to tell Homebrew -not- to trash these arguments from within a formula? Debug information may be very useful to … debug. I do not plan to create bottles with debug symbols, however these flags are sometimes unavoidable when rebuilding from source & HEAD to locate and troubleshoot an issue.


It’s not really a solution but as an alternative you can try running things interactively brew install -i <formula>