diff --git a/llvm/tools/lto/lto.cpp b/llvm/tools/lto/lto.cpp --- a/llvm/tools/lto/lto.cpp +++ b/llvm/tools/lto/lto.cpp @@ -407,6 +407,8 @@ static void maybeParseOptions(lto_code_gen_t cg) { if (!parsedOptions) { unwrap(cg)->parseCodeGenDebugOptions(); + // update the TargetOptions after parsing the debug options. + unwrap(cg)->setTargetOptions(InitTargetOptionsFromCodeGenFlags()); lto_add_attrs(cg); parsedOptions = true; }