strip src/runtime/race syso files?

151 views
Skip to first unread message

Daniel Martí

unread,
May 27, 2022, 5:45:57 PM5/27/22
to golang-dev
Hi all,

I just noticed that the prebuilt runtime/race syso files don't appear to
be stripped ahead of time:

$ strip src/runtime/race/race_linux_amd64.syso
$ git diff --stat
src/runtime/race/race_linux_amd64.syso | Bin 552768 -> 312880 bytes
1 file changed, 0 insertions(+), 0 deletions(-)

Is there a benefit to keeping them in VCS and distributing them with
debug info? Is it useful for any reason?

If it's not, perhaps we could shave off a couple of megabytes from the
distribution sizes.

Keith Randall

unread,
May 27, 2022, 7:04:01 PM5/27/22
to Daniel Martí, golang-dev
You make a good point, I'm not sure if it is useful for the syso files to be unstripped.
If you strip them and race.bash still works, go for it.
We should update the .syso build procedure in golang.org/x/build/cmd/racebuild.

--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-dev/20220527214424.xdhif2vtmikfl7t3%40p14s.localdomain.

Daniel Martí

unread,
May 30, 2022, 9:05:40 AM5/30/22
to Keith Randall, golang-dev
Just calling regular GNU strip without any flags, like in the diffstat I
showed earlier, does break race builds:

$ go build -race cmd/gofmt
# runtime/race
/usr/bin/ld: error in runtime/race/race_linux_amd64.syso(.eh_frame); no .eh_frame_hdr table will be created
# cmd/gofmt
runtime.runfinq: relocation target __tsan_finalizer_goroutine not defined
runtime.(*p).init: relocation target __tsan_proc_create not defined
runtime.(*p).destroy: relocation target __tsan_proc_destroy not defined
runtime.RaceDisable: relocation target __tsan_go_ignore_sync_begin not defined
runtime.RaceEnable: relocation target __tsan_go_ignore_sync_end not defined
[...]

Unclear if there's anything to improve here, then. My bad for not
noticing the breakage - it's clear that I'm not used to syso files :)
Reply all
Reply to author
Forward
0 new messages