main: use wasm-ld instead of wasm-ld-8 on macOS

This commit does a few things:
  * remove the -8 suffix on macOS, where it is not necessary
  * add smoke tests for compiling wasm files on Linux and macOS
This commit is contained in:
Ayke van Laethem
2019-04-02 19:17:07 +02:00
committed by Ron Evans
parent d653088cbe
commit 31d57fd3d1
5 changed files with 9 additions and 3 deletions
+1
View File
@@ -66,6 +66,7 @@ commands:
- run: tinygo build -size short -o test.elf -target=pca10056 examples/blinky2
- run: tinygo build -size short -o test.elf -target=itsybitsy-m0 examples/blinky1
- run: tinygo build -size short -o test.elf -target=circuitplay-express examples/blinky1
- run: tinygo build -o wasm.wasm -target=wasm examples/wasm
test-linux:
parameters:
llvm:
+1
View File
@@ -38,3 +38,4 @@ script:
- tinygo build -size short -o blinky1.pca10056.elf -target=pca10056 examples/blinky1
- tinygo build -size short -o blinky2.pca10056.elf -target=pca10056 examples/blinky2
- tinygo build -size short -o blinky1.samd21.elf -target=itsybitsy-m0 examples/blinky1
- tinygo build -o wasm.wasm -target=wasm examples/wasm
+1 -1
View File
@@ -7,5 +7,5 @@ var commands = map[string]string{
"ar": "llvm-ar",
"clang": "clang-8",
"ld.lld": "ld.lld-8",
"wasm-ld": "wasm-ld-8",
"wasm-ld": "wasm-ld",
}
+5 -1
View File
@@ -228,7 +228,11 @@ func Compile(pkgName, outpath string, spec *TargetSpec, config *BuildConfig, act
}
// Link the object files together.
err = Link(sourceDir(), spec.Linker, ldflags...)
if linker, ok := commands[spec.Linker]; ok {
err = Link(sourceDir(), linker, ldflags...)
} else {
err = Link(sourceDir(), spec.Linker, ldflags...)
}
if err != nil {
return &commandError{"failed to link", executable, err}
}
+1 -1
View File
@@ -4,7 +4,7 @@
"goos": "js",
"goarch": "wasm",
"compiler": "clang-8",
"linker": "wasm-ld-8",
"linker": "wasm-ld",
"cflags": [
"--target=wasm32",
"-Oz"