Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 792246 - dev-lang/spidermonkey: don't force gold for USE="lto -clang"
Summary: dev-lang/spidermonkey: don't force gold for USE="lto -clang"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL: https://sourceware.org/git/?p=binutil...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-26 14:04 UTC by David Michael
Modified: 2022-01-22 09:00 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (spidermonkey-91.5.0:20220119-110858.log,447.53 KB, text/plain)
2022-01-19 11:17 UTC, Joonas Niilola
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Michael 2021-05-26 14:04:55 UTC
The gold linker does not exist for some architectures (see link), which causes the build to fail.  This is currently affecting riscv builds.  Spidermonkey works when built with bfd, and I don't see reasons for forcing gold in the log, so can this just be dropped?

https://github.com/gentoo/gentoo/blob/master/dev-lang/spidermonkey/spidermonkey-78.10.1.ebuild#L330
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2021-05-27 15:13:06 UTC
1) Spidermonkey is a subset of firefox and we try to keep both ebuilds in sync as much as possible for easier maintenance.

2) Mozilla build system has some kind of auto-magic for linker we need to avoid to get reproducible rebuilds/same results.

3) The shown ebuild line is coming from firefox ebuild and is lacking one important comment which is still true -- at least for firefox:

> # Linking only works when using ld.gold when LTO is enabled

At the moment I have no plans to remove this restriction because spidermonkey/firefox are high profile packages where we would be unable to keep up with all possible configurations. Can't you switch to CLANG for LTO on RISC-V?
Comment 2 Joonas Niilola gentoo-dev 2021-05-28 13:28:10 UTC
I've attempted to update 78 to use bfd with lto, 
https://gitweb.gentoo.org/repo/gentoo.git/commit/www-client/firefox?id=6e1336c323be59b95638986c74462562635a9a94

but reverted because it still produces runtime issues even though it compiles just fine,
https://gitweb.gentoo.org/repo/gentoo.git/commit/www-client/firefox?id=405c1fc37a672c83f3f2c10031afa501dc5084bc

>=81 or so fully drops the gold requirement upstream, so we'll get it for the next ESR.
Comment 3 David Michael 2021-05-28 14:13:24 UTC
I haven't encountered runtime issues, so I will just continue with EXTRA_ECONF="--enable-linker=bfd" until spidermonkey-91 then.
Comment 4 Joonas Niilola gentoo-dev 2022-01-18 06:41:02 UTC
With 91.5.0 I couldn't get lto to work with either bfd or gold linker. Passed with lld in the end. It was a rust-related "static linking" failure and therefore a bit hard to debug from portage, but I should try building outside portage if that gives some answers.
Comment 5 tt_1 2022-01-18 17:45:40 UTC
can you paste the error here, please?
Comment 6 Joonas Niilola gentoo-dev 2022-01-19 11:17:38 UTC
Created attachment 762626 [details]
build.log

Here's the build.log. If someone sees anything, happy to try things out! Works with lld, fails with gold and bfd.
Comment 7 tt_1 2022-01-20 17:44:41 UTC
yes, I had same compile error as you for longer time now (I regulary test spidermonkey compile with an own hacky ebuild) 

I will dive into it a bit, maybe its possible to find a solution.
Comment 8 Larry the Git Cow gentoo-dev 2022-01-22 09:00:09 UTC
The bug has been closed via the following commit(s):

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

commit d85af4050717832975fe735a7c6bbf73359fe654
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2022-01-22 08:57:46 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2022-01-22 09:00:01 +0000

    dev-lang/spidermonkey: update patch set for 91.5.0
    
     - disable some gcc-specific sanity checks (since they're not ran for
       clang either),
     - disable -Werror=format.
    
    Closes: https://bugs.gentoo.org/792246
    Closes: https://bugs.gentoo.org/831501
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 dev-lang/spidermonkey/Manifest                   | 2 +-
 dev-lang/spidermonkey/spidermonkey-91.5.0.ebuild | 5 +----
 2 files changed, 2 insertions(+), 5 deletions(-)