Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 794046 - dev-lang/go: request ARCH=riscv support
Summary: dev-lang/go: request ARCH=riscv support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-03 15:26 UTC by Yixun Lan
Modified: 2021-08-22 19:42 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yixun Lan archtester gentoo-dev 2021-06-03 15:26:50 UTC
I'm opening this bug mainly for tracking issue..

upstream only support riscv64 for now, below patch would work for me,
but may need to adjust the patch if we add riscv32 support in future 

--- go-1.16.4.ebuild    2021-05-22 09:39:35.000000000 +0800
+++ go-1.16.4.ebuild    2021-06-04 06:34:43.600000000 +0800
@@ -63,6 +63,7 @@
                x64-*)  echo amd64;;
                ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
                s390) echo s390x ;;
+               riscv) echo riscv64;;
                *)              echo "${portage_arch}";;
        esac
 }


Reproducible: Always
Comment 1 Marek Szuba archtester gentoo-dev 2021-06-25 12:37:18 UTC
We'll also need riscv tarballs for dev-lang/go-bootstrap here.
Comment 2 Larry the Git Cow gentoo-dev 2021-07-22 00:19:12 UTC
The bug has been referenced in the following commit(s):

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

commit ce93f9058c4336109e35afc150ff9677dabfaf05
Author:     Marek Szuba <marecki@gentoo.org>
AuthorDate: 2021-07-21 23:20:13 +0000
Commit:     Marek Szuba <marecki@gentoo.org>
CommitDate: 2021-07-22 00:19:06 +0000

    dev-lang/go: keyword 1.16.6 for ~riscv
    
    For the time being only rv64 is supported in tc-arch() -> GOARCH
    translation - which however is fine for now because upstream does not
    support rv32 out of the box yet.
    
    Builds, tests and installs fine - with the caveat that since riscv is
    not supported by dev-lang/go-bootstrap yet, it is necessary to start
    by cross-building a dev-lang/go somewhere where Go is already present.
    
    Bug: https://bugs.gentoo.org/794046
    Signed-off-by: Marek Szuba <marecki@gentoo.org>

 dev-lang/go/go-1.16.6.ebuild | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 3 William Hubbs gentoo-dev 2021-07-22 14:54:02 UTC
My plan is to add this when 1.17 comes out next month, along with proper
golang-bootstrap support, please remove it from 1.16.6.
Comment 4 William Hubbs gentoo-dev 2021-07-22 18:52:48 UTC
Let me rephrase.
Adding the keyword to this version doesn't make sense because there's
not a version of go-bootstrap on riscv yet.
go-bootstrap-1.16.6 will be the first version to go on riscv, and I'm
not sure how much sense it makes to use that version to bootstrap the
same version of go. I'm open to trying it, but as it stands, you cannot
emerge dev-lang/go on riscv.
Comment 5 Larry the Git Cow gentoo-dev 2021-07-22 19:11:21 UTC
The bug has been referenced in the following commit(s):

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

commit 6f32247b23aca193ae6312cd762d2c4cbf87158e
Author:     William Hubbs <williamh@gentoo.org>
AuthorDate: 2021-07-22 19:05:45 +0000
Commit:     William Hubbs <williamh@gentoo.org>
CommitDate: 2021-07-22 19:11:14 +0000

    profiles/arch/riscv/package.mask: mask <dev-lang/go-1.17
    
    This version of go can only be installed via cross, so block emerging
    it. This will be fixed when 1.17 is released.
    
    Contact sam@g.o or williamh@g.o for details.
    
    Bug: https://bugs.gentoo.org/794046
    Signed-off-by: William Hubbs <williamh@gentoo.org>

 profiles/arch/riscv/package.mask | 4 ++++
 1 file changed, 4 insertions(+)
Comment 6 Larry the Git Cow gentoo-dev 2021-07-23 18:26:33 UTC
The bug has been referenced in the following commit(s):

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

commit 6fbf6d627ef6ed656c9ffc1085192f75085d283a
Author:     William Hubbs <williamh@gentoo.org>
AuthorDate: 2021-07-23 18:24:03 +0000
Commit:     William Hubbs <williamh@gentoo.org>
CommitDate: 2021-07-23 18:24:03 +0000

    profiles/arch/riscv/package.mask: unmask dev-lang/go on riscv
    
    Signed-off-by: William Hubbs <williamh@gentoo.org>
    Bug: https://bugs.gentoo.org/794046

 profiles/arch/riscv/package.mask | 4 ----
 1 file changed, 4 deletions(-)
Comment 7 William Hubbs gentoo-dev 2021-07-23 18:28:38 UTC
Now you should be able to add the riscv keyword to
dev-lang/go-bootstrap-1.16.6 and bootstrap go on a riscv system.

Please test and report back.

Thanks,

William
Comment 8 Marek Szuba archtester gentoo-dev 2021-07-23 23:35:43 UTC
Keyworded - it reports

