From 952d2a524cc86c96d3a429ba0b39675d2bd3569b Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Fri, 2 Oct 2020 20:54:30 +0100 Subject: [PATCH] linktrace-to-depfile: Support alternative linker trace formatting (for openbsd) Signed-off-by: Daniel Silverstone --- tools/linktrace-to-depfile.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/linktrace-to-depfile.pl b/tools/linktrace-to-depfile.pl index 8607baa1e..9c90af322 100644 --- a/tools/linktrace-to-depfile.pl +++ b/tools/linktrace-to-depfile.pl @@ -7,8 +7,9 @@ my %deps; while (my $line = <>) { chomp $line; - if ($line =~ /\(([^)]+)/) { - $deps{abs_path($1)} = 1; + $line =~ s/[()]/ /g; + for my $word (split(/\s+/, $line)) { + $deps{abs_path($word)} = 1 if ($word =~ /\.a$/); } }