From 2b9349db3888ee3df30382d2e647ead34adb5666 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Mon, 21 Dec 2015 22:09:34 +0000 Subject: [clang-cl] Add support for /Brepro The /Brepro flag controls whether or not the compiler should embed timestamps into the object file. Object files which do not embed timestamps are not suitable for incremental linking but are suitable for hermetic build systems and staged self-hosts of clang. A normal clang spelling of this flag has been added, -mincremental-linker-compatible. llvm-svn: 256204 --- clang/lib/Driver/Tools.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'clang/lib/Driver/Tools.cpp') diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index fd299ea695a..54570286779 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -2567,6 +2567,15 @@ static void CollectArgsForIntegratedAssembler(Compilation &C, if (UseRelaxAll(C, Args)) CmdArgs.push_back("-mrelax-all"); + // Only default to -mincremental-linker-compatible if we think we are + // targeting the MSVC linker. + bool DefaultIncrementalLinkerCompatible = + C.getDefaultToolChain().getTriple().isWindowsMSVCEnvironment(); + if (Args.hasFlag(options::OPT_mincremental_linker_compatible, + options::OPT_mno_incremental_linker_compatible, + DefaultIncrementalLinkerCompatible)) + CmdArgs.push_back("-mincremental-linker-compatible"); + // When passing -I arguments to the assembler we sometimes need to // unconditionally take the next argument. For example, when parsing // '-Wa,-I -Wa,foo' we need to accept the -Wa,foo arg after seeing the -- cgit v1.2.3