QA Notice: Unresolved soname dependencies:
/usr/lib/go-bootstrap/src/debug/dwarf/testdata/line-clang-dwarf5.elf: libc.so.6
/usr/lib/go-bootstrap/src/debug/dwarf/testdata/line-clang.elf: libc.so.6
/usr/lib/go-bootstrap/src/debug/dwarf/testdata/line-gcc-dwarf5.elf: libc.so.6
/usr/lib/go-bootstrap/src/debug/dwarf/testdata/line-gcc.elf: libc.so.6
/usr/lib/go-bootstrap/src/debug/dwarf/testdata/ranges.elf: libc.so.6
/usr/lib/go-bootstrap/src/debug/dwarf/testdata/split.elf: libc.so.6
/usr/lib/go-bootstrap/src/debug/dwarf/testdata/typedef.elf: libc.so.6
/usr/lib/go-bootstrap/src/debug/elf/testdata/gcc-386-freebsd-exec: libc.so.6
/usr/lib/go-bootstrap/src/debug/elf/testdata/gcc-amd64-linux-exec: libc.so.6

during installation but ultimately succeeds, and I have just confirmed that it CAN be used to bootstrap dev-lang/go-1.16.6 on riscv. No more need for having to cross-build dev-lang/go binpkgs on amd64 to get started!
Comment 9 Marek Szuba archtester gentoo-dev 2021-07-23 23:51:48 UTC
For completeness, there are some QA warnings in dev-lang/go itself too:

QA Notice: Unrecognized ELF file(s):
 RISCV;/usr/lib/go/pkg/tool/linux_riscv64/vet;;;;
 RISCV;/usr/lib/go/pkg/tool/linux_riscv64/test2json;;;;
 RISCV;/usr/lib/go/pkg/tool/linux_riscv64/pack;;;;
 RISCV;/usr/lib/go/pkg/tool/linux_riscv64/objdump;;;;
 RISCV;/usr/lib/go/pkg/tool/linux_riscv64/nm;;;;
 RISCV;/usr/lib/go/pkg/tool/linux_riscv64/fix;;;;
 RISCV;/usr/lib/go/pkg/tool/linux_riscv64/doc;;;;
 RISCV;/usr/lib/go/pkg/tool/linux_riscv64/dist;;;;
 RISCV;/usr/lib/go/pkg/tool/linux_riscv64/cover;;;;
 RISCV;/usr/lib/go/pkg/tool/linux_riscv64/buildid;;;;
 RISCV;/usr/lib/go/pkg/tool/linux_riscv64/api;;;;
 RISCV;/usr/lib/go/pkg/tool/linux_riscv64/addr2line;;;;
 RISCV;/usr/lib/go/pkg/tool/linux_riscv64/compile;;;;
 RISCV;/usr/lib/go/pkg/tool/linux_riscv64/link;;;;
 RISCV;/usr/lib/go/pkg/tool/linux_riscv64/cgo;;;;
 RISCV;/usr/lib/go/pkg/tool/linux_riscv64/asm;;;;
 RISCV;/usr/lib/go/bin/gofmt;;;;

which appear both having bootstrapped go from go-bootstrap and having bootstrapped from cross-built binpkg of self - but all in all, unless someone else has got something to add I guess we can close this ticket.
Comment 10 Larry the Git Cow gentoo-dev 2021-07-24 19:49:44 UTC
The bug has been referenced in the following commit(s):

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

commit beb7512ac3c4af3f9ba250fe05fddf2bf6be4527
Author:     William Hubbs <williamh@gentoo.org>
AuthorDate: 2021-07-24 19:48:38 +0000
Commit:     William Hubbs <williamh@gentoo.org>
CommitDate: 2021-07-24 19:49:19 +0000

    dev-lang/go-bootstrap: remove testdata directories
    
    The testdata directories are not needed to bootstrap.
    
    Bug: https://bugs.gentoo.org/794046
    Package-Manager: Portage-3.0.20, Repoman-3.0.2
    Signed-off-by: William Hubbs <williamh@gentoo.org>

 dev-lang/go-bootstrap/go-bootstrap-1.16.6.ebuild | 3 +++
 1 file changed, 3 insertions(+)
Comment 11 Larry the Git Cow gentoo-dev 2021-07-24 21:09:29 UTC
The bug has been referenced in the following commit(s):

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

commit 561b7a48cda8ce76609c6e5e4378e1f4464f240d
Author:     William Hubbs <williamh@gentoo.org>
AuthorDate: 2021-07-24 21:08:37 +0000
Commit:     William Hubbs <williamh@gentoo.org>
CommitDate: 2021-07-24 21:09:19 +0000

    dev-lang/go: workaround unrecognized elf file(s) qa notices
    
    This package generates several "unrecognized elf file(s)" notices when
    it is emerged on riscv. Work around this by using the QA_PREBUILT
    setting.
    
    Bug: https://bugs.gentoo.org/794046
    Package-Manager: Portage-3.0.20, Repoman-3.0.2
    Signed-off-by: William Hubbs <williamh@gentoo.org>

 dev-lang/go/go-1.16.6.ebuild | 4 ++++
 1 file changed, 4 insertions(+)
Comment 12 William Hubbs gentoo-dev 2021-08-22 19:42:15 UTC
riscv support is now includedd.

Thanks,

William