diff options
-rwxr-xr-x | test/testdistcc.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/test/testdistcc.py b/test/testdistcc.py index 26a65cf..86f2a6c 100755 --- a/test/testdistcc.py +++ b/test/testdistcc.py @@ -1246,7 +1246,8 @@ class Gdb_Case(CompileHello_Case): value set by the compilation. """ os.mkdir('link') - cmd = self.distcc() + self.compiler() + " -o link/testtmp obj/testtmp.o" + cmd = self.distcc() + self.compiler() + self.build_id + + " -o link/testtmp obj/testtmp.o" out, err = self.runcmd(cmd) if out != '': self.fail("command %s produced output:\n%s" % (`cmd`, `out`)) @@ -1261,10 +1262,15 @@ class Gdb_Case(CompileHello_Case): # Test if the compiler supports --build-id=0xNNN. # If so, we need to use it for this test. + # If not, try the alternative syntax -Wl,--build-id=0xNNN instead. self.build_id = " --build-id=0x12345678 " error_rc, _, _ = self.runcmd_unchecked(self.compiler() + - (self.build_id + " -o junk %s" % self.sourceFilename())) + (self.build_id + " -o junk -I. %s" % self.sourceFilename())) if error_rc != 0: + self.build_id = " -Wl,--build-id=0x12345678 " + error_rc, _, _ = self.runcmd_unchecked(self.compiler() + + (self.build_id + " -o junk -I. %s" % self.sourceFilename())) + if error_rc != 0: self.build_id = "" CompileHello_Case.runtest (self) @@ -1282,7 +1288,7 @@ class Gdb_Case(CompileHello_Case): # the gdb commands directly on the commandline using gdb --ex, # is not as portable since only newer gdb's support it.) f = open('gdb_commands', 'w') - f.write('break main\nrun\nstep\n') + f.write('break main\nrun\nnext\n') f.close() out, errs = self.runcmd("gdb --batch --command=gdb_commands " "link/%s </dev/null" % testtmp_exe) @@ -1333,9 +1339,9 @@ class Gdb_Case(CompileHello_Case): # generated by distcc. This is just to double-check # that we didn't modify anything other than the ".debug_info" # section. - self.runcmd(self.compiler() + " -o obj/testtmp.o -I. -c %s" % + self.runcmd(self.compiler() + self.build_id + " -o obj/testtmp.o -I. -c %s" % self.sourceFilename()) - self.runcmd(self.compiler() + " -o link/testtmp obj/testtmp.o") + self.runcmd(self.compiler() + self.build_id + " -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. |