Skip to content

Commit d6c2d6e

Browse files
deadprogramaykevl
authored andcommitted
main: use OS specific name for llvm-ar-7 tool to ensure that llvm7 toolchain works as expected
Signed-off-by: Ron Evans <[email protected]>
1 parent a466dd8 commit d6c2d6e

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

commands.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// +build !darwin
2+
3+
package main
4+
5+
// commands used by the compilation process might have different file names on Linux than those used on macOS.
6+
var commands = map[string]string{
7+
"ar": "llvm-ar-7",
8+
"clang": "clang-7",
9+
"ld.lld": "ld.lld-7",
10+
"wasm-ld": "wasm-ld-7",
11+
}

commands_macos.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// +build darwin
2+
3+
package main
4+
5+
// commands used by the compilation process might have different file names on macOS than those used on Linux.
6+
var commands = map[string]string{
7+
"ar": "llvm-ar",
8+
"clang": "clang-7",
9+
"ld.lld": "ld.lld-7",
10+
"wasm-ld": "wasm-ld-7",
11+
}

main.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ import (
2121
"github.com/tinygo-org/tinygo/loader"
2222
)
2323

24-
var commands = map[string]string{
25-
"ar": "llvm-ar",
26-
"clang": "clang-7",
27-
"ld.lld": "ld.lld-7",
28-
"wasm-ld": "wasm-ld-7",
29-
}
30-
3124
// commandError is an error type to wrap os/exec.Command errors. This provides
3225
// some more information regarding what went wrong while running a command.
3326
type commandError struct {

0 commit comments

Comments
 (0)