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

cmd/dist: use of elf package adds 300k to dist binary size #15180

Closed
bradfitz opened this issue Apr 7, 2016 · 2 comments
Closed

cmd/dist: use of elf package adds 300k to dist binary size #15180

bradfitz opened this issue Apr 7, 2016 · 2 comments
Assignees
Milestone

Comments

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Apr 7, 2016

The cmd/dist binary imports the elf package (and thus the dwarf) binary, just for one use:

                case strings.Contains(out, "mips64"):
                        file, err := elf.Open(os.Args[0])
                        if err != nil {
                                fatal("failed to open %s to determine endianness: %v", os.Args[0], err)
                        }
                        if file.FileHeader.ByteOrder == binary.BigEndian {
                                gohostarch = "mips64"
                        } else {
                                gohostarch = "mips64le"
                        }

... for detecting the host architecture.

Can that be done cheaper?

(noticed while looking at reducing the GOROOT_BOOTSTRAP tarball size sent to builders)

Not super high priority, of course.

@bradfitz bradfitz added the Builders label Apr 7, 2016
@bradfitz bradfitz added this to the Unplanned milestone Apr 7, 2016
@minux
Copy link
Member

@minux minux commented Apr 7, 2016

@gopherbot
Copy link

@gopherbot gopherbot commented Apr 7, 2016

CL https://golang.org/cl/21662 mentions this issue.

@gopherbot gopherbot closed this in 2e2481e May 4, 2016
@golang golang locked and limited conversation to collaborators May 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.