[PATCH] D18095: Add __attribute__((linkonce_odr_linkage))
John McCall via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 22 12:58:53 PDT 2016
rjmccall added a comment.
You still don't actually want linkonce_odr linkage. You don't want the weak definition to be inlined, so it can't be ODR, and you want to force it to be emitted in your library, so it can't be linkonce. You just want weak linkage. There's an existing attribute for that.
At best, you want a pass on your completed library to promote any still-weak definitions to strong. That is not something we can usefully support in an attribute; it needs a custom pass.
Dropping unused definitions from your library when it's linked into an actual application is just standard dead-code stripping and does not need a special linkage.
More information about the cfe-commits