summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfergus.henderson <fergus.henderson@01de4be4-8c4a-0410-9132-4925637da917>2010-11-16 19:05:30 +0000
committerfergus.henderson <fergus.henderson@01de4be4-8c4a-0410-9132-4925637da917>2010-11-16 19:05:30 +0000
commitfc8d07c4b13c44c4ea8ee2c10ce1537e393aa91f (patch)
tree2218e6b7b20c807b4ad199d68f56072251241282
parent09d8d6326d87c562e9b1217891be9f903a483942 (diff)
downloaddistcc-fc8d07c4b13c44c4ea8ee2c10ce1537e393aa91f.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. git-svn-id: http://distcc.googlecode.com/svn/trunk@735 01de4be4-8c4a-0410-9132-4925637da917
-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,