Fix the build of lib/libpmc and usr.sbin/pmc for gcc on amd64.
Details
- Reviewers
mmacy - Commits
- rS334957: pmc gcc fixups
make CROSS_TOOLCHAIN=amd64-gcc TARGET=amd64 buildworld
make buildworld
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 17127 Build 16983: arc lint + arc unit
Event Timeline
usr.sbin/pmc/Makefile | ||
---|---|---|
8–10 | @dim, I marked you as a subscriber in case you might have a comment on the right fix for this. We use -Wredundant-decls for gcc builds and so gcc complains about __throw_runtime_error in libc++. If you have an idea about which header ought to have the decl upstream (or some other fix) I can work up a patch for that. |
lib/libpmc/Makefile | ||
---|---|---|
11 | Rather use: CWARNFLAGS.gcc+= -Wno-error=shadow or better: CWARNFLAGS.gcc+= -Wno-shadow if the warning(s) are not actionable. | |
usr.sbin/pmc/Makefile | ||
8–10 | We're probably the only ones in the world compiling libc++'s headers with -Wsystem-headers, so these kind of warnings are only seen by us... In any case, shutting up the warning is fine with me, I never saw the value in warning about redundant declarations anyway: if they declarations are the same, it does not matter at all, and if they are different, it is (or at least should be) a compile error. Similar to above, you can use: CWARNFLAGS.gcc+= -Wno-error=redundant-decls or better: CWARNFLAGS.gcc+= -Wno-redundant-decls if the warnings are non-actionable. | |
usr.sbin/pmc/cmd_pmc_filter.cc | ||
235 | This kind of nastiness would not be needed if you'd use new[] and delete[]. ;-) |
lib/libpmc/Makefile | ||
---|---|---|
11 | Okay. I'll check that that works. The shadowing occurs in the API (name collision between public procedure name and structure name) and it's probably not worth making an API change to suppress this. | |
usr.sbin/pmc/Makefile | ||
8–10 | Right, it's a bit of a pain to maintain, since we don't specify the equivalent warning from clang. Maybe we should just stop specifying it for gcc. Anyway, my concern was that as FreeBSD grows more C++ code, we may run into this some more. Yes, this one is also not actionable. I'll test your suggestion. | |
usr.sbin/pmc/cmd_pmc_filter.cc | ||
235 | Yes... I made the minimal fix here because it wasn't clear to me where (or if???) this memory is freed--or if it is just leaked. |
usr.sbin/pmc/cmd_pmc_filter.cc | ||
---|---|---|
235 | You're welcome to "fix". But aggressively freeing things on exit() doesn't strike me as particularly good use of one's attention. |
usr.sbin/pmc/cmd_pmc_filter.cc | ||
---|---|---|
235 | Ah, it's only called once? No, I'll let it be, I'm just trying to get the build working, I'm not trying to police anything here :) |
Yes. I just want to make sure we're all clear on the magic of this thing called a 'process' for which the OS "garbage collects" its resources when it's done. ;-)