// For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/go { "name": "Go", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile "image": "mcr.microsoft.com/devcontainers/go:dev-1.25", "features": { "ghcr.io/nils-geistmann/devcontainers-features/zsh:0": {}, "ghcr.io/devcontainers-extra/features/zsh-plugins:0": {} },
// Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "go version", // Configure tool-specific properties. // "customizations": {}, // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. // "remoteUser": "root" "remoteEnv": { "PATH": "/workspaces/go/bin:${containerEnv:PATH}", "GOBIN": "/workspaces/go/bin", "GOROOT": "/workspaces/go" } } This is the configuration of devcontainers I use, and the same error occurred ➜ syscall git:(master) ✗ GOOS=linux GOARCH=arm64 ./mkall.sh # syscall ./zsyscall_linux_arm64.go:1117:22: undefined: SYS_FSTAT ./zsyscall_linux_arm64.go:1132:23: undefined: SYS_FSTATAT ./zsyscall_linux_arm64.go:1248:23: undefined: SYS_RENAMEAT ./zsyscall_linux_arm64.go:1336:23: undefined: SYS_SYNC_FILE_RANGE2 Is there something wrong with the way I operate? 在2025年8月29日星期五 UTC+8 01:33:03<TheDiveO> 写道: > While I can't tell you the exact Ubuntu version, I would expect 20.04LTS > to be problematic at this point. You could try with a devcontainer and a > more recent Ubuntu base image, from the 24.04LTS era, installing more > recent kernel headers into the devcontainer than the kernel the > devcontainer is deployed on. There is a well-maintained go devcontainer > feature by Microsoft to install specific or the latest stable Go toolchain > into the devcontainer if necessary. A devcontainer is a Docker/OCI > container used for development, well supported in VSCode, created from > simple json configurations, which are modular thanks to the feature > mechanism. No need for a separate VM, just Docker. > > On Wednesday, August 27, 2025 at 8:08:56 AM UTC+2 mr....@gmail.com wrote: > >> Hello, >> >> I am attempting to generate new system calls for Golang's syscall package. >> While running ./mkall.sh on Ubuntu 20.04.6 LTS AARCH64, I consistently >> encounter the following error: >> plaintext >> ./zsyscall_linux_arm64.go:1336:23: undefined: SYS_SYNC_FILE_RANGE2 go >> tool cgo: signal: broken pipe >> >> This issue suggests that SYS_SYNC_FILE_RANGE2 is not defined in the >> context of the build. Could someone advise which Linux distribution (and >> version) is recommended for successfully generating system calls for >> AARCH64? >> >> Thank you in advance for your guidance! >> >> >> >> Linux lima-default 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:55:34 >> UTC 2025 aarch64 aarch64 aarch64 GNU/Linux >> >> >> AR='ar' >> CC='gcc' >> CGO_CFLAGS='-O2 -g' >> CGO_CPPFLAGS='' >> CGO_CXXFLAGS='-O2 -g' >> CGO_ENABLED='1' >> CGO_FFLAGS='-O2 -g' >> CGO_LDFLAGS='-O2 -g' >> CXX='g++' >> GCCGO='gccgo' >> GO111MODULE='' >> GOARCH='arm64' >> GOARM64='v8.0' >> GOAUTH='netrc' >> GOBIN='' >> GOCACHE='/home/dingli.linux/.cache/go-build' >> GOCACHEPROG='' >> GODEBUG='' >> GOENV='/home/dingli.linux/.config/go/env' >> GOEXE='' >> GOEXPERIMENT='' >> GOFIPS140='off' >> GOFLAGS='' >> GOGCCFLAGS='-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 >> -ffile-prefix-map=/tmp/go-build1072417917=/tmp/go-build >> -gno-record-gcc-switches' >> GOHOSTARCH='arm64' >> GOHOSTOS='linux' >> GOINSECURE='' >> GOMOD='/home/dingli.linux/work/go/src/go.mod' >> GOMODCACHE='/home/dingli.linux/go/pkg/mod' >> GONOPROXY='' >> GONOSUMDB='' >> GOOS='linux' >> GOPATH='/home/dingli.linux/go' >> GOPRIVATE='' >> GOPROXY='https://proxy.golang.org,direct' >> GOROOT='/home/dingli.linux/work/go' >> GOSUMDB='sum.golang.org' >> GOTELEMETRY='local' >> GOTELEMETRYDIR='/home/dingli.linux/.config/go/telemetry' >> GOTMPDIR='' >> GOTOOLCHAIN='auto' >> GOTOOLDIR='/home/dingli.linux/work/go/pkg/tool/linux_arm64' >> GOVCS='' >> GOVERSION='go1.26-devel_77f911e31c Fri Aug 15 18:10:28 2025 -0700' >> GOWORK='' >> PKG_CONFIG='pkg-config' >> > -- 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+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/7ad65f67-39ef-45b0-b640-d8da1fd2863en%40googlegroups.com.