Estimating blockers for supporting gollvm on RISC-V (qemu). Fedora 33

216 views
Skip to first unread message

Ivan Serdyuk

unread,
Nov 20, 2020, 10:37:10 PM11/20/20
to golang-nuts
Hello.

It is just a brief survey - but I am currently dealing with a messy setup, for qemu.

I have upgraded, after bootstrapping( the manual ) and I am able to boot

> Fedora (5.8.0-1.0.riscv64.fc33.riscv64) 33 (Rawhide)

kernel, under qemu.

I see a very abstract

> $ cat /proc/cpuinfo
> processor : 0
> hart : 0
> isa : rv64imafdcsu
> mmu : sv48
.

Doesn't really help.
I will suggest trying other emulators - but would have to compile those myself.

I have some concerns about gmp, mpfr and mpc (since RISC-V assumes some extensions, to cover such demands) - I feel that it might have more sense to get rid of overlaying, for the end-user use cases (which gollvm project itself achieves).


Ivan

Ivan Serdyuk

unread,
Nov 21, 2020, 5:11:32 AM11/21/20
to golang-nuts, we...@redhat.com, carl...@gmail.com, m...@carlosedp.com
Wei, Carlos: adding you to this discussion.

Carlos, please ask your questions. What was not understood, regarding my attempt?

Hence that QEMU's host OS could be, say, Fedora 32+ x86_64.

Ivan

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/2c9788e3-5349-4f5e-bbfc-53f300cf439bn%40googlegroups.com.

Ivan Serdyuk

unread,
Nov 24, 2020, 7:03:14 AM11/24/20
to golang-nuts, we...@redhat.com, carl...@gmail.com, m...@carlosedp.com, Richard W.M. Jones
Richard,
could you tell why gold linker is not available on RISC-V port of Fedora 33?

Richard W.M. Jones

unread,
Nov 24, 2020, 9:07:13 AM11/24/20
to Ivan Serdyuk, golang-nuts, we...@redhat.com, carl...@gmail.com, m...@carlosedp.com, david.abd...@gmail.com, Nick Clifton
On Tue, Nov 24, 2020 at 02:01:58PM +0200, Ivan Serdyuk wrote:
> Richard,
> could you tell why gold linker is not available on RISC-V port of Fedora 33?

You're right that it's not built (as a subpackage of binutils):

http://fedora.riscv.rocks/koji/buildinfo?buildID=186524

That happens because of this clause in the binutils spec file:

# Note - in the future the gold linker may become deprecated.
%ifnarch riscv64
%bcond_without gold
%else
# RISC-V does not have ld.gold thus disable by default.
%bcond_with gold
%endif

That was added by David Abdurachmanov and Nick Clifton last year, so
I'm CC-ing both of them. It's unclear exactly what the
"file installation issues" were.

https://src.fedoraproject.org/rpms/binutils/c/3edfd25eae3f2c6b2bbdf7d16320fd70f9456c99?branch=master

I've kicked off a local build without this to see if it would work now.

Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top

David Abdurachmanov

unread,
Nov 24, 2020, 9:07:28 AM11/24/20
to Richard W.M. Jones, Ivan Serdyuk, golang-nuts, Fu Wei, carl...@gmail.com, Carlos Eduardo de Paula, Nick Clifton
On Tue, Nov 24, 2020 at 2:12 PM Richard W.M. Jones <rjo...@redhat.com> wrote:
>
> On Tue, Nov 24, 2020 at 02:01:58PM +0200, Ivan Serdyuk wrote:
> > Richard,
> > could you tell why gold linker is not available on RISC-V port of Fedora 33?
>
> You're right that it's not built (as a subpackage of binutils):
>
> http://fedora.riscv.rocks/koji/buildinfo?buildID=186524

There is no support for gold linker. I always got the impression that
it's no longer actively developed and IIRC might be even dropped in
the future.

Google:
https://www.phoronix.com/scan.php?page=news_item&px=GNU-Gold-Stagnate-F31
https://fedoraproject.org/wiki/Changes/BINUTILS_GOLD

