diff --git a/llvm/utils/gn/build/BUILD.gn b/llvm/utils/gn/build/BUILD.gn index 3d0caf217bc0..7ad429a50486 100644 --- a/llvm/utils/gn/build/BUILD.gn +++ b/llvm/utils/gn/build/BUILD.gn @@ -42,6 +42,9 @@ config("compiler_defaults") { cflags += [ "-O3" ] } cflags += [ "-fdiagnostics-color" ] + if (use_lld) { + ldflags += [ "-Wl,--color-diagnostics" ] + } cflags_cc = [ "-std=c++14", "-fvisibility-inlines-hidden",