'Is there any way to tell the compiler that any shared library or executable involved in a process has been build for a certain architecture?

I assume the following:

  1. calling into a function, which does not reside in the current object file, the compiler needs to consider that this called function was (likely) not built for the same architecture and do such nasty things as VZEROUPPER and cannot keep things in registers meanwhile.

Is there any way to tell the compiler, that this is not the case?

g++


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source