[build.py] Embed the output file name in generated object file names.
In compile-and-link mode, the user doesn't specify the name of the
object files to generate, because there could be multiple inputs
on a single command line and this would be hard to specify. So the
script just tries to be smart and figure out the best object file
names. However, if two build scripts are running in parallel and
using the same source files as input, they would previously race
to write the same object files, since the computed name only considered
the source file names when computing the object file names.
With this patch, we also consider the final executable name. In a
way, this "namespaces" the generated object files so that as long
as the final executable file names don't clash, the intermediate
object file names won't clash either.
llvm-svn: 348511