Closed eli-schwartz closed 2 months ago
Correct me if I'm misunderstanding, but utils/directory.h:46:8:
and input/./../utils/directory.h:46:8
are the exact same file, so it sounds like whatever build system gentoo is using is generating duplicate definitions for itself in the libsub_*.a files. Using the documented build process with -Werror=odr
compiles perfectly fine for me.
I doubt rTorrent will ever officially support gentoo's build system, but even if I wanted to help unofficially, there's not any information on how to reproduce.
Correct me if I'm misunderstanding, but
utils/directory.h:46:8:
andinput/./../utils/directory.h:46:8
are the exact same file, so it sounds like whatever build system gentoo is using is generating duplicate definitions for itself in the libsub_*.a files. Using the documented build process with-Werror=odr
compiles perfectly fine for me.I doubt rTorrent will ever officially support gentoo's build system, but even if I wanted to help unofficially, there's not any information on how to reproduce.
The best way to reproduce would be to open the attachment titled "full logs" and check for information on how to reproduce.
In short, Gentoo is not using an alternative build system, there's nothing specific to Gentoo here.
It's just running configure and make.
I would be happy to provide any additional details needed but if we can't agree on whether or not the official configure and make scripts were used then I'm not sure how much anything I say matters.
So there's no set of emerge commands I could run to quickly reproduce on a gentoo docker image or anything? I spent some time looking at the log, and tried docker run gentoo/stage3 "emerge --sync && emerge '=net-p2p/rtorrent-0.9.8-r2::gentoo'"
, but didn't get any error. Trying to adapt the configure command to my system would be possible but also seems pretty tedious (not to mention trying to match toolset versions), so if there's an easier way it would be greatly appreciated.
In the Gentoo container, if you add these flags to /etc/portage/make.conf
as part of CFLAGS / CXXFLAGS / LDFLAGS, it should demonstrate the issue:
-flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing
Note: -flto is needed to produce LTO code generation, and the -Werror=* flags cause the link-time "lto-wrapper" based codegen to fatally error when safety constraints are violated.
In principle it should reproduce with a plain configure and make, when using those flags. I hastily tried that with rtorrent from a git clone, but it didn't appear to compile due to libtorrent version differences and I didn't have time right then to chase that down.
"Probably", using those flags on your own system with your own toolset versions and whatever configure command you usually use, would be enough too.
I gave it enough of an effort to ensure that it's really LTO shenanigans at play, rather than a true ODR violation. It doesn't seem insurmountable, so maybe I'll take another shot later, but all the solutions I found didn't seem to be worth the increase in complexity.
@eli-schwartz I resolved this issue in my version of rTorrent. The fix was very simplistic. It will build with LTO now on Gentoo Linux. https://github.com/stickz/rtorrent/commit/6332d392318079fd3fd5504a549d4f992ce50005
Just need to run git clone if you're interested and follow the build instructions: git clone https://github.com/stickz/rtorrent
https://github.com/stickz/rtorrent
Cool :) is there a PR including that commit?
Cool :) is there a PR including that commit?
No, I had to rebuild the repo to get the commit history. There's just a commit.
Thanks for the PR and for the new release -- I've pinged our package maintainer to take a look at packaging the update.
Thanks for the PR and for the new release -- I've pinged our package maintainer to take a look at packaging the update.
@eli-schwartz You'll need to backport a couple patches that have already been merged into upstream. This will fix the builds for Gentoo Linux and create a stable experience. https://github.com/rakshasa/rtorrent/commit/c1d076f1822752d4956a884a9aa9e6b0026b11f3 and https://github.com/rakshasa/rtorrent/commit/38b39bdafc9edd7e7e72672e6fcbd397b6c2cab8
If you create two patches for these, the v0.10.0
release will be more stable than v0.9.8
.
@eli-schwartz You'll need to backport a couple patches that have already been merged into upstream. This will fix the builds for Gentoo Linux and create a stable experience. c1d076f and 38b39bd
The second commit looks unnecessary except inasmuch as running autoreconf -fi
for rtorrent is, I guess, not supposed to depend on installing additional maintainer dependencies such as autoconf-archive. It is possible to ship those macros only in release tarballs and not in git, depending on how a project maintainer handles the usual workflow.
@stickz the first commit looks unnecessary too. rtorrent is a program, not a libtool library. The commit adds LT_INIT and invokes the libtool machinery to compile and link the /usr/bin/rtorrent binary instead of directly running the compiler -- dependencies are anyways fetched via pkg-config.
I don't see how using LT_INIT can fix static building. The resulting ./configure --enable-static --enable-shared
options aren't even utilized for building binaries, only for building libraries, which would matter for libtorrent, not rtorrent.
It's a bit slower to build using the libtool proxy and I don't see any benefit to using it here. And if I wanted a static build of rtorrent, I would simply build libtorrent with --enable-static --disable-shared
and then compile rtorrent with LDFLAGS="-static".
Full logs: build.log Downstream report: https://bugs.gentoo.org/861848