According to the gcc man page, "-p" and "-pg" only work if you also specify them to the linker. I'm not sure we generally want to enable them though; I think they'll by default always generate profiler output (if properly enabled).