[PATCH] D35338: Add the -fdestroy-globals flag

Ian Tessier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 26 13:07:09 PST 2018


itessier added a comment.

> That seems like a nice win and I like the convenience of this approach. That said I've just remembered that there's a thread on cfe-dev about this:
> [RFC] Suppress C++ static destructor registration
> I don't think a consensus was reached. From what I gather, some people think that the convenience of this flag makes it worth adding to clang, while others think that adding a non-standard compiler-specific flag is asking for trouble.

Given that firmware is a much different (or controlled) environment than a binary running on a full blown OS, would it be acceptable to name the flag -fbaremetal-destroy-globals, and only allow its use if the target triple's OS is set to none (e.g.: arm-**none**-eabi)?


https://reviews.llvm.org/D35338





More information about the cfe-commits mailing list