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
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge
Milestone

Comments

@bradfitz
Copy link
Contributor

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 x/build issues (builders, bots, dashboards) label Apr 7, 2016
@bradfitz bradfitz added this to the Unplanned milestone Apr 7, 2016
@minux
Copy link
Member

minux commented Apr 7, 2016 via email

@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators May 4, 2017
@rsc rsc unassigned minux Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

3 participants