google / goterm

Go Terminal library with PTY support and colors
BSD 3-Clause "New" or "Revised" License
211 stars 35 forks source link

pty_linux.go:15:27: error: reference to undefined identifier 'syscall.TIOCGPTN' (gollvm) #9

Open advancedwebdeveloper opened 3 years ago

advancedwebdeveloper commented 3 years ago

Hi. I think I found a bug.

$ go build -i -v -x WORK=/tmp/go-build100086455 github.com/pkg/term/termios mkdir -p $WORK/b014/ cd $WORK /home/oceanfish81/gollvm_dist/bin/llvm-goc -fgo-importcfg=/dev/null -c -x c - -o /dev/null || true cd /home/oceanfis81/go/pkg/mod/github.com/pkg/term@v0.0.0-20190109203006-aa71e9d9e942/termios /home/oceanfish81/gollvm_dist/bin/llvm-goc -c -O2 -g -m64 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -fgo-pkgpath=github.com/pkg/term/termios -o $WORK/b014/go.o -I $WORK/b014/importcfgroot ./doc.go ./ioctl.go ./pty.go ./pty_linux.go ./termios.go ./termios_const.go ./termios_linux.go

github.com/pkg/term/termios

../../../go/pkg/mod/github.com/pkg/term@v0.0.0-20190109203006-aa71e9d9e942/termios/pty_linux.go:15:27: error: reference to undefined identifier 'syscall.TIOCGPTN' ../../../go/pkg/mod/github.com/pkg/term@v0.0.0-20190109203006-aa71e9d9e942/termios/pty_linux.go:24:27: error: reference to undefined identifier 'syscall.TIOCGPTN' ../../../go/pkg/mod/github.com/pkg/term@v0.0.0-20190109203006-aa71e9d9e942/termios/pty_linux.go:29:27: error: reference to undefined identifier 'syscall.TIOCSPTLCK'

Here is my environment:

$ go env && go version GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/oceanfis81/.cache/go-build" GOENV="/home/oceanfis81/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/oceanfis81/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/oceanfis81/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/home/oceanfish81/gollvm_dist" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/home/oceanfish81/gollvm_dist/tools" GCCGO="/home/oceanfish81/gollvm_dist/bin/llvm-goc" AR="ar" CC="/usr/bin/clang" CXX="/usr/bin/clang++" CGO_ENABLED="1" GOMOD="/home/oceanfis81/go_projects/c4go/go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build402447636=/tmp/go-build -gno-record-gcc-switches -funwind-tables" go version go1.15.2 gollvm LLVM 12.0.0git linux/amd64

I am using gollvm - my "release" build could be found here

CC @thanm @cherrymui

skalle commented 3 years ago

Sorry for being slow , cycles are very scarce at the moment.

I'll take the bug but can't promise when I can have a closer look. PRs welcome.

advancedwebdeveloper commented 3 years ago

CC @ianlancetaylor @thanm @cherrymui

advancedwebdeveloper commented 3 years ago

Sorry for being slow , cycles are very scarce at the moment.

I'll take the bug but can't promise when I can have a closer look. PRs welcome.

@skalle , what do you require (to reproduce the bug)? I am re-compiling gollvm, right now - the recent archive with binaries could be obtained from here.

Let me know what you would require from gollvm's "debug" build, what level of verbosity would you require.

ianlancetaylor commented 3 years ago

I do see these values defined in gccgo's syscall package, in the generated sysinfo.go file.