Skip to content

Commit c82c770

Browse files
committed
change the order of the if statmenets to check aarch64 first
1 parent 3cf2044 commit c82c770

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

clang/lib/Driver/ToolChains/Darwin.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,12 +1648,13 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args,
16481648
// If we are compiling as iOS / simulator, don't attempt to link libgcc_s.1,
16491649
// it never went into the SDK.
16501650
// Linking against libgcc_s.1 isn't needed for iOS 5.0+ or macOS 10.6+
1651-
if (isTargetIOSBased() && isIPhoneOSVersionLT(5, 0) &&
1652-
!isTargetIOSSimulator() && getTriple().getArch() != llvm::Triple::aarch64)
1653-
CmdArgs.push_back("-lgcc_s.1");
1654-
else if (isTargetMacOSBased() && isMacosxVersionLT(10, 6) &&
1655-
getTriple().getArch() != llvm::Triple::aarch64)
1656-
CmdArgs.push_back("-lgcc_s.1");
1651+
if (getTriple().getArch() != llvm::Triple::aarch64) {
1652+
if (isTargetIOSBased() && isIPhoneOSVersionLT(5, 0) &&
1653+
!isTargetIOSSimulator())
1654+
CmdArgs.push_back("-lgcc_s.1");
1655+
else if (isTargetMacOSBased() && isMacosxVersionLT(10, 6))
1656+
CmdArgs.push_back("-lgcc_s.1");
1657+
}
16571658
AddLinkRuntimeLib(Args, CmdArgs, "builtins");
16581659
}
16591660

0 commit comments

Comments
 (0)