[llvm-commits] CVS: llvm/utils/GenLibDeps.pl
Reid Spencer
reid at x10sys.com
Fri May 12 19:48:58 PDT 2006
Changes in directory llvm/utils:
GenLibDeps.pl updated: 1.7 -> 1.8
---
Log message:
Don't try to reference uninitialized data. Make sure we can find "nm".
---
Diffs of the changes: (+8 -4)
GenLibDeps.pl | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
Index: llvm/utils/GenLibDeps.pl
diff -u llvm/utils/GenLibDeps.pl:1.7 llvm/utils/GenLibDeps.pl:1.8
--- llvm/utils/GenLibDeps.pl:1.7 Wed May 3 13:16:01 2006
+++ llvm/utils/GenLibDeps.pl Fri May 12 21:48:45 2006
@@ -23,11 +23,15 @@
my $Directory = $ARGV[0];
# Find the "dot" program
+my $DotPath="";
if (!$FLAT) {
- chomp(my $DotPath = `which dot`);
+ chomp($DotPath = `which dot`);
die "Can't find 'dot'" if (! -x "$DotPath");
}
+chomp(my $nmPath=`which nm`);
+die "Can't find 'nm'" if (! -x "$nmPath");
+
# Open the directory and read its contents, sorting by name and differentiating
# by whether its a library (.a) or an object file (.o)
opendir DIR,$Directory;
@@ -44,7 +48,7 @@
# Gather definitions from the libraries
foreach $lib (@libs ) {
open DEFS,
- "nm -g $Directory/$lib | grep ' [ABCDGRST] ' | sed -e 's/^[0-9A-Fa-f]* [ABCDGRST] //' | sort | uniq |";
+ "$nmPath -g $Directory/$lib | grep ' [ABCDGRST] ' | sed -e 's/^[0-9A-Fa-f]* [ABCDGRST] //' | sort | uniq |";
while (<DEFS>) {
chomp($_);
$libdefs{$_} = $lib;
@@ -55,7 +59,7 @@
# Gather definitions from the object files.
foreach $obj (@objs ) {
open DEFS,
- "nm -g $Directory/$obj | grep ' [ABCDGRST] ' | sed -e 's/^[0-9A-Fa-f]* [ABCDGRST] //' | sort | uniq |";
+ "$nmPath -g $Directory/$obj | grep ' [ABCDGRST] ' | sed -e 's/^[0-9A-Fa-f]* [ABCDGRST] //' | sort | uniq |";
while (<DEFS>) {
chomp($_);
$objdefs{$_} = $obj;
@@ -76,7 +80,7 @@
print " <dt><b>$lib</b</dt><dd><ul>\n";
}
open UNDEFS,
- "nm -g -u $Directory/$lib | sed -e 's/^ *U //' | sort | uniq |";
+ "$nmPath -g -u $Directory/$lib | sed -e 's/^ *U //' | sort | uniq |";
open DEPENDS,
"| sort | uniq > GenLibDeps.out";
while (<UNDEFS>) {
More information about the llvm-commits
mailing list