From b4bc6a3dfb61f9457e86c5afdc8e13c0123f0f77 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 1 Jun 2022 09:25:19 -0400 Subject: 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. --- pkg/symbolizer/symbolizer.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pkg/symbolizer') 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 -- cgit mrf-deployment