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
Этот коммит содержится в:
		
							родитель
							
								
									d653088cbe
								
							
						
					
					
						коммит
						31d57fd3d1
					
				
					 5 изменённых файлов: 9 добавлений и 3 удалений
				
			
		| 
						 | 
				
			
			@ -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:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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",
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4
									
								
								main.go
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								main.go
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -228,7 +228,11 @@ func Compile(pkgName, outpath string, spec *TargetSpec, config *BuildConfig, act
 | 
			
		|||
		}
 | 
			
		||||
 | 
			
		||||
		// Link the object files together.
 | 
			
		||||
		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}
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,7 +4,7 @@
 | 
			
		|||
	"goos":          "js",
 | 
			
		||||
	"goarch":        "wasm",
 | 
			
		||||
	"compiler":      "clang-8",
 | 
			
		||||
	"linker":        "wasm-ld-8",
 | 
			
		||||
	"linker":        "wasm-ld",
 | 
			
		||||
	"cflags": [
 | 
			
		||||
		"--target=wasm32",
 | 
			
		||||
		"-Oz"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Загрузка…
	
	Создание таблицы
		
		Сослаться в новой задаче