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
cmd/compile: arm64 build constraint not supported in bootstrapping ? #36551
Comments
As a comparison, command line of building math/big on amd64 where ./nat_amd64.go is included. /home/xiaji01/util/go/pkg/tool/linux_amd64/compile -o $WORK/b097/pkg.a -trimpath "$WORK/b097=>" -p bootstrap/math/bi g -lang=go1.14 -complete -buildid SuQcvfNw1-wahpUcxV9E/SuQcvfNw1-wahpUcxV9E -D "" -importcfg $WORK/b097/importcfg -pac k -c=4 ./accuracy_string.go ./arith.go ./arith_decl_pure.go ./decimal.go ./doc.go ./float.go ./floatconv.go ./floatmar sh.go ./ftoa.go ./int.go ./intconv.go ./intmarsh.go ./nat.go ./nat_amd64.go ./natconv.go ./prime.go ./rat.go ./ratconv .go ./ratmarsh.go ./roundingmode_string.go ./sqrt.go Thanks. |
arm64 has been recognized since Go 1.5. Please provide a complete repro. |
@bradfitz I got the following error with the enclosed change. Thanks a lot. Building Go cmd/dist using /usr/lib/go-1.10. (go1.10.4 linux/arm64) bootstrap/math/big/home/xiaji01/src/go.natsqr.arm/src/math/big/nat.go:271: undefined: karatsubaThreshold |
looks like *_arm64.go is excluded on arm64 platform, if I managed to bypass the error then toolchain1 recognizes them as expected. |
Look at the command that failed; it includes It's trying to build a non-assembly version first, and your patch deletes the pure Go definitions. This is working as intended. |
Files with arm64 or wasm suffixes are ignored from bootstrapping build, // cmd/dist/buildtool.go 159 for _, suf := range ignoreSuffixes { why are they ignored even they already have "// +build !math_big_pure_g"? Is it for supporting a GOROOT_BOOTSTRAP < Go 1.4? Thanks. |
The If it's important to make that work we could likely clean this up a bit by only ignoring the files if they have no build tags. |
@ianlancetaylor, we could also add explicit |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
Outputarm64 platform
What did you do?
Add an arch-specific file, say nat_arm64.go, but it's not built during bootstrapping, leading to unexpected build error.
Command line of building the math/big packge:
/usr/lib/go-1.10/pkg/tool/linux_arm64/compile -o $WORK/b089/pkg.a -trimpath $WORK/b089 -p bootstrap/math/big -complete -buildid A-inRWtP3l76bAqzsiqn/A-inRWtP3l76bAqzsiqn -goversion go1.10.4 -D "" -importcfg $WORK/b089/importcfg -pack -c=4 ./accuracy_string.go ./arith.go ./arith_decl_pure.go ./decimal.go ./doc.go ./float.go ./floatconv.go ./floatmarsh.go ./ftoa.go ./int.go ./intconv.go ./intmarsh.go ./nat.go ./natconv.go ./prime.go ./rat.go ./ratconv.go ./ratmarsh.go ./roundingmode_string.go ./sqrt.go
Seems that build constraint for arm64 is not supported by go-1.10?
Tried with amd64 (nat_amd64.go), it works fine.
What did you expect to see?
bootstrapping build support arm64 build constraint, or any workaround solution.
What did you see instead?
build error in "Building Go toolchain1 using /usr/lib/go-1.10." as the arch-specific file is not included.
The text was updated successfully, but these errors were encountered: