From fc8d07c4b13c44c4ea8ee2c10ce1537e393aa91f Mon Sep 17 00:00:00 2001 From: "fergus.henderson" Date: Tue, 16 Nov 2010 19:05:30 +0000 Subject: Fix for "Gdb tests fail in pumped mode on Ubuntu 9.10 amd64": pass --build-id to gcc versions that support it. (See 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 --- test/testdistcc.py | 15 +++++++++++++-- 1 file 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, -- cgit v1.2.1