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/pack: restore P flag functionality #6989
Labels
Milestone
Comments
For easy reference, here is the text from the Go 1.2 docs for pack: Command pack Pack is a variant of the Plan 9 ar tool. The original is documented at http://plan9.bell-labs.com/magic/man2html/1/ar It adds a special Go-specific section __.PKGDEF that collects all the Go type information from the files in the archive; that section is used by the compiler when importing the package during compilation. Usage: go tool pack [uvnbailogS][mrxtdpq][P prefix] archive files ... The new option 'g' causes pack to maintain the __.PKGDEF section as files are added to the archive. The new option 'S' forces pack to mark the archive as safe. The new option 'P' causes pack to remove the given prefix from file names in the line number information in object files that are already stored in or added to the archive. |
The pack P flag removed a leading directory prefix from all file names referred to in the pcln table. For example if you were working in /usr/rsc/go/foo and you used pack grcP /usr/rsc, the path normally referred to as /usr/rsc/go/foo/x.go would be recorded as go/foo/x.go. This is useful for removing temporary paths from the binary, so that repeated builds produce byte-for-byte identical outputs. We need this functionality, but probably not in pack. We've arranged so that pack is not necessary for most packages: 6g writes out .a files directly, and 'go' appends other supporting files directly too. There is no invocation of pack during make.bash, for example. Putting the P functionality into pack would require invoking pack again. The theory behind not invoking pack is that instead of using pack to convert to the format you want, you can save an I/O round if you make the original writer write out the format you want in the first place. This suggests that the P functionality should be in 6a, 6c, and 6g instead. CL 88300045 does this. Status changed to Started. |
CL https://golang.org/cl/88300045 mentions this issue. |
This issue was closed by revision e97b3ab. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: