Lines Matching +full:diag +full:- +full:version
1 //===--- Darwin.cpp - Darwin Tool and ToolChain Implementations -*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
43 // See arch(3) and llvm-gcc's driver-driver.c. We don't implement support for in getArchTypeForMachOArchName()
48 // historically the driver accepts this and also ties its -march= in getArchTypeForMachOArchName()
86 // Don't reject these -version-min= if we have the appropriate triple. in setTripleTypeForMachOArchName()
89 A->ignoreTargetSpecific(); in setTripleTypeForMachOArchName()
92 A->ignoreTargetSpecific(); in setTripleTypeForMachOArchName()
95 A->ignoreTargetSpecific(); in setTripleTypeForMachOArchName()
116 while (SourceAction->getKind() != Action::InputClass) { in ConstructJob()
117 assert(!SourceAction->getInputs().empty() && "unexpected root action!"); in ConstructJob()
118 SourceAction = SourceAction->getInputs()[0]; in ConstructJob()
121 // If -fno-integrated-as is used add -Q to the darwin assembler driver to make in ConstructJob()
123 // Applicable to darwin11+ and Xcode 4+. darwin<10 lacked integrated-as. in ConstructJob()
124 // FIXME: at run-time detect assembler capabilities or rely on version in ConstructJob()
125 // information forwarded by -target-assembler-version. in ConstructJob()
128 CmdArgs.push_back("-Q"); in ConstructJob()
131 // Forward -g, assuming we are dealing with an actual assembly file. in ConstructJob()
132 if (SourceAction->getType() == types::TY_Asm || in ConstructJob()
133 SourceAction->getType() == types::TY_PP_Asm) { in ConstructJob()
135 CmdArgs.push_back("--gstabs"); in ConstructJob()
137 CmdArgs.push_back("-g"); in ConstructJob()
143 // Use -force_cpusubtype_ALL on x86 by default. in ConstructJob()
145 CmdArgs.push_back("-force_cpusubtype_ALL"); in ConstructJob()
152 CmdArgs.push_back("-static"); in ConstructJob()
157 CmdArgs.push_back("-o"); in ConstructJob()
177 CmdArgs.push_back("-arch"); in AddMachOArch()
182 CmdArgs.push_back("-force_cpusubtype_ALL"); in AddMachOArch()
196 /// Pass -no_deduplicate to ld64 under certain conditions:
198 /// - Either -O0 or -O1 is explicitly specified
199 /// - No -O option is specified *and* this is a compile+link (implicit -O0)
201 /// Also do *not* add -no_deduplicate when no -O option is specified and this
202 /// is just a link (we can't imply -O0)
205 if (A->getOption().matches(options::OPT_O0)) in shouldLinkerNotDedup()
207 if (A->getOption().matches(options::OPT_O)) in shouldLinkerNotDedup()
208 return llvm::StringSwitch<bool>(A->getValue()) in shouldLinkerNotDedup()
214 if (!IsLinkerOnlyAction) // Implicit -O0 for compile+linker only. in shouldLinkerNotDedup()
222 VersionTuple Version, bool LinkerIsLLD, in AddLinkArgs() argument
227 // Newer linkers support -demangle. Pass it if supported and not disabled by in AddLinkArgs()
229 if ((Version >= VersionTuple(100) || LinkerIsLLD) && in AddLinkArgs()
231 CmdArgs.push_back("-demangle"); in AddLinkArgs()
234 (Version >= VersionTuple(137) || LinkerIsLLD)) in AddLinkArgs()
235 CmdArgs.push_back("-export_dynamic"); in AddLinkArgs()
241 CmdArgs.push_back("-application_extension"); in AddLinkArgs()
243 if (D.isUsingLTO() && (Version >= VersionTuple(116) || LinkerIsLLD) && in AddLinkArgs()
259 CmdArgs.push_back("-object_path_lto"); in AddLinkArgs()
264 // Use -lto_library option to specify the libLTO.dylib path. Try to find in AddLinkArgs()
270 // clang version won't work anyways. in AddLinkArgs()
273 if (Version >= VersionTuple(133) && !LinkerIsLLD) { in AddLinkArgs()
279 CmdArgs.push_back("-lto_library"); in AddLinkArgs()
283 // ld64 version 262 and above runs the deduplicate pass by default. in AddLinkArgs()
284 // FIXME: lld doesn't dedup by default. Should we pass `--icf=safe` in AddLinkArgs()
286 if (Version >= VersionTuple(262) && in AddLinkArgs()
288 CmdArgs.push_back("-no_deduplicate"); in AddLinkArgs()
293 CmdArgs.push_back("-dynamic"); in AddLinkArgs()
295 // FIXME: gcc replaces -lobjc in forward args with -lobjc-gnu in AddLinkArgs()
312 D.Diag(diag::err_drv_argument_only_allowed_with) << A->getAsString(Args) in AddLinkArgs()
313 << "-dynamiclib"; in AddLinkArgs()
319 CmdArgs.push_back("-dylib"); in AddLinkArgs()
328 D.Diag(diag::err_drv_argument_not_allowed_with) << A->getAsString(Args) in AddLinkArgs()
329 << "-dynamiclib"; in AddLinkArgs()
332 "-dylib_compatibility_version"); in AddLinkArgs()
334 "-dylib_current_version"); in AddLinkArgs()
339 "-dylib_install_name"); in AddLinkArgs()
359 if (Version >= VersionTuple(520) || LinkerIsLLD || UsePlatformVersion) in AddLinkArgs()
373 if (A->getOption().matches(options::OPT_fpie) || in AddLinkArgs()
374 A->getOption().matches(options::OPT_fPIE)) in AddLinkArgs()
375 CmdArgs.push_back("-pie"); in AddLinkArgs()
377 CmdArgs.push_back("-no_pie"); in AddLinkArgs()
380 // for embed-bitcode, use -bitcode_bundle in linker command in AddLinkArgs()
384 CmdArgs.push_back("-bitcode_bundle"); in AddLinkArgs()
387 Version >= VersionTuple(278)) { in AddLinkArgs()
388 CmdArgs.push_back("-bitcode_process_mode"); in AddLinkArgs()
392 D.Diag(diag::err_drv_bitcode_unsupported_on_toolchain); in AddLinkArgs()
398 if (A->getOption().matches(options::OPT_fglobal_isel)) { in AddLinkArgs()
399 CmdArgs.push_back("-mllvm"); in AddLinkArgs()
400 CmdArgs.push_back("-global-isel"); in AddLinkArgs()
402 CmdArgs.push_back("-mllvm"); in AddLinkArgs()
403 CmdArgs.push_back("-global-isel-abort=0"); in AddLinkArgs()
410 CmdArgs.push_back("-mllvm"); in AddLinkArgs()
411 CmdArgs.push_back("-disable-atexit-based-global-dtor-lowering"); in AddLinkArgs()
431 // Give --sysroot= preference, over the Apple specific behavior to also use in AddLinkArgs()
432 // --isysroot as the syslibroot. in AddLinkArgs()
435 CmdArgs.push_back("-syslibroot"); in AddLinkArgs()
438 CmdArgs.push_back("-syslibroot"); in AddLinkArgs()
439 CmdArgs.push_back(A->getValue()); in AddLinkArgs()
466 SmallString<128> Path(CSPGOGenerateArg->getNumValues() == 0 in AddLinkArgs()
468 : CSPGOGenerateArg->getValue()); in AddLinkArgs()
470 CmdArgs.push_back("--cs-profile-generate"); in AddLinkArgs()
471 CmdArgs.push_back(Args.MakeArgString(Twine("--cs-profile-path=") + Path)); in AddLinkArgs()
474 ProfileUseArg->getNumValues() == 0 ? "" : ProfileUseArg->getValue()); in AddLinkArgs()
477 CmdArgs.push_back(Args.MakeArgString(Twine("--cs-profile-path=") + Path)); in AddLinkArgs()
501 D.Diag(diag::err_drv_invalid_output_with_multiple_archs) in checkRemarksOptions()
502 << "-foptimization-record-file"; in checkRemarksOptions()
513 Format = A->getValue(); in renderRemarksOptions()
515 CmdArgs.push_back("-mllvm"); in renderRemarksOptions()
516 CmdArgs.push_back("-lto-pass-remarks-output"); in renderRemarksOptions()
517 CmdArgs.push_back("-mllvm"); in renderRemarksOptions()
521 CmdArgs.push_back(A->getValue()); in renderRemarksOptions()
534 CmdArgs.push_back("-mllvm"); in renderRemarksOptions()
536 std::string("-lto-pass-remarks-filter=") + A->getValue(); in renderRemarksOptions()
541 CmdArgs.push_back("-mllvm"); in renderRemarksOptions()
542 Twine FormatArg = Twine("-lto-pass-remarks-format=") + Format; in renderRemarksOptions()
547 CmdArgs.push_back("-mllvm"); in renderRemarksOptions()
548 CmdArgs.push_back("-lto-pass-remarks-with-hotness"); in renderRemarksOptions()
552 CmdArgs.push_back("-mllvm"); in renderRemarksOptions()
554 std::string("-lto-pass-remarks-hotness-threshold=") + A->getValue(); in renderRemarksOptions()
572 // -filelist linker option. in ConstructJob()
584 Arg->claim(); in ConstructJob()
594 VersionTuple Version = getMachOToolChain().getLinkerVersion(Args); in ConstructJob() local
600 // xrOS always uses -platform-version. in ConstructJob()
605 AddLinkArgs(C, Args, CmdArgs, Inputs, Version, LinkerIsLLD, in ConstructJob()
613 // Propagate the -moutline flag to the linker in LTO. in ConstructJob()
616 if (A->getOption().matches(options::OPT_moutline)) { in ConstructJob()
618 CmdArgs.push_back("-mllvm"); in ConstructJob()
619 CmdArgs.push_back("-enable-machine-outliner"); in ConstructJob()
622 // Disable all outlining behaviour if we have mno-outline. We need to do in ConstructJob()
625 CmdArgs.push_back("-mllvm"); in ConstructJob()
626 CmdArgs.push_back("-enable-machine-outliner=never"); in ConstructJob()
632 // independently of -moutline. in ConstructJob()
633 CmdArgs.push_back("-mllvm"); in ConstructJob()
634 CmdArgs.push_back("-enable-linkonceodr-outlining"); in ConstructJob()
640 CmdArgs.push_back("-mllvm"); in ConstructJob()
641 CmdArgs.push_back(Args.MakeArgString("-lto-stats-file=" + StatsFile.str())); in ConstructJob()
649 // Forward -ObjC when either -ObjC or -ObjC++ is used, to force loading in ConstructJob()
650 // members of static archive libraries which implement Objective-C classes or in ConstructJob()
653 CmdArgs.push_back("-ObjC"); in ConstructJob()
655 CmdArgs.push_back("-o"); in ConstructJob()
664 // Build the input file for -filelist (list of linker input files) in case we in ConstructJob()
669 // We cannot mix input arguments and file names in a -filelist input, thus in ConstructJob()
681 // Additional linker set-up and flags for Fortran. This is required in order in ConstructJob()
696 CmdArgs.push_back("-framework"); in ConstructJob()
699 CmdArgs.push_back("-lobjc"); in ConstructJob()
703 CmdArgs.push_back("-arch_multiple"); in ConstructJob()
704 CmdArgs.push_back("-final_output"); in ConstructJob()
709 CmdArgs.push_back("-allow_stack_execute"); in ConstructJob()
715 CmdArgs.push_back("-mllvm"); in ConstructJob()
717 llvm::get_threadpool_strategy(Parallelism)->compute_thread_count(); in ConstructJob()
718 CmdArgs.push_back(Args.MakeArgString("-threads=" + Twine(NumThreads))); in ConstructJob()
730 // If we have both -nostdlib/nodefaultlibs and -fapple-link-rtlib then in ConstructJob()
752 // -iframework should be forwarded as -F. in ConstructJob()
754 CmdArgs.push_back(Args.MakeArgString(std::string("-F") + A->getValue())); in ConstructJob()
758 if (A->getValue() == StringRef("Accelerate")) { in ConstructJob()
759 CmdArgs.push_back("-framework"); in ConstructJob()
765 // Add non-standard, platform-specific search paths, e.g., for DriverKit: in ConstructJob()
766 // -L<sysroot>/System/DriverKit/usr/lib in ConstructJob()
767 // -F<sysroot>/System/DriverKit/System/Library/Framework in ConstructJob()
772 // ld64 fixed the implicit -F and -L paths in ld64-605.1+. in ConstructJob()
774 Version.getMajor() < 605 || in ConstructJob()
775 (Version.getMajor() == 605 && Version.getMinor().value_or(0) < 1); in ConstructJob()
781 SmallString<128> P(Sysroot->getValue()); in ConstructJob()
788 AddSearchPath("-L", "/usr/lib"); in ConstructJob()
789 AddSearchPath("-F", "/System/Library/Frameworks"); in ConstructJob()
795 if (Version >= VersionTuple(705) || LinkerIsLLD) { in ConstructJob()
800 "-filelist"}; in ConstructJob()
805 Cmd->setInputFileList(std::move(InputFileList)); in ConstructJob()
816 // Silence warning for "clang -g foo.o -o foo" in ConstructJob()
818 // and "clang -emit-llvm foo.o -o foo" in ConstructJob()
820 // and for "clang -w foo.o -o foo". Other warning options are already in ConstructJob()
823 // Silence warnings when linking C code with a C++ '-stdlib' argument. in ConstructJob()
829 CmdArgs.push_back("-static"); in ConstructJob()
830 CmdArgs.push_back("-D"); in ConstructJob()
831 CmdArgs.push_back("-no_warning_for_no_symbols"); in ConstructJob()
832 CmdArgs.push_back("-o"); in ConstructJob()
846 D.Diag(diag::err_drv_unable_to_remove_file) << EC.message(); in ConstructJob()
864 CmdArgs.push_back("-create"); in ConstructJob()
867 CmdArgs.push_back("-output"); in ConstructJob()
887 CmdArgs.push_back("-o"); in ConstructJob()
907 CmdArgs.push_back("--verify"); in ConstructJob()
908 CmdArgs.push_back("--debug-info"); in ConstructJob()
909 CmdArgs.push_back("--eh-frame"); in ConstructJob()
910 CmdArgs.push_back("--quiet"); in ConstructJob()
931 /// Darwin - Darwin tool chain for i386 and x86_64.
939 // Darwin always preprocesses assembly files (unless -x is used explicitly). in LookupTypeForExtension()
961 auto T = llvm::Triple(Twine("arm64-apple-") + in getDefaultObjCRuntime()
985 CudaInstallation->AddCudaIncludeArgs(DriverArgs, CC1Args); in AddCudaIncludeArgs()
990 RocmInstallation->AddHIPIncludeArgs(DriverArgs, CC1Args); in AddHIPIncludeArgs()
1005 .Cases("armv7a", "armv7-a", "armv7") in ArmMachOArchName()
1006 .Cases("armv7r", "armv7-r", "armv7") in ArmMachOArchName()
1007 .Cases("armv7em", "armv7e-m", "armv7em") in ArmMachOArchName()
1008 .Cases("armv7k", "armv7-k", "armv7k") in ArmMachOArchName()
1009 .Cases("armv7m", "armv7-m", "armv7m") in ArmMachOArchName()
1010 .Cases("armv7s", "armv7-s", "armv7s") in ArmMachOArchName()
1050 if (const char *Arch = ArmMachOArchName(A->getValue())) in getMachOArchName()
1054 if (const char *Arch = ArmMachOArchNameCPU(A->getValue())) in getMachOArchName()
1066 (void)NewLinkerVersion.tryParse(A->getValue()); in getLinkerVersion()
1074 if (NewLinkerVersion.tryParse(A->getValue())) in getLinkerVersion()
1075 getDriver().Diag(diag::err_drv_invalid_version_number) in getLinkerVersion()
1076 << A->getAsString(Args); in getLinkerVersion()
1149 CC1Args.push_back("-Wundef-prefix=TARGET_OS_"); in addClangWarningOptions()
1150 CC1Args.push_back("-Werror=undef-prefix"); in addClangWarningOptions()
1154 // Always enable -Wdeprecated-objc-isa-usage and promote it in addClangWarningOptions()
1156 CC1Args.push_back("-Wdeprecated-objc-isa-usage"); in addClangWarningOptions()
1157 CC1Args.push_back("-Werror=deprecated-objc-isa-usage"); in addClangWarningOptions()
1162 CC1Args.push_back("-Werror=implicit-function-declaration"); in addClangWarningOptions()
1210 StringRef XcodePathForSDK = getXcodeDeveloperPath(A->getValue()); in AddLinkARCArgs()
1230 CmdArgs.push_back("-force_load"); in AddLinkARCArgs()
1250 getDriver().Diag(clang::diag::err_drv_darwin_sdk_missing_arclite) << P; in AddLinkARCArgs()
1260 // Default to use DWARF 4 on OS X 10.11 - macOS 14 / iOS 9 - iOS 17. in GetDefaultDwarfVersion()
1267 TargetVersion.empty())) // apple-darwin, no version. in GetDefaultDwarfVersion()
1279 // not have compiler-rt checked out or integrated into their build (unless in AddLinkRuntimeLib()
1287 // so we should make sure we add the rpaths last, after all user-specified in AddLinkRuntimeLib()
1295 CmdArgs.push_back("-rpath"); in AddLinkRuntimeLib()
1298 // Add the compiler-rt library's directory to rpath to support using the in AddLinkRuntimeLib()
1300 CmdArgs.push_back("-rpath"); in AddLinkRuntimeLib()
1308 "it doesn't make sense to ask for the compiler-rt library name as an " in getCompilerRT()
1327 "it doesn't make sense to ask for the compiler-rt library name as an " in getCompilerRT()
1370 return SDK.slice(0, SDK.size() - 4); in getSDKName()
1402 if (A->getOption().matches(options::OPT_exported__symbols__list)) in hasExportSymbolDirective()
1404 if (!A->getOption().matches(options::OPT_Wl_COMMA) && in hasExportSymbolDirective()
1405 !A->getOption().matches(options::OPT_Xlinker)) in hasExportSymbolDirective()
1407 if (A->containsValue("-exported_symbols_list") || in hasExportSymbolDirective()
1408 A->containsValue("-exported_symbol")) in hasExportSymbolDirective()
1416 CmdArgs.push_back("-exported_symbol"); in addExportedSymbol()
1428 for (const char *A : {"-sectalign", Args.MakeArgString(Segment), in addSectalignToPage()
1455 // it's not enough to just page-align __llvm_prf_cnts: the following section in addProfileRTLibs()
1456 // must also be page-aligned so that its data is not clobbered by mmap(). in addProfileRTLibs()
1483 StringRef Value = A->getValue(); in GetRuntimeLibType()
1484 if (Value != "compiler-rt" && Value != "platform") in GetRuntimeLibType()
1485 getDriver().Diag(clang::diag::err_drv_unsupported_rtlib_for_platform) in GetRuntimeLibType()
1499 // libraries with -static. in AddLinkRuntimeLibArgs()
1508 // Reject -static-libgcc for now, we can deal with this when and if someone in AddLinkRuntimeLibArgs()
1512 getDriver().Diag(diag::err_drv_unsupported_opt) << A->getAsString(Args); in AddLinkRuntimeLibArgs()
1528 getDriver().Diag(diag::err_drv_unsupported_static_sanitizer_darwin) in AddLinkRuntimeLibArgs()
1573 AddLinkRuntimeLib(Args, CmdArgs, "xray-basic"); in AddLinkRuntimeLibArgs()
1574 AddLinkRuntimeLib(Args, CmdArgs, "xray-fdr"); in AddLinkRuntimeLibArgs()
1578 CmdArgs.push_back("-framework"); in AddLinkRuntimeLibArgs()
1585 CmdArgs.push_back("-lSystem"); in AddLinkRuntimeLibArgs()
1594 CmdArgs.push_back("-lgcc_s.1"); in AddLinkRuntimeLibArgs()
1599 /// Returns the most appropriate macOS target version for the current process.
1601 /// If the macOS SDK version is the same or earlier than the system version,
1602 /// then the SDK version is returned. Otherwise the system version is returned.
1627 /// The OS was specified using the -target argument.
1629 /// The OS was specified using the -mtargetos= argument.
1631 /// The OS was specified using the -m<os>-version-min argument.
1637 /// The OS was inferred from the -arch.
1655 return Argument->getValue(); in getOSVersion()
1668 "native target version is specified only for Mac Catalyst"); in getNativeTargetVersion()
1682 /// Adds the -m<os>-version-min argument to the compiler invocation.
1703 // xrOS always explicitly provides a version in the triple. in addOSVersionMinArgument()
1706 // DriverKit always explicitly provides a version in the triple. in addOSVersionMinArgument()
1713 /// Returns the OS version with the argument / environment variable that
1722 assert(Argument && "OS version argument not yet inferred"); in getAsString()
1723 return Argument->getAsString(Args); in getAsString()
1742 if (const auto *MacCatalystToMacOSMapping = SDKInfo->getVersionMapping( in setEnvironment()
1744 if (auto MacOSVersion = MacCatalystToMacOSMapping->map( in setEnvironment()
1751 // lower than the version that's implied by the OS version. In that case in setEnvironment()
1752 // we need to use the minimum version as the native target version. in setEnvironment()
1754 auto TargetVariantVersion = TargetVariantTriple->getOSVersion(); in setEnvironment()
1818 /// Constructs an inferred SDKInfo value based on the version inferred from
1823 llvm::VersionTuple Version; in inferSDKInfo() local
1824 bool IsValid = !Version.tryParse(OSVersion); in inferSDKInfo()
1826 assert(IsValid && "invalid SDK version"); in inferSDKInfo()
1828 Version, in inferSDKInfo()
1829 /*MaximumDeploymentTarget=*/VersionTuple(Version.getMajor(), 0, 99)); in inferSDKInfo()
1870 /// Returns the deployment target that's specified using the -m<os>-version-min
1886 TheDriver.Diag(diag::err_drv_argument_not_allowed_with) in getDeploymentTargetFromOSVersionArg()
1887 << macOSVersion->getAsString(Args) in getDeploymentTargetFromOSVersionArg()
1890 ->getAsString(Args); in getDeploymentTargetFromOSVersionArg()
1896 TheDriver.Diag(diag::err_drv_argument_not_allowed_with) in getDeploymentTargetFromOSVersionArg()
1897 << iOSVersion->getAsString(Args) in getDeploymentTargetFromOSVersionArg()
1898 << (TvOSVersion ? TvOSVersion : WatchOSVersion)->getAsString(Args); in getDeploymentTargetFromOSVersionArg()
1902 iOSVersion->getOption().getID() == in getDeploymentTargetFromOSVersionArg()
1906 TheDriver.Diag(diag::err_drv_argument_not_allowed_with) in getDeploymentTargetFromOSVersionArg()
1907 << TvOSVersion->getAsString(Args) in getDeploymentTargetFromOSVersionArg()
1908 << WatchOSVersion->getAsString(Args); in getDeploymentTargetFromOSVersionArg()
1912 TvOSVersion->getOption().getID() == in getDeploymentTargetFromOSVersionArg()
1917 WatchOSVersion->getOption().getID() == in getDeploymentTargetFromOSVersionArg()
1965 TheDriver.Diag(diag::err_drv_conflicting_deployment_targets) in getDeploymentTargetFromEnvironmentVariables()
1988 /// Tries to infer the deployment target from the SDK specified by -isysroot
1989 /// (or SDKROOT). Uses the version specified in the SDKSettings.json file if
1997 StringRef isysroot = A->getValue(); in inferDeploymentTargetFromSDK()
2002 std::string Version; in inferDeploymentTargetFromSDK() local
2004 // Get the version from the SDKSettings.json if it's available. in inferDeploymentTargetFromSDK()
2005 Version = SDKInfo->getVersion().getAsString(); in inferDeploymentTargetFromSDK()
2007 // Slice the version number out. in inferDeploymentTargetFromSDK()
2008 // Version number is between the first and the last number. in inferDeploymentTargetFromSDK()
2012 Version = std::string(SDK.slice(StartVer, EndVer + 1)); in inferDeploymentTargetFromSDK()
2014 if (Version.empty()) in inferDeploymentTargetFromSDK()
2018 [&](StringRef SDK) -> std::optional<DarwinPlatform> { in inferDeploymentTargetFromSDK()
2021 Darwin::IPhoneOS, Version, in inferDeploymentTargetFromSDK()
2025 getSystemOrSDKMacOSVersion(Version)); in inferDeploymentTargetFromSDK()
2028 Darwin::WatchOS, Version, in inferDeploymentTargetFromSDK()
2033 Darwin::TvOS, Version, in inferDeploymentTargetFromSDK()
2037 Darwin::XROS, Version, in inferDeploymentTargetFromSDK()
2040 return DarwinPlatform::createFromSDK(Darwin::DriverKit, Version); in inferDeploymentTargetFromSDK()
2056 // If there is no version specified on triple, and both host and target are in getOSVersion()
2057 // macos, use the host triple to infer OS version. in getOSVersion()
2062 TheDriver.Diag(diag::err_drv_invalid_darwin_version) in getOSVersion()
2097 /// Tries to infer the target OS from the -arch.
2120 /// Returns the deployment target that's specified using the -target option.
2132 llvm::Triple TVT(A->getValue()); in getDeploymentTargetFromTargetArg()
2133 // Find a matching <arch>-<vendor> target variant triple that can be used. in getDeploymentTargetFromTargetArg()
2141 A->claim(); in getDeploymentTargetFromTargetArg()
2142 // Accept a -target-variant triple when compiling code that may run on in getDeploymentTargetFromTargetArg()
2151 TheDriver.Diag(diag::err_drv_target_variant_invalid) in getDeploymentTargetFromTargetArg()
2152 << A->getSpelling() << A->getValue(); in getDeploymentTargetFromTargetArg()
2160 /// Returns the deployment target that's specified using the -mtargetos option.
2167 llvm::Triple TT(llvm::Twine("unknown-apple-") + A->getValue()); in getDeploymentTargetFromMTargetOSArg()
2176 TheDriver.Diag(diag::err_drv_invalid_os_in_arg) in getDeploymentTargetFromMTargetOSArg()
2177 << TT.getOSName() << A->getAsString(Args); in getDeploymentTargetFromMTargetOSArg()
2181 VersionTuple Version = TT.getOSVersion(); in getDeploymentTargetFromMTargetOSArg() local
2182 if (!Version.getMajor()) { in getDeploymentTargetFromMTargetOSArg()
2183 TheDriver.Diag(diag::err_drv_invalid_version_number) in getDeploymentTargetFromMTargetOSArg()
2184 << A->getAsString(Args); in getDeploymentTargetFromMTargetOSArg()
2187 return DarwinPlatform::createFromMTargetOS(TT.getOS(), Version, in getDeploymentTargetFromMTargetOSArg()
2197 StringRef isysroot = A->getValue(); in parseSDKSettings()
2201 TheDriver.Diag(diag::warn_drv_darwin_sdk_invalid_settings); in parseSDKSettings()
2217 if (!getVFS().exists(A->getValue())) in AddDeploymentTarget()
2218 getDriver().Diag(clang::diag::warn_missing_sysroot) << A->getValue(); in AddDeploymentTarget()
2231 // Read the SDKSettings.json file for more information, like the SDK version in AddDeploymentTarget()
2235 // The OS and the version can be specified using the -target argument. in AddDeploymentTarget()
2239 // Disallow mixing -target and -mtargetos=. in AddDeploymentTarget()
2241 std::string TargetArgStr = OSTarget->getAsString(Args, Opts); in AddDeploymentTarget()
2242 std::string MTargetOSArgStr = MTargetOSArg->getAsString(Args); in AddDeploymentTarget()
2243 getDriver().Diag(diag::err_drv_cannot_mix_options) in AddDeploymentTarget()
2253 if (OSTarget->getPlatform() != OSVersionArgTarget->getPlatform() || in AddDeploymentTarget()
2254 (Driver::GetReleaseVersion(OSTarget->getOSVersion(), TargetMajor, in AddDeploymentTarget()
2256 Driver::GetReleaseVersion(OSVersionArgTarget->getOSVersion(), in AddDeploymentTarget()
2261 // Select the OS version from the -m<os>-version-min argument when in AddDeploymentTarget()
2262 // the -target does not include an OS version. in AddDeploymentTarget()
2263 if (OSTarget->getPlatform() == OSVersionArgTarget->getPlatform() && in AddDeploymentTarget()
2264 !OSTarget->hasOSVersion()) { in AddDeploymentTarget()
2265 OSTarget->setOSVersion(OSVersionArgTarget->getOSVersion()); in AddDeploymentTarget()
2267 // Warn about -m<os>-version-min that doesn't match the OS version in AddDeploymentTarget()
2270 OSVersionArgTarget->getAsString(Args, Opts); in AddDeploymentTarget()
2271 std::string TargetArg = OSTarget->getAsString(Args, Opts); in AddDeploymentTarget()
2272 getDriver().Diag(clang::diag::warn_drv_overriding_option) in AddDeploymentTarget()
2279 // The OS target can be specified using the -mtargetos= argument. in AddDeploymentTarget()
2280 // Disallow mixing -mtargetos= and -m<os>version-min=. in AddDeploymentTarget()
2284 std::string MTargetOSArgStr = OSTarget->getAsString(Args, Opts); in AddDeploymentTarget()
2285 std::string OSVersionArgStr = OSVersionArgTarget->getAsString(Args, Opts); in AddDeploymentTarget()
2286 getDriver().Diag(diag::err_drv_cannot_mix_options) in AddDeploymentTarget()
2290 // The OS target can be specified using the -m<os>version-min argument. in AddDeploymentTarget()
2302 OSTarget->setEnvironment(SDKTarget->getEnvironment()); in AddDeploymentTarget()
2305 // If there is no command-line argument to specify the Target version and in AddDeploymentTarget()
2307 // on -isysroot using SDKSettings.json if it exists. in AddDeploymentTarget()
2313 SDKInfo = OSTarget->inferSDKInfo(); in AddDeploymentTarget()
2315 // If no OS targets have been specified, try to guess platform from -target in AddDeploymentTarget()
2316 // or arch name and compute the version from the triple. in AddDeploymentTarget()
2323 OSTarget->addOSVersionMinArgument(Args, Opts); in AddDeploymentTarget()
2324 DarwinPlatformKind Platform = OSTarget->getPlatform(); in AddDeploymentTarget()
2328 // The major version should not be over this number. in AddDeploymentTarget()
2332 if (!Driver::GetReleaseVersion(OSTarget->getOSVersion(), Major, Minor, in AddDeploymentTarget()
2336 getDriver().Diag(diag::err_drv_invalid_version_number) in AddDeploymentTarget()
2337 << OSTarget->getAsString(Args, Opts); in AddDeploymentTarget()
2339 if (!Driver::GetReleaseVersion(OSTarget->getOSVersion(), Major, Minor, in AddDeploymentTarget()
2342 getDriver().Diag(diag::err_drv_invalid_version_number) in AddDeploymentTarget()
2343 << OSTarget->getAsString(Args, Opts); in AddDeploymentTarget()
2345 if (OSTarget->getEnvironment() == MacCatalyst && in AddDeploymentTarget()
2347 getDriver().Diag(diag::err_drv_invalid_version_number) in AddDeploymentTarget()
2348 << OSTarget->getAsString(Args, Opts); in AddDeploymentTarget()
2353 // For 32-bit targets, the deployment target for iOS has to be earlier than in AddDeploymentTarget()
2357 if (OSTarget->isExplicitlySpecified()) { in AddDeploymentTarget()
2358 if (OSTarget->getEnvironment() == MacCatalyst) in AddDeploymentTarget()
2359 getDriver().Diag(diag::err_invalid_macos_32bit_deployment_target); in AddDeploymentTarget()
2361 getDriver().Diag(diag::warn_invalid_ios_deployment_target) in AddDeploymentTarget()
2362 << OSTarget->getAsString(Args, Opts); in AddDeploymentTarget()
2371 if (!Driver::GetReleaseVersion(OSTarget->getOSVersion(), Major, Minor, in AddDeploymentTarget()
2374 getDriver().Diag(diag::err_drv_invalid_version_number) in AddDeploymentTarget()
2375 << OSTarget->getAsString(Args, Opts); in AddDeploymentTarget()
2377 if (!Driver::GetReleaseVersion(OSTarget->getOSVersion(), Major, Minor, in AddDeploymentTarget()
2380 getDriver().Diag(diag::err_drv_invalid_version_number) in AddDeploymentTarget()
2381 << OSTarget->getAsString(Args, Opts); in AddDeploymentTarget()
2383 if (!Driver::GetReleaseVersion(OSTarget->getOSVersion(), Major, Minor, in AddDeploymentTarget()
2387 getDriver().Diag(diag::err_drv_invalid_version_number) in AddDeploymentTarget()
2388 << OSTarget->getAsString(Args, Opts); in AddDeploymentTarget()
2390 if (!Driver::GetReleaseVersion(OSTarget->getOSVersion(), Major, Minor, in AddDeploymentTarget()
2394 getDriver().Diag(diag::err_drv_invalid_version_number) in AddDeploymentTarget()
2395 << OSTarget->getAsString(Args, Opts); in AddDeploymentTarget()
2399 DarwinEnvironmentKind Environment = OSTarget->getEnvironment(); in AddDeploymentTarget()
2402 Platform != DriverKit && OSTarget->canInferSimulatorFromArch() && in AddDeploymentTarget()
2408 NativeTargetVersion = OSTarget->getNativeTargetVersion(); in AddDeploymentTarget()
2410 TargetVariantTriple = OSTarget->getTargetVariantTriple(); in AddDeploymentTarget()
2413 StringRef SDK = getSDKName(A->getValue()); in AddDeploymentTarget()
2419 getDriver().Diag(diag::warn_incompatible_sysroot) in AddDeploymentTarget()
2426 // located in sub-directories, e.g., for DriverKit they live in
2435 // Returns the effective sysroot from either -isysroot or --sysroot, plus the
2481 // Check for configure-time C include directories. in AddClangSystemIncludeArgs()
2502 llvm::StringRef Version, in AddGnuCPlusPlusIncludePaths() argument
2505 llvm::sys::path::append(Base, Version); in AddGnuCPlusPlusIncludePaths()
2533 // The implementation from a base class will pass through the -stdlib to in AddClangCXXStdlibIncludeArgs()
2536 // (e.g. HeaderSearchOptions::UseLibcxx) and don't pipe -stdlib. in AddClangCXXStdlibIncludeArgs()
2549 // 1. Alongside the compiler in <clang-executable-folder>/../include/c++/v1 in AddClangCXXStdlibIncludeArgs()
2553 // that exists. Note that we never include libc++ twice -- we take the first in AddClangCXXStdlibIncludeArgs()
2599 "i686-apple-darwin10", in AddClangCXXStdlibIncludeArgs()
2602 "4.0.0", "i686-apple-darwin8", in AddClangCXXStdlibIncludeArgs()
2610 "arm-apple-darwin10", in AddClangCXXStdlibIncludeArgs()
2614 "arm-apple-darwin10", in AddClangCXXStdlibIncludeArgs()
2621 "arm64-apple-darwin10", in AddClangCXXStdlibIncludeArgs()
2627 getDriver().Diag(diag::warn_drv_libstdcxx_not_found); in AddClangCXXStdlibIncludeArgs()
2640 CmdArgs.push_back("-lc++"); in AddCXXStdlibLibArgs()
2642 CmdArgs.push_back("-lc++experimental"); in AddCXXStdlibLibArgs()
2646 // Unfortunately, -lstdc++ doesn't always exist in the standard search path; in AddCXXStdlibLibArgs()
2648 // platforms we care about it was -lstdc++.6, so we search for that in AddCXXStdlibLibArgs()
2649 // explicitly if we can't see an obvious -lstdc++ candidate. in AddCXXStdlibLibArgs()
2653 SmallString<128> P(A->getValue()); in AddCXXStdlibLibArgs()
2676 CmdArgs.push_back("-lstdc++"); in AddCXXStdlibLibArgs()
2683 // For Darwin platforms, use the compiler-rt-based support library in AddCCKextLibArgs()
2684 // instead of the gcc-provided one (which is also incidentally in AddCCKextLibArgs()
2708 // not have compiler-rt checked out or integrated into their build. in AddCCKextLibArgs()
2727 if (A->getOption().matches(options::OPT_Xarch__)) { in TranslateArgs()
2730 StringRef XarchArch = A->getValue(0); in TranslateArgs()
2741 if (A->getOption().hasFlag(options::LinkerInput)) { in TranslateArgs()
2743 for (const char *Value : A->getValues()) { in TranslateArgs()
2744 DAL->AddSeparateArg( in TranslateArgs()
2752 // gcc translates options twice, which means that self-expanding in TranslateArgs()
2754 switch ((options::ID)A->getOption().getID()) { in TranslateArgs()
2756 DAL->append(A); in TranslateArgs()
2761 DAL->append(A); in TranslateArgs()
2762 DAL->AddFlagArg(A, Opts.getOption(options::OPT_static)); in TranslateArgs()
2766 DAL->AddSeparateArg(A, Opts.getOption(options::OPT_MF), A->getValue()); in TranslateArgs()
2770 DAL->AddFlagArg(A, Opts.getOption(options::OPT_g_Flag)); in TranslateArgs()
2771 DAL->AddFlagArg( in TranslateArgs()
2776 DAL->AddFlagArg(A, Opts.getOption(options::OPT_g_Flag)); in TranslateArgs()
2777 DAL->AddFlagArg( in TranslateArgs()
2782 DAL->AddFlagArg(A, Opts.getOption(options::OPT_dynamiclib)); in TranslateArgs()
2786 DAL->AddFlagArg(A, Opts.getOption(options::OPT_mconstant_cfstrings)); in TranslateArgs()
2790 DAL->AddFlagArg(A, Opts.getOption(options::OPT_mno_constant_cfstrings)); in TranslateArgs()
2794 DAL->AddFlagArg(A, in TranslateArgs()
2799 DAL->AddFlagArg( in TranslateArgs()
2805 // Add the arch options based on the particular spelling of -arch, to match in TranslateArgs()
2817 DAL->AddJoinedArg(nullptr, MCpu, "601"); in TranslateArgs()
2819 DAL->AddJoinedArg(nullptr, MCpu, "603"); in TranslateArgs()
2821 DAL->AddJoinedArg(nullptr, MCpu, "604"); in TranslateArgs()
2823 DAL->AddJoinedArg(nullptr, MCpu, "604e"); in TranslateArgs()
2825 DAL->AddJoinedArg(nullptr, MCpu, "750"); in TranslateArgs()
2827 DAL->AddJoinedArg(nullptr, MCpu, "7400"); in TranslateArgs()
2829 DAL->AddJoinedArg(nullptr, MCpu, "7450"); in TranslateArgs()
2831 DAL->AddJoinedArg(nullptr, MCpu, "970"); in TranslateArgs()
2834 DAL->AddFlagArg(nullptr, Opts.getOption(options::OPT_m64)); in TranslateArgs()
2839 DAL->AddJoinedArg(nullptr, MArch, "i486"); in TranslateArgs()
2841 DAL->AddJoinedArg(nullptr, MArch, "i586"); in TranslateArgs()
2843 DAL->AddJoinedArg(nullptr, MArch, "i686"); in TranslateArgs()
2845 DAL->AddJoinedArg(nullptr, MArch, "pentium"); in TranslateArgs()
2847 DAL->AddJoinedArg(nullptr, MArch, "pentium2"); in TranslateArgs()
2849 DAL->AddJoinedArg(nullptr, MArch, "pentiumpro"); in TranslateArgs()
2851 DAL->AddJoinedArg(nullptr, MArch, "pentium2"); in TranslateArgs()
2854 DAL->AddFlagArg(nullptr, Opts.getOption(options::OPT_m64)); in TranslateArgs()
2857 DAL->AddJoinedArg(nullptr, MArch, "armv4t"); in TranslateArgs()
2859 DAL->AddJoinedArg(nullptr, MArch, "armv4t"); in TranslateArgs()
2861 DAL->AddJoinedArg(nullptr, MArch, "armv5tej"); in TranslateArgs()
2863 DAL->AddJoinedArg(nullptr, MArch, "xscale"); in TranslateArgs()
2865 DAL->AddJoinedArg(nullptr, MArch, "armv6k"); in TranslateArgs()
2867 DAL->AddJoinedArg(nullptr, MArch, "armv6m"); in TranslateArgs()
2869 DAL->AddJoinedArg(nullptr, MArch, "armv7a"); in TranslateArgs()
2871 DAL->AddJoinedArg(nullptr, MArch, "armv7em"); in TranslateArgs()
2873 DAL->AddJoinedArg(nullptr, MArch, "armv7k"); in TranslateArgs()
2875 DAL->AddJoinedArg(nullptr, MArch, "armv7m"); in TranslateArgs()
2877 DAL->AddJoinedArg(nullptr, MArch, "armv7s"); in TranslateArgs()
2888 // { hard-float, soft-float } in AddLinkRuntimeLibArgs()
2934 // depend on the SDK version. in sdkSupportsBuiltinModules()
2942 // pre-SDK version of macOS (i.e. before Mac OS X 10.4). Those in sdkSupportsBuiltinModules()
2949 VersionTuple SDKVersion = SDKInfo->getVersion(); in sdkSupportsBuiltinModules()
2958 // Mac Catalyst uses `-target arm64-apple-ios18.0-macabi` so the platform in sdkSupportsBuiltinModules()
2959 // is iOS, but it builds with the macOS SDK, so it's the macOS SDK version in sdkSupportsBuiltinModules()
2984 case llvm::Triple::MacOSX: // Earliest supporting version is 10.12. in sizedDeallocMinVersion()
2987 case llvm::Triple::TvOS: // Earliest supporting version is 10.0.0. in sizedDeallocMinVersion()
2989 case llvm::Triple::WatchOS: // Earliest supporting version is 3.0.0. in sizedDeallocMinVersion()
3026 // Pass "-faligned-alloc-unavailable" only when the user hasn't manually in addClangTargetOptions()
3031 CC1Args.push_back("-faligned-alloc-unavailable"); in addClangTargetOptions()
3033 // Pass "-fno-sized-deallocation" only when the user hasn't manually enabled in addClangTargetOptions()
3038 CC1Args.push_back("-fno-sized-deallocation"); in addClangTargetOptions()
3044 CC1Args.push_back("-fcompatibility-qualified-id-block-type-checking"); in addClangTargetOptions()
3047 // -fvisibility-inlines-hidden is enabled. in addClangTargetOptions()
3051 CC1Args.push_back("-fvisibility-inlines-hidden-static-local-var"); in addClangTargetOptions()
3056 // The builtin <stdint.h> include-nexts <stdint.h>. When both of those in addClangTargetOptions()
3057 // darwin headers are in the Darwin module, there's a module cycle Darwin -> in addClangTargetOptions()
3058 // _Builtin_stdint -> Darwin (i.e. inttypes.h (darwin) -> stdint.h (builtin) -> in addClangTargetOptions()
3062 // goes away. Note that -fbuiltin-headers-in-system-modules does nothing in addClangTargetOptions()
3065 CC1Args.push_back("-fbuiltin-headers-in-system-modules"); in addClangTargetOptions()
3069 CC1Args.push_back("-fdefine-target-os-macros"); in addClangTargetOptions()
3075 CC1ASArgs.push_back("-darwin-target-variant-triple"); in addClangCC1ASTargetOptions()
3076 CC1ASArgs.push_back(Args.MakeArgString(TargetVariantTriple->getTriple())); in addClangCC1ASTargetOptions()
3080 /// Pass the SDK version to the compiler when the SDK information is in addClangCC1ASTargetOptions()
3085 OS << "-target-sdk-version=" << V; in addClangCC1ASTargetOptions()
3090 if (const auto *MacOStoMacCatalystMapping = SDKInfo->getVersionMapping( in addClangCC1ASTargetOptions()
3092 std::optional<VersionTuple> SDKVersion = MacOStoMacCatalystMapping->map( in addClangCC1ASTargetOptions()
3093 SDKInfo->getVersion(), minimumMacCatalystDeploymentTarget(), in addClangCC1ASTargetOptions()
3099 EmitTargetSDKVersionArg(SDKInfo->getVersion()); in addClangCC1ASTargetOptions()
3102 /// Pass the target variant SDK version to the compiler when the SDK in addClangCC1ASTargetOptions()
3108 OS << "-darwin-target-variant-sdk-version=" << SDKInfo->getVersion(); in addClangCC1ASTargetOptions()
3111 SDKInfo->getVersionMapping( in addClangCC1ASTargetOptions()
3114 MacOStoMacCatalystMapping->map( in addClangCC1ASTargetOptions()
3115 SDKInfo->getVersion(), minimumMacCatalystDeploymentTarget(), in addClangCC1ASTargetOptions()
3119 OS << "-darwin-target-variant-sdk-version=" << *SDKVersion; in addClangCC1ASTargetOptions()
3130 // First get the generic Apple args, before moving onto Darwin-specific ones. in TranslateArgs()
3138 // Add an explicit version min argument for the deployment target. We do this in TranslateArgs()
3139 // after argument translation because -Xarch_ arguments may add a version min in TranslateArgs()
3143 // For iOS 6, undo the translation to add -static for -mkernel/-fapple-kext. in TranslateArgs()
3144 // FIXME: It would be far better to avoid inserting those -static arguments, in TranslateArgs()
3149 for (ArgList::iterator it = DAL->begin(), ie = DAL->end(); it != ie; ) { in TranslateArgs()
3152 if (A->getOption().getID() != options::OPT_mkernel && in TranslateArgs()
3153 A->getOption().getID() != options::OPT_fapple_kext) in TranslateArgs()
3157 assert(A->getOption().getID() == options::OPT_static && in TranslateArgs()
3158 "missing expected -static argument"); in TranslateArgs()
3168 getDriver().Diag(clang::diag::warn_drv_unsupported_opt_for_target) in TranslateArgs()
3169 << "-fomit-frame-pointer" << BoundArch; in TranslateArgs()
3176 // Unwind tables are not emitted if -fno-exceptions is supplied (except when in getDefaultUnwindTableLevel()
3241 assert(!isTargetXROS() && "xrOS always uses -platform-version"); in addMinVersionArgs()
3244 CmdArgs.push_back("-watchos_version_min"); in addMinVersionArgs()
3246 CmdArgs.push_back("-watchos_simulator_version_min"); in addMinVersionArgs()
3248 CmdArgs.push_back("-tvos_version_min"); in addMinVersionArgs()
3250 CmdArgs.push_back("-tvos_simulator_version_min"); in addMinVersionArgs()
3252 CmdArgs.push_back("-driverkit_version_min"); in addMinVersionArgs()
3254 CmdArgs.push_back("-ios_simulator_version_min"); in addMinVersionArgs()
3256 CmdArgs.push_back("-iphoneos_version_min"); in addMinVersionArgs()
3258 CmdArgs.push_back("-maccatalyst_version_min"); in addMinVersionArgs()
3261 CmdArgs.push_back("-macosx_version_min"); in addMinVersionArgs()
3271 if (TargetVariantTriple->isMacOSX()) { in addMinVersionArgs()
3272 CmdArgs.push_back("-macosx_version_min"); in addMinVersionArgs()
3273 TargetVariantTriple->getMacOSXVersion(VariantTargetVersion); in addMinVersionArgs()
3275 assert(TargetVariantTriple->isiOS() && in addMinVersionArgs()
3276 TargetVariantTriple->isMacCatalystEnvironment() && in addMinVersionArgs()
3278 CmdArgs.push_back("-maccatalyst_version_min"); in addMinVersionArgs()
3279 VariantTargetVersion = TargetVariantTriple->getiOSVersion(); in addMinVersionArgs()
3282 TargetVariantTriple->getMinimumSupportedOSVersion(); in addMinVersionArgs()
3316 // -platform_version <platform> <target_version> <sdk_version> in addPlatformVersionArgs()
3317 // Both the target and SDK version support only up to 3 components. in addPlatformVersionArgs()
3318 CmdArgs.push_back("-platform_version"); in addPlatformVersionArgs()
3322 PlatformName += "-simulator"; in addPlatformVersionArgs()
3338 // Mac Catalyst programs must use the appropriate iOS SDK version in addPlatformVersionArgs()
3339 // that corresponds to the macOS SDK version used for the compilation. in addPlatformVersionArgs()
3343 SDKInfo->getVersionMapping( in addPlatformVersionArgs()
3345 iOSSDKVersion = MacOStoMacCatalystMapping->map( in addPlatformVersionArgs()
3346 SDKInfo->getVersion().withoutBuild(), in addPlatformVersionArgs()
3358 VersionTuple SDKVersion = SDKInfo->getVersion().withoutBuild(); in addPlatformVersionArgs()
3363 // Use an SDK version that's matching the deployment target if the SDK in addPlatformVersionArgs()
3364 // version is missing. This is preferred over an empty SDK version in addPlatformVersionArgs()
3366 // contain a valid SDK version in order for the binary to work in addPlatformVersionArgs()
3367 // correctly. It's reasonable to use the deployment target version as in addPlatformVersionArgs()
3368 // a proxy for the SDK version because older SDKs don't guarantee in addPlatformVersionArgs()
3370 // rules out using some predetermined older SDK version, which leaves in addPlatformVersionArgs()
3371 // the deployment target version as the only reasonable choice. in addPlatformVersionArgs()
3382 if (TargetVariantTriple->isMacOSX()) { in addPlatformVersionArgs()
3383 TargetVariantTriple->getMacOSXVersion(TargetVariantVersion); in addPlatformVersionArgs()
3387 assert(TargetVariantTriple->isiOS() && in addPlatformVersionArgs()
3388 TargetVariantTriple->isMacCatalystEnvironment() && in addPlatformVersionArgs()
3390 TargetVariantVersion = TargetVariantTriple->getiOSVersion(); in addPlatformVersionArgs()
3398 // Add additional link args for the -dynamiclib option.
3404 CmdArgs.push_back("-ldylib1.o"); in addDynamicLibLinkArgs()
3411 CmdArgs.push_back("-ldylib1.o"); in addDynamicLibLinkArgs()
3413 CmdArgs.push_back("-ldylib1.10.5.o"); in addDynamicLibLinkArgs()
3416 // Add additional link args for the -bundle option.
3424 CmdArgs.push_back("-lbundle1.o"); in addBundleLinkArgs()
3427 // Add additional link args for the -pg option.
3433 CmdArgs.push_back("-lgcrt0.o"); in addPgProfilingLinkArgs()
3435 CmdArgs.push_back("-lgcrt1.o"); in addPgProfilingLinkArgs()
3441 // when compiling with -pg, we need to link with the gcrt1.o file, in addPgProfilingLinkArgs()
3442 // so pass the -no_new_main option to tell the linker to use the in addPgProfilingLinkArgs()
3445 CmdArgs.push_back("-no_new_main"); in addPgProfilingLinkArgs()
3447 D.getDriver().Diag(diag::err_drv_clang_unsupported_opt_pg_darwin) in addPgProfilingLinkArgs()
3459 CmdArgs.push_back("-lcrt1.o"); in addDefaultCRTLinkArgs()
3461 CmdArgs.push_back("-lcrt1.3.1.o"); in addDefaultCRTLinkArgs()
3468 CmdArgs.push_back("-lcrt1.o"); in addDefaultCRTLinkArgs()
3470 CmdArgs.push_back("-lcrt1.10.5.o"); in addDefaultCRTLinkArgs()
3472 CmdArgs.push_back("-lcrt1.10.6.o"); in addDefaultCRTLinkArgs()
3488 CmdArgs.push_back("-lcrt0.o"); in addStartObjectFileArgs()
3503 getDriver().Diag(diag::err_arc_unsupported_on_toolchain); in CheckObjCARC()
3518 // Prior to 10.9, macOS shipped a version of the C++ standard library without in getSupportedSanitizers()
3519 // C++11 support. The same is true of iOS prior to version 5. These OS'es are in getSupportedSanitizers()
3520 // incompatible with -fsanitize=vptr. in getSupportedSanitizers()
3538 CudaInstallation->print(OS); in printVerboseInfo()
3539 RocmInstallation->print(OS); in printVerboseInfo()