On Sun, 2020-09-20 at 13:11 +0200, Atri Bhattacharya wrote:
Hello, When the shared library for CLN is built with link-time optimization [1] (LTO) enabled, linking against libcln.so fails (for example GiNaC fails to build). Turning off link-time optimization fixes the linking issue, but I wonder if this is a bug in CLN that needs fixing or a compiler issue and if we can build and use LTO enabled CLN in the future.
This issue was first reported [2] against openSUSE Tumbleweed which builds its packages with LTO flags by default; we are currently in the process of working around this by disabling the LTO flags specifically for CLN [3].
Thanks in advance for any suggestion as to how to fix TLO-enabled CLN builds or if indeed disabling LTO is the only way to go (at least for now). I maintain openSUSE's CLN and GiNaC packages.
To follow up on this, we found that the problem was us building the cln library with "-fvisibility-inlines-hidden" in combination with LTO. Turning off the "-fvisibility-inlines-hidden" flag has fixed this issue (even with LTO enabled). Please see the original bug report for a discussion: <https://bugzilla.opensuse.org/show_bug.cgi?id=1176710> if interested. Thanks in particular to Alexei for testing and commenting on my initial post. Cheers, -- Atri Bhattacharya