-
Notifications
You must be signed in to change notification settings - Fork 18k
build: provide a mechanism to disable architectures? #17123
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
Comments
Sounds ok. I'm surprised it was that easy. |
For my own understanding: Such a cross-compiled tool chain for ARM would run on ARM but not be able to cross-compile on ARM for another toolchain anymore, correct? Seems ok to me. But I'm doing a double-take looking at the doubly negated build tags: !without_amd64 . Can't we be positive? |
For the compiler, I would think you only need to touch cmd/compile/main.go. E.g., have s390x_main.go:
main.go:
|
(I saw the CL before the issue.) I think adding build tags everywhere will be hard to maintain over time. mdempsky's idead sounds better to me if it works. |
Oh, it looks like that's exactly the strategy you used for cmd/link even. |
Correct.
It's a little weird, but I can't think of a better way. |
Yeah, I did that style for cmd/compile and cmd/link. I think cmd/asm might need different treatment. But I wanted to make sure people were okay with this first. |
I think cmd/asm just needs you to split up cmd/asm/internal/arch.go into GOARCH-specific arch.go files. arch.Set is the choke point there. I'm okay with the idea if it's minimally intrusive like that. Do you have any numbers on how big a compile-time / executable-size win this is? |
Let's punt this to next round. Also, before committing to doing this, I'd like to see what the numbers are. You mention "build speed & binary size reasons". Please quantify those: how much faster does make.bash get, and how much smaller does the generated $GOROOT/pkg/tool dir get? It may be that the benefit is too small. |
I agree about timing & need for numbers. My prototype bitrot with a bunch of compiler changes & deletions, so I deleted my branch. Can investigate later. I'll kick this to Go1.9Maybe with the understanding that we might close it without action, just so it's off the proposal dashboard. |
For build speed & binary size reasons, I would like to run make.bash with certain architectures disabled.
(my motivation: when I'm cross-compiling an ARM toolchain from Linux for #17105, there's no need for ppc64, mips64, s390x, arm64, 386, or even amd64 in my resulting binaries)
I started a prototype in https://golang.org/cl/29230 which defines build tags like "without_ppc64", "without_386", "without_s390x", etc.
The compiler and linker were easy. I decided to wait on
cmd/asm
until more discussion.What do people think of something like this?
/cc @ianlancetaylor @mdempsky @randall77 @robpike @griesemer @josharian @rsc
The text was updated successfully, but these errors were encountered: