gn: Diag on distinct toolchains with the same name.

Previously, toolchains with the same name used to silently write to the same output
directory and clobber each others generated .ninja files.  After this patch, this still
happens, but gn writes an error message while writing the final build.ninja file.

Example output:
ERROR at //build/toolchain/mac2/BUILD.gn:51:3: Duplicate toolchain.
  toolchain(target_name) {
  ^-----------------------
Two or more toolchains write to the same directory:
  //out/gn1/clang_x64/

This can be fixed by making sure that distinct toolchains have
distinct names.

See //build/toolchain/mac3/BUILD.gn:51:3: Previous toolchain.
  toolchain(target_name) {
  ^-----------------------

Depends on https://codereview.chromium.org/2485523002/

BUG=661054

Review-Url: https://codereview.chromium.org/2483713003
Cr-Original-Commit-Position: refs/heads/master@{#430473}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: eab6e2d58dc3b71e094ff58d822980ca3473caf8
2 files changed
tree: f4fa48f5fd6052bc27314000e28e34e90a75fa48
  1. tools/