Get rid of extra compiler call for lsan suppressions: pass .cpp to link command since we always call compiler for linking
@@ -25,15 +25,6 @@ def gen_default_suppressions(inputs, output):
dst.write('}\n')
-def compile_file(src, dst, cmd):
- cmd = list(cmd)
- cmd = [a for a in cmd if not a.endswith((".a", ".o", ".obj"))]
- output_pos = cmd.index("-o")
- cmd[output_pos + 1] = dst
- cmd += ["-c", src, "-Wno-unused-command-line-argument"]
- return subprocess.call(cmd, shell=False, stderr=sys.stderr, stdout=sys.stdout)
-
-
if __name__ == '__main__':
cmd = sys.argv[1:]
supp, cmd = get_leaks_suppressions(cmd)
@@ -42,8 +33,5 @@ if __name__ == '__main__':
else:
src_file = "lsan_default_suppressions.cpp"
gen_default_suppressions(supp, src_file)
- obj_file = src_file + ".o"
- rc = compile_file(src_file, obj_file, cmd)
- if rc == 0:
- rc = subprocess.call(cmd + [obj_file], shell=False, stderr=sys.stderr, stdout=sys.stdout)
+ rc = subprocess.call(cmd + [src_file], shell=False, stderr=sys.stderr, stdout=sys.stdout)
sys.exit(rc)
