From d8333f2904812f8febbf10988bca118ad6e1a0ed Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Sat, 4 Feb 2012 01:00:33 +0000 Subject: 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 --- tools/diagnose-me.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'tools/diagnose-me.py') 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) -- cgit v1.1