Quote: "but new development is not happening"

RISC-V only supports ld.bfd (binutils) and ld.ldd (from LLVM, might
have some issues with relaxations, but IIRC works).

david

Richard W.M. Jones

unread,
Nov 24, 2020, 9:14:53 AM11/24/20
to David Abdurachmanov, Ivan Serdyuk, golang-nuts, Fu Wei, carl...@gmail.com, Carlos Eduardo de Paula, Nick Clifton

FWIW simply reverting that change did not work. The error is:

File not found: /home/rjones/rpmbuild/BUILDROOT/binutils-2.35.1-15.fc34.riscv64/usr/bin/ld

(Unfortunately the full log is corrupted so I couldn't see why
precisely gold didn't build).

One thing I'm missing: Why does golang need gold?

Rich.

Ian Lance Taylor

unread,
Nov 24, 2020, 9:21:43 AM11/24/20
to Richard W.M. Jones, David Abdurachmanov, Ivan Serdyuk, golang-nuts, Fu Wei, carl...@gmail.com, Carlos Eduardo de Paula, Nick Clifton
On Tue, Nov 24, 2020 at 6:14 AM Richard W.M. Jones <rjo...@redhat.com> wrote:
>
> One thing I'm missing: Why does golang need gold?

The gccgo and GoLLVM compilers (which are not the most widely used Go
compilers) require the gold linker for full support of stack
splitting. Stack splitting is used to ensure that goroutines do not
run out of stack space. Stack splitting is supported by gold and lld,
but, as far as I know, is not supported by the GNU linker.

However, the bulk of stack splitting support is in the compiler, At
least for GCC, stack splitting is only supported on x86, PPC, and
S/390. So at least until stack splitting support is added for RISC/V,
there is no particular reason to require the gold linker for RISC/V.

(It does seem a shame that people are thinking of deprecating gold,
but it's certainly true that I have not had time to maintain it.)

Ian

Ivan Serdyuk

unread,
Nov 28, 2020, 3:41:56 AM11/28/20
to Ian Lance Taylor, Richard W.M. Jones, David Abdurachmanov, golang-nuts, carl...@gmail.com, Nick Clifton, ji...@sifive.com
Jim,
adding you to the discussion.

I was not able to build gold, by configuring binutils, using
./configure --enable-gold
did not allow GNU make tool to build gold: many sub-directories were processed, to compile the sources/generate files - but not the sub-dir. for gold.
When I entered the "gold" dir. and ran "configure" script - it failed with an error, which reported an unsupported arch. , under qemu.

Is there any way to compile gold?
Perhaps I have improper identification of the arch.?
Perhaps there is a working Makefile, for this (until "configure" would be patched properly)?

What about cross-compiling (Linux x86_64 -> Linux 64bit RISC-V ) ?


 Ivan

Ian Lance Taylor

unread,
Nov 28, 2020, 10:04:55 AM11/28/20
to Ivan Serdyuk, Richard W.M. Jones, David Abdurachmanov, golang-nuts, carl...@gmail.com, Nick Clifton, Jim Wilson
On Sat, Nov 28, 2020 at 12:40 AM Ivan Serdyuk
<local.tou...@gmail.com> wrote:
>
> Jim,
> adding you to the discussion.
>
> I was not able to build gold, by configuring binutils, using
>>
>> ./configure --enable-gold
>
> did not allow GNU make tool to build gold: many sub-directories were processed, to compile the sources/generate files - but not the sub-dir. for gold.
> When I entered the "gold" dir. and ran "configure" script - it failed with an error, which reported an unsupported arch. , under qemu.
>
> Is there any way to compile gold?
> Perhaps I have improper identification of the arch.?
> Perhaps there is a working Makefile, for this (until "configure" would be patched properly)?
>
> What about cross-compiling (Linux x86_64 -> Linux 64bit RISC-V ) ?

The gold linker does not yet support RISC/V. The --enable-gold
configure option won't work for that target.

Ian
Reply all
Reply to author
Forward
0 new messages