Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 827550

Summary: mail-filter/rspamd overrides default linker
Product: Gentoo Linux Reporter: Thomas Arnett <tom_gentoo>
Component: Current packagesAssignee: Christian Roessner <c>
Status: RESOLVED FIXED    
Severity: normal CC: arkamar, ionen, proxy-maint, sam
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/23127
Whiteboard:
Package list:
Runtime testing required: ---

Description Thomas Arnett 2021-11-26 20:12:05 UTC
mail-filter/rspamd-3.1 automatically uses lld or gold if installed. This produces misleading error messages if incompatible flags are used (e.g., "Your system does not support getaddrinfo call, please consider upgrading it to run rspamd").

It's possible to work around this by setting MYCMAKEARGS="-DLINKER_NAME=bfd" via package.env, but this isn't well-documented. Also, bug 606124 suggests packages should use the default linker.

Is it safe to assume the default linker is bfd if tc-ld-is-gold and tc-ld-is-lld return false?
Comment 1 Ionen Wolkens gentoo-dev 2021-11-27 04:43:40 UTC
I think it'd be best to remove the check rather than analyze what the intended LD is (e.g. perhaps user has a more obscure -fuse-ld=mold).

It doesn't seem to do anything special with LINKER_NAME beside force -fuse-ld=${LINKER_NAME}

While could just remove that bit.. the entire cmake/Toolset.cmake seem unnecessary to me (adding -O3 and toolchain checks that the users should be controlling).

I tried adding this to src_prepare:
    > cmake/Toolset.cmake || die

Seems to work (removes -O3, -fuse-ld, etc..), but I didn't fully test -- leaving it up to the maintainers to decide how to handle this.
Comment 2 Petr Vaněk gentoo-dev 2021-11-30 14:10:14 UTC
I have had the linker related part removal in my stash for some time, but emptying cmake/Toolset.cmake seems to be better. Thanks, PR is ready.
Comment 3 Larry the Git Cow gentoo-dev 2021-12-01 20:02:35 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45c18da33fe7f9ec1d9eb61d8c60406a867c63bb

commit 45c18da33fe7f9ec1d9eb61d8c60406a867c63bb
Author:     Petr Vaněk <arkamar@atlas.cz>
AuthorDate: 2021-11-29 18:37:39 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-12-01 20:02:18 +0000

    mail-filter/rspamd: respect user compiler flags choice
    
    The Toolset.cmake file seems to be unnecessary, it tries to control
    flags which in Gentoo should be controlled by user. This applies a
    change suggested in [1].
    
    [1] https://bugs.gentoo.org/827550#c1
    
    Closes: https://bugs.gentoo.org/827550
    Signed-off-by: Petr Vaněk <arkamar@atlas.cz>
    Closes: https://github.com/gentoo/gentoo/pull/23127
    Signed-off-by: Sam James <sam@gentoo.org>

 mail-filter/rspamd/rspamd-3.1.ebuild  | 2 ++
 mail-filter/rspamd/rspamd-9999.ebuild | 2 ++
 2 files changed, 4 insertions(+)