Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 781137 - dev-lang/spidermonkey-78.9.0: try to add ARCH=riscv support
Summary: dev-lang/spidermonkey-78.9.0: try to add ARCH=riscv support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: riscv Linux
: Normal normal
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-04-08 14:17 UTC by Yixun Lan
Modified: 2021-05-21 16:20 UTC (History)
2 users (show)

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


Attachments
ful build log for dev-lang/spidermonkey-78.9.0 (build.log.xz,4.25 KB, application/x-xz)
2021-04-08 14:20 UTC, Yixun Lan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yixun Lan archtester gentoo-dev 2021-04-08 14:17:20 UTC
keep track of adding ARCH=riscv support, current it just fail (not found riscv in the list)

Reproducible: Always
Comment 1 Yixun Lan archtester gentoo-dev 2021-04-08 14:20:00 UTC
Created attachment 698589 [details]
ful build log for dev-lang/spidermonkey-78.9.0
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2021-04-08 15:43:04 UTC
It will also require rust in the end. Are you working on riscv rust support?
Comment 3 Yixun Lan archtester gentoo-dev 2021-04-10 07:37:17 UTC
(In reply to Thomas Deutschmann from comment #2)
> It will also require rust in the end. Are you working on riscv rust support?

Yes, I've filed a bug for dev-lang/rust, see bug #747460

For the first step, I'd like to try spidermonkey with dev-lang/rust-bin, since rust upstream already have binary releases for riscv and seems work fine here (haven't pushed to main portage tree).
Comment 4 tt_1 2021-05-07 15:36:50 UTC
@Yixun Lan: you can try to use this approach to emerge a riscv cross compile std: 
https://github.com/gentoo/gentoo/blob/master/dev-lang/rust/rust-1.51.0-r2.ebuild#L395

you will need a cross-gcc toolchain for linking and to drop an env file as per instructions above. have fun! 8)
Comment 5 Yixun Lan archtester gentoo-dev 2021-05-14 06:26:25 UTC
@whissi 

the rust support for riscv has been pushed to main portage tree
how about let's make spidermonkey work for riscv64/lp64d?

and there are four patches needed to achieve this

patch 1-3 are from upstream
https://hg.mozilla.org/mozilla-central/rev/06d7e1b6b7e7
https://hg.mozilla.org/mozilla-central/rev/ec48f15d085c
https://hg.mozilla.org/mozilla-central/rev/6803dda74d33

patch 4: switch lp64d ABI, since upstream dev-lang/rust hardcoded to lp64d, currently the only working profile in portage is riscv64/lp64d..
--- a/third_party/rust/cc/src/lib.rs
+++ b/third_party/rust/cc/src/lib.rs
@@ -1591,7 +1591,7 @@ impl Build {
                         // ABI is always soft-float right now, update this when this is no longer the
                         // case:
                         if arch.starts_with("64") {
-                            cmd.args.push("-mabi=lp64".into());
+                            cmd.args.push("-mabi=lp64d".into());
                         } else {
                             cmd.args.push("-mabi=ilp32".into());
                         }
Comment 6 Larry the Git Cow gentoo-dev 2021-05-21 16:20:45 UTC
The bug has been closed via the following commit(s):

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

commit 86d7476adb786a9ecf3c40bb2ae40b2bb5f7ad9c
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2021-05-21 16:02:36 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2021-05-21 16:16:38 +0000

    dev-lang/spidermonkey: add initial Linux/RISC-V support
    
    Closes: https://github.com/gentoo/gentoo/pull/20813
    Closes: https://bugs.gentoo.org/781137
    Package-Manager: Portage-3.0.18, Repoman-3.0.3
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

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