summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfergus.henderson <fergushenderson@users.noreply.github.com>2010-11-16 19:05:30 +0000
committerfergus.henderson <fergushenderson@users.noreply.github.com>2010-11-16 19:05:30 +0000
commit96b2191bb699fcbb3b14024dd894a17af1cd22b8 (patch)
tree2218e6b7b20c807b4ad199d68f56072251241282
parentdcc372b52ff04cd7bd90e4ff9e59295d5a3669f2 (diff)
downloaddistcc-git-96b2191bb699fcbb3b14024dd894a17af1cd22b8.tar.gz
Fix for <http://code.google.com/p/distcc/issues/detail?id=61>
"Gdb tests fail in pumped mode on Ubuntu 9.10 amd64": pass --build-id to gcc versions that support it. (See <http://fedoraproject.org/wiki/RolandMcGrath/BuildID> for a description of the --build-id switch.) Reviewed by Craig Silverstein.
-rwxr-xr-xtest/testdistcc.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/testdistcc.py b/test/testdistcc.py
index 1d0195f..26a65cf 100755
--- a/test/testdistcc.py
+++ b/test/testdistcc.py
@@ -1234,6 +1234,7 @@ class Gdb_Case(CompileHello_Case):
"""Return command to compile source"""
os.mkdir("obj")
return self.distcc_without_fallback() + self.compiler() + \
+ self.build_id + \
" -o obj/testtmp.o -I. -c %s" % (self.sourceFilename())
def link(self):
@@ -1257,8 +1258,16 @@ class Gdb_Case(CompileHello_Case):
error_rc, _, _ = self.runcmd_unchecked("gdb --help")
if error_rc != 0:
raise comfychair.NotRunError ('gdb could not be found on path')
- else:
- CompileHello_Case.runtest (self)
+
+ # Test if the compiler supports --build-id=0xNNN.
+ # If so, we need to use it for this test.
+ self.build_id = " --build-id=0x12345678 "
+ error_rc, _, _ = self.runcmd_unchecked(self.compiler() +
+ (self.build_id + " -o junk %s" % self.sourceFilename()))
+ if error_rc != 0:
+ self.build_id = ""
+
+ CompileHello_Case.runtest (self)
def checkBuiltProgram(self):
# On windows, the binary may be called testtmp.exe. Check both
@@ -1328,6 +1337,8 @@ class Gdb_Case(CompileHello_Case):
self.sourceFilename())
self.runcmd(self.compiler() + " -o link/testtmp obj/testtmp.o")
self.runcmd("strip link/%s && strip run/%s" % (testtmp_exe, testtmp_exe))
+ # On newer versions of Linux, this works only because we pass
+ # --build-id=0x12345678.
# On OS X, the strict bit-by-bit comparison will fail, because
# mach-o format includes a unique UUID which will differ
# between the two testtmp binaries. For Microsoft PE output,