aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/symbolizer
diff options
context:
space:
mode:
authorMark Johnston <markjdb@gmail.com>2022-06-01 09:25:19 -0400
committerDmitry Vyukov <dvyukov@google.com>2022-06-01 16:17:18 +0200
commitb4bc6a3dfb61f9457e86c5afdc8e13c0123f0f77 (patch)
tree03db83102d16ce67ae85e7d98d0a1fe3887fcece /pkg/symbolizer
parent3666edfeb55080ebe138d77417fa96fe2555d6bb (diff)
pkg/symbolizer: limit addr2line output checks to Darwin
The checks assume that addr2line comes from binutils, but by default this is not the case on FreeBSD.
Diffstat (limited to 'pkg/symbolizer')
-rw-r--r--pkg/symbolizer/symbolizer.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/symbolizer/symbolizer.go b/pkg/symbolizer/symbolizer.go
index 174f2e581..8cf6c8cf1 100644
--- a/pkg/symbolizer/symbolizer.go
+++ b/pkg/symbolizer/symbolizer.go
@@ -66,6 +66,10 @@ func (s *Symbolizer) Close() {
}
func (s *Symbolizer) checkBinSupport(addr2line string) error {
+ if s.target.OS != targets.Darwin || s.target.Arch != targets.AMD64 {
+ return nil
+ }
+
cmd := exec.Command(addr2line, "--help")
cmd.Env = append(os.Environ(), "LC_ALL=C")
out, err := cmd.CombinedOutput()
@@ -75,8 +79,7 @@ func (s *Symbolizer) checkBinSupport(addr2line string) error {
if !bytes.Contains(out, []byte("supported targets:")) {
return fmt.Errorf("addr2line output didn't contain supported targets")
}
- if s.target.OS == targets.Darwin && s.target.Arch == targets.AMD64 &&
- !bytes.Contains(out, []byte("mach-o-x86-64")) {
+ if !bytes.Contains(out, []byte("mach-o-x86-64")) {
return fmt.Errorf("addr2line was built without mach-o-x86-64 support")
}
return nil