Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 917751

Summary: go-env.eclass: In riscv hardware, GOARCH should be riscv64, not riscv
Product: Gentoo Linux Reporter: Puqns67 <me>
Component: EclassesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: riscv   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Puqns67 2023-11-22 15:56:35 UTC
After commit e398c855e3475c1fb5f3ac6a6e0553116dac83f8 at gentoo git repo, go-module.eclass use go-env.eclass to set compile environment.

go-env.eclass will set GOARCH to riscv on the riscv device, overwriting the default value riscv64, and go does not support setting GOARCH to riscv by default. This causes all ebuilds using go-module to fail to compile on the riscv device.

I found this error while updating net-proxy/v2ray from gentoo-zh overlay.

Add a line to go-env.eclass for fix this issue.

```
diff --git a/eclass/go-env.eclass b/eclass/go-env.eclass
index ba4f6c3fbb..f74d4ab2c3 100644
--- a/eclass/go-env.eclass
+++ b/eclass/go-env.eclass
@@ -34,6 +34,7 @@ go-env_set_compile_environment() {
 				else
 					GOARCH="ppc64le"
 				fi ;;
+			riscv)	GOARCH="riscv64" ;;
 			*)	GOARCH="${arch}" ;;
 	esac
```
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-22 15:59:00 UTC
Slightly too slow ;)

*** This bug has been marked as a duplicate of bug 917750 ***