Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pkgs/native_toolchain_c/lib/src/native_toolchain/apple_clang.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:code_assets/code_assets.dart';

import '../tool/tool.dart';
import '../tool/tool_resolver.dart';

Expand Down Expand Up @@ -31,6 +33,10 @@ final Tool appleAr = Tool(
wrappedResolver: appleClang.defaultResolver!,
relativePath: Uri.file('ar'),
),
PathToolResolver(
toolName: 'Apple archiver',
executableName: OS.current.executableFileName('ar'),
),
]),
);

Expand All @@ -43,6 +49,15 @@ final Tool appleLd = Tool(
wrappedResolver: appleClang.defaultResolver!,
relativePath: Uri.file('ld'),
),
PathToolResolver(
toolName: 'Apple linker',
executableName: OS.current.executableFileName('ld'),
),
RelativeToolResolver(
toolName: 'Apple linker',
wrappedResolver: appleClang.defaultResolver!,
relativePath: Uri.file(OS.current.executableFileName('ld.lld')),
),
]),
);

Expand Down
5 changes: 4 additions & 1 deletion pkgs/native_toolchain_c/lib/src/tool/tool_resolver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';
import 'dart:convert';
import 'dart:io';

Expand Down Expand Up @@ -65,8 +66,10 @@ class PathToolResolver extends ToolResolver {
if (process.exitCode == 0) {
final file = File(LineSplitter.split(process.stdout).first);
final uri = File(await file.resolveSymbolicLinks()).uri;
if (uri.pathSegments.last == 'llvm') {
if (uri.pathSegments.last == 'llvm' ||
uri.pathSegments.last == 'swiftly') {
// https://github.com/dart-lang/native/issues/136
// https://github.com/dart-lang/native/issues/2792
return file.uri;
}
return uri;
Expand Down
Loading