From 599ee4f7809ae508e0572525d576b27d32aa1c04 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sun, 9 Oct 2011 14:32:05 +0200 Subject: [PATCH] bisect-runner.pl needs the linux.sh libpth mutli-arch search logic. Without this, Configure can't find libm.so on mutli-arch Linux systems. --- Porting/bisect-runner.pl | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Porting/bisect-runner.pl b/Porting/bisect-runner.pl index 2ff65b9..965d932 100755 --- a/Porting/bisect-runner.pl +++ b/Porting/bisect-runner.pl @@ -28,7 +28,25 @@ my %options = my $linux64 = `uname -sm` eq "Linux x86_64\n" ? '64' : ''; -my @paths = map {$_ . $linux64} qw(/usr/local/lib /lib /usr/lib); +my @paths; + +if ($^O eq 'linux') { + # This is the search logic for a multi-arch library layout + # added to linux.sh in commits 40f026236b9959b7 and dcffd848632af2c7. + my $gcc = -x '/usr/bin/gcc' ? '/usr/bin/gcc' : 'gcc'; + + foreach (`$gcc -print-search-dirs`) { + next unless /^libraries: =(.*)/; + foreach (split ':', $1) { + next if m/gcc/; + next unless -d $_; + s!/$!!; + push @paths, $_; + } + } +} + +push @paths, map {$_ . $linux64} qw(/usr/local/lib /lib /usr/lib); my %defines = ( -- 2.7.4