main: use OS specific name for llvm-ar-7 tool to ensure that llvm7 toolchain works as expected

Signed-off-by: Ron Evans <ron@hybridgroup.com>
Этот коммит содержится в:
Ron Evans 2019-03-14 19:51:07 +01:00 коммит произвёл Ayke van Laethem
родитель a466dd8f2b
коммит d6c2d6e301
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: E97FF5335DFDFDED
3 изменённых файлов: 22 добавлений и 7 удалений

11
commands.go Обычный файл
Просмотреть файл

@ -0,0 +1,11 @@
// +build !darwin
package main
// commands used by the compilation process might have different file names on Linux than those used on macOS.
var commands = map[string]string{
"ar": "llvm-ar-7",
"clang": "clang-7",
"ld.lld": "ld.lld-7",
"wasm-ld": "wasm-ld-7",
}

11
commands_macos.go Обычный файл
Просмотреть файл

@ -0,0 +1,11 @@
// +build darwin
package main
// commands used by the compilation process might have different file names on macOS than those used on Linux.
var commands = map[string]string{
"ar": "llvm-ar",
"clang": "clang-7",
"ld.lld": "ld.lld-7",
"wasm-ld": "wasm-ld-7",
}

Просмотреть файл

@ -21,13 +21,6 @@ import (
"github.com/tinygo-org/tinygo/loader"
)
var commands = map[string]string{
"ar": "llvm-ar",
"clang": "clang-7",
"ld.lld": "ld.lld-7",
"wasm-ld": "wasm-ld-7",
}
// commandError is an error type to wrap os/exec.Command errors. This provides
// some more information regarding what went wrong while running a command.
type commandError struct {