Skip to content

Commit 12f1653

Browse files
committed
ClangImporter: specify the ObjC runtime on !Darwin
The non-Darwin targets need to explicitly specify the ObjC runtime as the only supported ObjC runtime is the non-fragile iOS/macOS ABI.
1 parent 7ca5bd6 commit 12f1653

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,11 +464,15 @@ getNormalInvocationArguments(std::vector<std::string> &invocationArgStrs,
464464
SHIMS_INCLUDE_FLAG, searchPathOpts.RuntimeResourcePath,
465465
});
466466

467-
if (LangOpts.EnableObjCInterop)
467+
if (LangOpts.EnableObjCInterop) {
468468
invocationArgStrs.insert(invocationArgStrs.end(),
469469
{"-x", "objective-c", "-std=gnu11", "-fobjc-arc"});
470-
else
470+
if (!triple.isOSDarwin())
471+
invocationArgStrs.insert(invocationArgStrs.end(),
472+
{"-fobjc-runtime=ios-6.0"});
473+
} else {
471474
invocationArgStrs.insert(invocationArgStrs.end(), {"-x", "c", "-std=gnu11"});
475+
}
472476

473477
// Set C language options.
474478
if (triple.isOSDarwin()) {

0 commit comments

Comments
 (0)