Bug 251403

Summary: lang/gcc10 seems to not allow building for RISC-V
Product: Ports & Packages Reporter: Dennis Clarke <dclarke>
Component: Individual Port(s)Assignee: Mark Linimon <linimon>
Status: Closed FIXED    
Severity: Affects Some People CC: gerald, linimon, riscv
Priority: ---    
Version: Latest   
Hardware: riscv   
OS: Any   

Description Dennis Clarke 2020-11-26 12:02:56 UTC
I was surprised to see : 

ijiraq# pwd
/usr/ports/lang/gcc10
ijiraq# 
ijiraq# make 
===>  gcc10-10.2.0 is only for aarch64 amd64 arm armv6 armv7 i386 powerpc
powerpc64, while you are running riscv64.
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/gcc10
ijiraq# 

This is with : 

ijiraq# 
ijiraq# uname -a 
FreeBSD ijiraq 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r367349: Wed Nov  4 22:48:25 UTC 2020     root@FreeBSD-head-riscv64-build.jail.ci.FreeBSD.org:/usr/obj/usr/src/riscv.riscv64/sys/QEMU  riscv
ijiraq# 

However I am fairly sure RISC-V is fully supported upstream. 



-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2020-11-26 12:44:20 UTC
When riscv64 was added as a "possible architecture" to the ports tree, we did not do a pass through the entire tree looking for ONLY_FOR lines and attempt to add it.

w/rt ports on riscv64, they are still so new that you are on your own: unless you get interest from one of the riscv64 src developers, you are going to have to do all the work yourself.  We *ask* ports maintainers to take a look at tier-2 architecture maintenance, but in fairness we cannot expect them to.

In practice tier-2 ports debugging is done only by people particularly interested in the architecture.  For instance, I am one of the several people that does the work for powerpc64.  But, I only rarely ask maintainers for help, and only when I cannot see an easy solution to the problem, and the other ports committers interested in powerpc64 can't either.

So, in this situation, all we can say is "append the string 'riscv64'" to the ONLY_FOR string, try it, and see what happens.
Comment 2 Dennis Clarke 2020-11-26 16:13:59 UTC
Yes, thank you and I do know that I am well out into the wilds with this and to be fair it is fun to exerpiment with a new platform. I am working along through various packages in ports and hitting more than a few snags. Such is life out on the edge and that is fine. I also have done some work with ppc64 and to be fair that seems to be working well. I am going to do a build of gcc 10.2.0 outside of ports and see how that goes and then I'll come back to ports and give that a try. This will take days of course.
Comment 3 Dennis Clarke 2020-11-26 16:15:01 UTC
Also, not sure if we can say this is "FIXED" as opposed to "go get more information and try this and lets see how it goes."
Comment 4 Gerald Pfeifer freebsd_committer freebsd_triage 2020-11-26 22:27:36 UTC
FWIW, I'll happily accept a change to add riscv64 as a architecture, but
as Mark said, won't be able to test this myself.

Also, please start with the lang/gcc* port that tracks the latest upstream
head (lang/gcc11-devel right now). That has the highest chance for success,
and if something works there and not in the current release, that indicates
it's with GCC, not FreeBSD.

Also, before changing a lang/gccX port, please make that change to
lang/gccX-devel first.  One, for the same reason as above, and two
these ports serve as canaries of sort, so better catch any troubles
there instead of the "regular" port.

(In both cases this also help avoid regressions, where an older version
is ahead of a newer one.)