Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined syscall.TIOCGPTN, syscall.TIOCSPTLCK during compilation of cri-o (gollvm related) #4197

Closed
advancedwebdeveloper opened this issue Sep 15, 2020 · 5 comments

Comments

@advancedwebdeveloper
Copy link

advancedwebdeveloper commented Sep 15, 2020

Hi.
I was trying to build cri-o using gollvm .

$go version
go version go1.15rc2 gollvm LLVM 12.0.0git linux/amd64

$go env
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/oceanfish81/.cache/go-build"
GOENV="/home/oceanfish81/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/oceanfish81/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/oceanfish81/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/tools"
GCCGO="/usr/local/bin/llvm-goc"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/home/oceanfish81/cri-o/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-build446537969=/tmp/go-build -gno-record-gcc-switches -funwind-tables"

So I cloned the master branch and triggered make:

~/cri-o$ make

GO111MODULE=on go build --mod=vendor -i -v -x -ldflags '-s -w -X github.com/cri-o/cri-o/internal/pkg/criocli.DefaultsPath="" -X github.com/cri-o/cri-o/internal/version.buildDate='2020-09-15T14:22:19Z' -X github.com/cri-o/cri-o/internal/version.gitCommit=a001e7276466cfdb6030ed1e4a635aa2c2d5fc37 -X github.com/cri-o/cri-o/internal/version.gitTreeState=dirty ' -tags "containers_image_ostree_stub exclude_graphdriver_btrfs btrfs_noversion exclude_graphdriver_devicemapper libdm_no_deferred_remove containers_image_openpgp " -o bin/crio github.com/cri-o/cri-o/cmd/crio
WORK=/tmp/go-build661976016

go build: when using gccgo toolchain, please pass linker flags using -gccgoflags, not -ldflags
cat /home/oceanfish81/.cache/go-

build/1e/1ebbefcb107909d8ca28ffb87073d76e20cb750cdd607cae3a40e4dcb7a8926b-d internal
github.com/containers/storage/pkg/unshare

unshare.c:137:16: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
unshare.c:148:16: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]

github.com/containerd/continuity/fs
mkdir -p $WORK/b407/
cd $WORK
/usr/local/bin/llvm-goc -fgo-importcfg=/dev/null -c -x c - -o /dev/null || true
mkdir -p $WORK/b407/importcfgroot/github.com/containerd/continuity
ln -s /home/oceanfish81/.cache/go-build/01/0149872ebed362b2db5d5cb500fe4c36dc53aa0eeaf43445d2a1d57f87797f22-d $WORK/b407/importcfgroot/github.com/containerd/continuity/libsysx.a
mkdir -p $WORK/b407/importcfgroot/github.com/pkg
ln -s /home/oceanfish81/.cache/go-build/5c/5c5c0c7d8f5175eae2b4d2a083bbfa586296699b6d6e847a6034fb77f0283e5b-d $WORK/b407/importcfgroot/github.com/pkg/liberrors.a
mkdir -p $WORK/b407/importcfgroot/github.com/sirupsen
ln -s /home/oceanfish81/.cache/go-build/92/92e22833f5517c1584404320f391ae330ef4ec12a7ee701ea0863735c4e5a39e-d $WORK/b407/importcfgroot/github.com/sirupsen/liblogrus.a
mkdir -p $WORK/b407/importcfgroot/golang.org/x/sync
ln -s /home/oceanfish81/.cache/go-build/b4/b4dade4823a139177beb6326f044ad405152a51915db5eff2d1f1100f377d538-d $WORK/b407/importcfgroot/golang.org/x/sync/liberrgroup.a
mkdir -p $WORK/b407/importcfgroot/golang.org/x/sys
ln -s /home/oceanfish81/.cache/go-build/79/79581a3b9031e51313108a803ec4be9cd5e789dcf66ef4dbe3af40cfbd47664a-d $WORK/b407/importcfgroot/golang.org/x/sys/libunix.a
cd /home/oceanfish81/cri-o/vendor/github.com/containerd/continuity/fs
/usr/local/bin/llvm-goc -c -O2 -g -m64 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -fgo-pkgpath=github.com/containerd/continuity/fs -o $WORK/b407/go.o -I $WORK/b407/importcfgroot ./copy.go ./copy_linux.go ./diff.go ./diff_unix.go ./dtype_linux.go ./du.go ./du_unix.go ./hardlink.go ./hardlink_unix.go ./path.go ./stat_linuxopenbsd.go ./time.go
github.com/containerd/continuity/fs
vendor/github.com/containerd/continuity/fs/dtype_linux.go:61:26:

error: reference to undefined identifier 'syscall.DT_UNKNOWN'

google.golang.org/grpc/internal/syscall
mkdir -p $WORK/b588/
mkdir -p $WORK/b588/importcfgroot/golang.org/x/sys
ln -s /home/oceanfish81/.cache/go-build/79/79581a3b9031e51313108a803ec4be9cd5e789dcf66ef4dbe3af40cfbd47664a-d $WORK/b588/importcfgroot/golang.org/x/sys/libunix.a
mkdir -p $WORK/b588/importcfgroot/google.golang.org/grpc
ln -s /home/oceanfish81/.cache/go-build/30/30930d48107ba12b7ade2c7819539e70230eb48a12633953340e6015035ad1d2-d $WORK/b588/importcfgroot/google.golang.org/grpc/libgrpclog.a
cd /home/oceanfish81/cri-o/vendor/google.golang.org/grpc/internal/syscall
/usr/local/bin/llvm-goc -c -O2 -g -m64 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -fgo-pkgpath=google.golang.org/grpc/internal/syscall -o $WORK/b588/go.o -I $WORK/b588/importcfgroot ./syscall_linux.go
google.golang.org/grpc/internal/syscall
vendor/google.golang.org/grpc/internal/syscall/syscall_linux.go:50:28:

error: reference to undefined identifier 'syscall.RUSAGE_SELF'

github.com/creack/pty
mkdir -p $WORK/b651/
cd /home/oceanfish81/cri-o/vendor/github.com/creack/pty
/usr/local/bin/llvm-goc -c -O2 -g -m64 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -fgo-pkgpath=github.com/creack/pty -o $WORK/b651/go.o -I $WORK/b651/importcfgroot ./doc.go ./ioctl.go ./pty_linux.go ./run.go ./util.go ./ztypes_amd64.go
github.com/creack/pty

vendor/github.com/creack/pty/pty_linux.go:40:31: error: reference to undefined identifier 'syscall.TIOCGPTN'
vendor/github.com/creack/pty/pty_linux.go:50:31: error: reference to undefined identifier 'syscall.TIOCSPTLCK'
make: *** [Makefile:169: bin/crio] Error 2

Ivan

@advancedwebdeveloper
Copy link
Author

CC @sameo @saschagrunert @rhatdan
BBC @thanm

Ivan

@haircommander
Copy link
Member

sorry if I'm misunderstanding, but it seems all of these errors are from different libraries. Is there anything actionable in cri-o other than importing a newer version of the libraries that support gollvm?

@advancedwebdeveloper
Copy link
Author

sorry if I'm misunderstanding, but it seems all of these errors are from different libraries. Is there anything actionable in cri-o other than importing a newer version of the libraries that support gollvm?

@haircommander , I can't tell yet.
Please assist to figure that out

@advancedwebdeveloper
Copy link
Author

@haircommander , did as you proposed

@kolyshkin
Copy link
Collaborator

golang/go#41404 it says it's fixed in libgo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants