[PATCH] D18095: Add __attribute__((linkonce_odr_linkage))

John McCall via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 12 11:50:49 PST 2016


rjmccall added a comment.

Okay, first off, linkonce_odr is not an acceptable term to be introducing as an attribute name.  If we need this, we can find some way to describe it that isn't a random internal compiler term.

More importantly, I don't understand how your problem is solved by linkonce_odr linkage.  linkonce_odr linkage is just a form of weak linkage that allow useful transformations by the compiler (specifically: the compiler can freely drop the function if it isn't being used, and it can assume that all the implementations are semantically equivalent).  If you make a library with a bunch of architecture-specific linkonce_odr implementations of a function, the linker will still just pick one randomly; it won't allow them to co-exist.


Repository:
  rL LLVM

http://reviews.llvm.org/D18095





More information about the cfe-commits mailing list