golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.84k stars 17.65k forks source link

on termux golang is not able run ndk C compiler #58587

Closed MatejMagat305 closed 1 year ago

MatejMagat305 commented 1 year ago

What version of Go are you using (go version)?

since go 1.16 to go 1.20/android64 Current: ~ $ go version go version go1.20 android/arm64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
~ $ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/data/data/com.termux/files/home/.cache/go-build"
GOENV="/data/data/com.termux/files/home/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="android"
GOINSECURE=""
GOMODCACHE="/data/data/com.termux/files/home/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="android"
GOPATH="/data/data/com.termux/files/home/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/data/data/com.termux/files/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/data/data/com.termux/files/usr/lib/go/pkg/tool/android_arm64"
GOVCS=""
GOVERSION="go1.20"
GCCGO="gccgo"
AR="ar"
CC="aarch64-linux-android-clang"
CXX="aarch64-linux-android-clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/data/data/com.termux/files/usr/tmp/go-build781557569=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I was trying compile .so as first step of https://github.com/fyne-io/fyne/pull/3649, and go seems like that it can not see/open https://github.com/Lzhiyong/termux-ndk, it is working way, because I made video with https://github.com/vlang/v (which is 80% similar to Golang, Vlang is young, less mature, it also have some advantage compare GO), but I do not understand why Golang can not do it ...

What did you expect to see?

go build -ldflags -w -trimpath -buildmode=c-shared -o /data/data/com.termux/files/usr/tmp/fyne-work-902498925/lib/arm64-v8a/libe.so basic failed: exit status 1
# runtime/cgo
cgo: exec /data/data/com.termux/files/home/android-ndk-r23c/toolchains/llvm/prebuilt/linux-aarch64/bin/aarch64-linux-android31-clang: fork/exec /data/data/com.termux/files/home/android-ndk-r23c/toolchains/llvm/prebuilt/linux-aarch64/bin/aarch64-linux-android31-clang: no such file or directory

What did you see instead?

compile normaly

mdlayher commented 1 year ago

If a termux file is not found, you should file an issue with termux. Closing.