LTO Optimization with asm renames of intrinsic functions
Paul E Murphy
Wed Aug 12 22:26:35 GMT 2020
I ran into a slight divergence of behavior when enabling LTO using GCC
10.2 or newer when building libdfp on x86 and ppc64.
Libdfp builds a copy of libdecnumber which exports its own copy of ABI
as specified for _Decimal types in the GCC documentation. Some of this
ABI is implicitly used in libdfp to implement various facilities.
These intrinsic calls generate PLT calls which should resolve to
symbols provided by libdfp. However, libdfp tries to avoid these
by inserting asm renames of the form:
asm ("__bid_floatsidd = __GI___bid_floatsidd");
Where the libdfp copy of such symbols are prefixed with __GI_ using
the trick inherited from glibc.
This creative workaround has worked with lto disabled, but
when enabled, it is effectively ignored. Is there a more robust way
to bypass plt calls for intrinsic functions when using LTO?
More information about the Gcc-help