summaryrefslogtreecommitdiffstats
path: root/tools/diagnose-me.py
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-04 01:00:33 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-04 01:00:33 +0000
commitd8333f2904812f8febbf10988bca118ad6e1a0ed (patch)
treeb8dd90c674dfbcbe01302b4e69fcbd310d90ba06 /tools/diagnose-me.py
parentb082b024f9ffee2467c96b382f586fe78c2b8491 (diff)
downloadchromium_src-d8333f2904812f8febbf10988bca118ad6e1a0ed.zip
chromium_src-d8333f2904812f8febbf10988bca118ad6e1a0ed.tar.gz
chromium_src-d8333f2904812f8febbf10988bca118ad6e1a0ed.tar.bz2
diagnose-me.py: attempt to diagnose /usr/local/gold setup
Check for symlinks into /usr/local/gold, then suggest deleting it. Review URL: https://chromiumcodereview.appspot.com/9323051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120446 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/diagnose-me.py')
-rwxr-xr-xtools/diagnose-me.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/diagnose-me.py b/tools/diagnose-me.py
index 75bcfae..d2fad58 100755
--- a/tools/diagnose-me.py
+++ b/tools/diagnose-me.py
@@ -6,6 +6,7 @@
"""Diagnose some common system configuration problems on Linux, and
suggest fixes."""
+import os
import subprocess
import sys
@@ -43,6 +44,35 @@ def CheckPathLd():
return None
+@Check("/usr/local/gold is cleaned up")
+def CheckLocalGold():
+ # Check /usr/bin/ld* symlinks.
+ for path in ('ld.bfd', 'ld.gold', 'ld'):
+ path = '/usr/bin/' + path
+ try:
+ target = os.readlink(path)
+ except OSError, e:
+ if e.errno == 2:
+ continue # No such file
+ if e.errno == 22:
+ continue # Not a symlink
+ raise
+ if '/usr/local/gold' in target:
+ return ("%s is a symlink into /usr/local/gold.\n"
+ "It's difficult to make a recommendation, because you\n"
+ "probably set this up yourself. But you should make\n"
+ "/usr/bin/ld be the standard linker, which you likely\n"
+ "renamed /usr/bin/ld.bfd or something like that.\n")
+
+ if os.path.exists('/usr/local/gold'):
+ return ("You have a /usr/local/gold, which is no longer needed.\n"
+ "Check that you don't have any references to it in your\n"
+ "set up and then delete it.\n")
+
+ return None
+
+
+
def RunChecks():
for name, check in all_checks:
sys.stdout.write("* Checking %s: " % name)