[CLN-list] Linking against cln fails when built with link-time-optimization

Richard B. Kreckel kreckel at in.terlu.de
Sun Oct 11 14:59:21 CEST 2020


On 27.09.20 00:09, Bruno Haible wrote:
>> The problem is *us* breaking the standard (ISO C++98) for performance reasons.
>> ...
>> To solve the problem properly we should either
>>
>> 1) Stop playing tricks and use the LTO. The bug report being discussed kind of proves that
>>      LTO actually works these days.
>> 2) Introduce `denominator_inline` and `denominator` and use the former in CLN itself
>>      (similarly to ce250e91fb8d16bc6b35be0add1896fc64f31ec1).
> 
> Thank you for this analysis; it's very clear. Yes, when possible, we want
> to avoid a function call for something that is just one or two instructions.
> 
> I vote for 2), using the technique that we already use for zerop_inline
> and minusp_inline.

Do we? Header file include/cln/rational.h declares
namespace cln { extern bool zerop(const cl_RA&x); }
and then src/rational/cl_RA.h defines that function as inline.

Then, src/rational/cl_RA_zerop.cc tries to force compilation of a text 
symbol for this function.

And likewise for minusp(const cl_RA &).

How does this satisfy the standard?

   -richy.
-- 
Richard B. Kreckel
<https://in.terlu.de/~kreckel/>


More information about the CLN-list mailing list