Comment # 23 on bug 1178453 from
Even without LTO the code is malformed.

Consider a C++ method which is marked as inline. Contrary to common belief this
does not force the compiler to actually inline the code (although often it is
true), but allows to have multiple definitions, all but one being discarded
during link time.

The C++ standard requires all these definitions to be identical sequences of
tokens (which is trivially true for e.g. headers included in different source
files). Given identical compiler options identical token sequences will result
in identical machine code, so which of this definitions is chosen does not
matter.

Now with different architecture flags you will end up with some definitions
which are heavily architecture dependent. The linker may or may not chose the
one definition which crashes with an AVX-incapable machine.

C++ inline methods are quite common, as each method defined in-class, and each
template method are implicitly inline.


There are two mechanisms which deals with this properly, either
function-multiversioning (FMV), and the HWCAPS approach used by the very latest
glibc.


You are receiving this mail because: