@@ -144,8 +144,6 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
144144 .Default (llvm::DebugCompressionType::None);
145145 }
146146
147- Opts.RelaxELFRelocations = !Args.hasArg (OPT_mrelax_relocations_no);
148- Opts.SSE2AVX = Args.hasArg (OPT_msse2avx);
149147 if (auto *DwarfFormatArg = Args.getLastArg (OPT_gdwarf64, OPT_gdwarf32))
150148 Opts.Dwarf64 = DwarfFormatArg->getOption ().matches (OPT_gdwarf64);
151149 Opts.DwarfVersion = getLastArgIntValue (Args, OPT_dwarf_version_EQ, 2 , Diags);
@@ -236,6 +234,9 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
236234 Opts.EmitCompactUnwindNonCanonical =
237235 Args.hasArg (OPT_femit_compact_unwind_non_canonical);
238236 Opts.Crel = Args.hasArg (OPT_crel);
237+ Opts.ImplicitMapsyms = Args.hasArg (OPT_mmapsyms_implicit);
238+ Opts.X86RelaxRelocations = !Args.hasArg (OPT_mrelax_relocations_no);
239+ Opts.X86Sse2Avx = Args.hasArg (OPT_msse2avx);
239240
240241 Opts.AsSecureLogFile = Args.getLastArgValue (OPT_as_secure_log_file);
241242
@@ -294,8 +295,9 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
294295 MCOptions.EmitCompactUnwindNonCanonical = Opts.EmitCompactUnwindNonCanonical ;
295296 MCOptions.MCSaveTempLabels = Opts.SaveTemporaryLabels ;
296297 MCOptions.Crel = Opts.Crel ;
297- MCOptions.X86RelaxRelocations = Opts.RelaxELFRelocations ;
298- MCOptions.X86Sse2Avx = Opts.SSE2AVX ;
298+ MCOptions.ImplicitMapSyms = Opts.ImplicitMapsyms ;
299+ MCOptions.X86RelaxRelocations = Opts.X86RelaxRelocations ;
300+ MCOptions.X86Sse2Avx = Opts.X86Sse2Avx ;
299301 MCOptions.CompressDebugSections = Opts.CompressDebugSections ;
300302 MCOptions.AsSecureLogFile = Opts.AsSecureLogFile ;
301303
@@ -343,10 +345,6 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
343345 // MCObjectFileInfo needs a MCContext reference in order to initialize itself.
344346 std::unique_ptr<MCObjectFileInfo> MOFI (
345347 TheTarget->createMCObjectFileInfo (Ctx, PIC));
346- if (Opts.DarwinTargetVariantTriple )
347- MOFI->setDarwinTargetVariantTriple (*Opts.DarwinTargetVariantTriple );
348- if (!Opts.DarwinTargetVariantSDKVersion .empty ())
349- MOFI->setDarwinTargetVariantSDKVersion (Opts.DarwinTargetVariantSDKVersion );
350348 Ctx.setObjectFileInfo (MOFI.get ());
351349
352350 if (Opts.GenDwarfForAssembly )
@@ -428,6 +426,13 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
428426 Str.reset (TheTarget->createMCObjectStreamer (
429427 T, Ctx, std::move (MAB), std::move (OW), std::move (CE), *STI));
430428 Str.get ()->initSections (Opts.NoExecStack , *STI);
429+ if (T.isOSBinFormatMachO () && T.isOSDarwin ()) {
430+ Triple *TVT = Opts.DarwinTargetVariantTriple
431+ ? &*Opts.DarwinTargetVariantTriple
432+ : nullptr ;
433+ Str->emitVersionForTarget (T, VersionTuple (), TVT,
434+ Opts.DarwinTargetVariantSDKVersion );
435+ }
431436 }
432437
433438 // When -fembed-bitcode is passed to clang_as, a 1-byte marker
0 commit comments