open-eid / DigiDoc4-Client

DigiDoc4 is an application for digitally signing and encrypting documents; the software includes functionality to manage Estonian ID-card - change pin codes etc.
https://www.id.ee/en/article/install-id-software/
Other
119 stars 42 forks source link

Fix LTO linking #1110

Closed metsma closed 2 years ago

metsma commented 2 years ago

Signed-off-by: Raul Metsma raul@metsma.ee

klemensn commented 1 year ago

This breaks the build on OpenBSD:

$ c++ --version
OpenBSD clang version 13.0.0
Target: amd64-unknown-openbsd7.2
Thread model: posix
InstalledDir: /usr/bin
: && /usr/ports/pobj/qdigidoc4-4.2.14/bin/c++ -O2 -pipe -DNDEBUG -flto=thin -Wl,-rpath,/usr/local/lib/pkcs11 -Wl,-object_path_lto,lto.o client/CMakeFiles/TSLDownload.dir/TSLDownload_autogen/mocs_compilation.cpp.o client/CMakeFiles/TSLDownload.dir/TSLDownload.cpp.o -o client/TSLDownload  -Wl,-z,origin,-rpath,/usr/local/lib  /usr/local/lib/libQt6Network.so.0.3  /usr/local/lib/libQt6Core.so.1.0  -pthread  -Wl,-rpath-link,/usr/X11R6/lib:/usr/local/lib && :
ld: error: cannot open lto.o: No such file or directory
c++: error: linker command failed with exit code 1 (use -v to see invocation)

As a temporary workaround, I've simply removed the added hunk and everything builds and links fine.

evaikene commented 1 year ago

Also breaks build on Linux with the same linker error, if CXX is set clang++.

metsma commented 1 year ago

Can you test #1146 pull request

evaikene commented 1 year ago

Can you test #1146 pull request

Yes that works on Arch Linux with CXX set to clang++

klemensn commented 1 year ago

Can you test #1146 pull request

Cherry-picking the following fixes the OpenBSD clang build, thanks: https://github.com/open-eid/DigiDoc4-Client/pull/1146/files#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20aL24-L28

The rest of this PR (qt{5 -> 6}-* package changes, internal version bump and changelog) seems entirely unrelated.