osqp / qdldl

A free LDL factorisation routine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[openSUSE linux] libqdldl.a does not contain a non-empty .text section. The archive was not created with -ffat-lto-objects option.

kevinsmia1939 opened this issue · comments

Hello,
I'm trying to package qdldl to openSUSE Linux.

When I am trying to compile it, RPMLINT warn me about the error as seen below.

E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/libqdldl.a
 This archive does not contain a non-empty .text section.  
The archive was not created with -ffat-lto-objects option.

I don't really understand this error myself, but some documentation here.
https://en.opensuse.org/openSUSE:LTO#LTO_enablement_in_openSUSE:Factory

The documentation suggest adding %global _lto_cflags %{?_lto_cflags} -ffat-lto-objects but openSUSE maintainer suggest that it should be fix upstream.
Here is some more documentation on LTO
https://gcc.gnu.org/onlinedocs/gccint/LTO-Overview.html

Here is a openSUSE package building log: https://build.opensuse.org/package/live_build_log/home:andythe_great/qdldl/openSUSE_Tumbleweed/x86_64

Thanks.

I also do not understand the error, but this very similar issue seems relevant : OpenChemistry/avogadrolibs#455

From what I gather, this error basically means the static library doesn't contain any LTO symbol information, so when it is eventually linked into the final executable it won't be able to have any LTO optimizations applied to it across the library boundary. This doesn't stop its use as a library though, just the application of optimizations.

The part I don't get is, why is this an upstream issue? If OpenSUSE wants to enable LTO on packages and libraries, then it would make more sense for the flag to be added downstream where the actual -flto flag is being added to the build. This is also safer, since then it doesn't force the flag on other users who might not want it.

Hello,

I have ask RPMLINT dev and they explain here, quote,
rpm-software-management/rpmlint#458

It is because of LTO compilation the openSUSE does.

If it is not compiled with this option then stuff gets optimized away and things tend to completely break.

This can't be generalized as all the static libraries need to have this argument passed in their cflags. Yet another policy tho tells you 'no static libraries' so at the moment from all the packages in Tumbleweed I see 50 that need this tweaking.

In theory it can be fixed in upstream as well, as it is not SUSE specific but rather LTO specific thingy, but if the upstream does not care about link time optimalization then the global is pretty decent solution.

Also if you happen to have some wording suggestion that would improve the understanding for you please feel free to propose it here and we will gladly update the message in rpmlint.

Anyway, I think I will just add the flag %global _lto_cflags %{?_lto_cflags} -ffat-lto-objects to my spec file, and that should be ok.
Thanks.