Closed advancedwebdeveloper closed 4 years ago
CC @thanm @cherrymui
In gccgo syscall.RUSAGE_SELF
is defined in the sysinfo.go file created by mksysinfo.sh
. Not sure what is happening for GoLLVM.
I can't reproduce this -- works ok for me.
As Ian mentions, syscall.RUSAGE_SELF is auto-generated as part of the build. If you examine your gollvm build area, you should see it here:
$ cd <build_area_root>
$ fgrep RUSAGE_SELF tools/gollvm/libgo/sysinfo.go
const _RUSAGE_SELF = 0
const RUSAGE_SELF = _RUSAGE_SELF
$
If not, it sounds as though something went haywire with your build.
@thanm , I will check that tomorrow. Thanks for the tip
I can't reproduce this -- works ok for me.
As Ian mentions, syscall.RUSAGE_SELF is auto-generated as part of the build. If you examine your gollvm build area, you should see it here:
$ cd <build_area_root> $ fgrep RUSAGE_SELF tools/gollvm/libgo/sysinfo.go const _RUSAGE_SELF = 0 const RUSAGE_SELF = _RUSAGE_SELF $
If not, it sounds as though something went haywire with your build.
@thanm , some related files are generated/built (see attachments) - but I don't see _RUSAGE_SELF inside sysinfo.go. But I do see it inside sysinfo.macros.txt .
@thanm, @cherrymui : what should I check/investigate, during gollvm's rebuild process, to find out why it's not auto-generating properly ?
Ivan
I was able to compile by adding
const _RUSAGE_SELF = 0 const RUSAGE_SELF = _RUSAGE_SELF
to the source file, under a local package visibility. That's a bypass - so the original cause/problem persists.
Ivan
Thanks for posting the zip file with build artifacts. I can see the problem now; I'll send a patch shortly to address this.
Change https://golang.org/cl/254941 mentions this issue: libgo: additional type/const reference in sysinfo.c
Thanks for posting the zip file with build artifacts. I can see the problem now; I'll send a patch shortly to address this.
Finally. Looking forward to test it/rebuild llvm
This should be fixed now at head. Please reopen if not.
Hi. I was building internals of linkerd and caught a bug, during the build phase, for a protobuf/grpc related package.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
Output> 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="/usr/bin/clang" > CXX="/usr/bin/clang++" > CGO_ENABLED="1" > GOMOD="/home/oceanfish81/linkerd2/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-build000799681=/tmp/go-build -gno-record-gcc-switches -funwind-tables"
What did you do?
What did you expect to see?
Required sources should be pulled and all packages should be compiled, using llvm-goc, as expected.
What did you see instead?
It seems that an error is related to func GetRusage() (rusage *Rusage) .
Ivan