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

gollvm: build failure with latest LLVM (YAMLSerializer and intrinsic verifying failure) #33439

Closed
shawndx opened this issue Aug 2, 2019 · 4 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@shawndx
Copy link
Contributor

shawndx commented Aug 2, 2019

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

$ go version
go version go1.12.2 gollvm LLVM 10.0.0svn linux/amd64

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
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/xiaji01/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/xiaji01/.go"
GOPROXY=""
GORACE=""
GOROOT="/home/xiaji01/build/gl.0801"
GOTMPDIR=""
GOTOOLDIR="/home/xiaji01/build/gl.0801/tools"
GCCGO="/home/xiaji01/build/gl.0801/bin/llvm-goc"
CC="/home/xiaji01/util/bin/gcc"
CXX="/home/xiaji01/util/bin/g++"
CGO_ENABLED="1"
GOMOD=""
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build293038904=/tmp/go-build -gno-record-gcc-switches -funwind-tables"

What did you do?

Sync llvm, gollvm and gofrontend to their latest commits then build, got two build failures.

  1. llvm::remarks::YAMLSerializer being moved to another header and renamed to llvm::remarks::YAMLRemarkSerializer
  2. Intrinsic name not mangled correctly for type arguments! Should be: llvm.prefetch.p0i8
    void (i8*, i32, i32, i32)* @llvm.prefetch.p0i8.i32.i32

Figured out a fix locally, continue exploring further.

What did you expect to see?

no build error, no additional unit-testing failure.

What did you see instead?

@ALTree ALTree added this to the gollvm milestone Aug 2, 2019
@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 2, 2019
@shawndx
Copy link
Contributor Author

shawndx commented Aug 2, 2019

will submit a fix after finishing validation and internal review.

@ianlancetaylor
Copy link
Member

CC @thanm @cherrymui

@shawndx
Copy link
Contributor Author

shawndx commented Aug 4, 2019

The following changes are relevant to the build failures:

1.YAML serializer
commit b06f1544068110f21accd88f7efc163417c4cb1e
[Remarks][NFC] Move the YAML serializer to its own header

commit 5093e0a4be370b21f4a74540e8d8af73768e369f
[Remarks] Add two serialization modes for remarks: separate and standalone

  1. 'prefetch' intrinsic
    commit c0702618c0e0a5c742aa20b831041bde366417f1
    Allow prefetching from non-zero address spaces

It changes the first argument's type from llvm_ptr_ty to llvm_anyptr_ty, making it overloaded, for overloaded intrinsics llvm expects fixed parameter types being excluded from mangling.

Making a change in go-llvm-builtins.cpp

  ---defineIntrinsicBuiltin("__builtin_prefetch", nullptr, llvm::Intrinsic::prefetch,
                         ptrType, int32Type, int32Type, nullptr);

  +++defineIntrinsicBuiltin("__builtin_prefetch", nullptr, llvm::Intrinsic::prefetch,
                         ptrType, nullptr);

This seems to be the only one that needs to be addressed now, please comment if there is any misunderstanding, thanks a lot.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/189097 mentions this issue: gollvm: fix build failures of YAMLSerializer and intrinsic verifying

@golang golang locked and limited conversation to collaborators Aug 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants