mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 03:53:42 +00:00
all: add support for more architectures and GOOS/GOARCH (#118)
This commit does two things:
* It adds support for the GOOS and GOARCH environment variables. They
fall back to runtime.GO* only when not available.
* It adds support for 3 new architectures: 386, arm, and arm64. For
now, this is Linux-only.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package runtime
|
||||
|
||||
const GOARCH = "386"
|
||||
|
||||
// The bitness of the CPU (e.g. 8, 32, 64).
|
||||
const TargetBits = 32
|
||||
|
||||
// Align on word boundary.
|
||||
func align(ptr uintptr) uintptr {
|
||||
return (ptr + 3) &^ 3
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build amd64
|
||||
|
||||
package runtime
|
||||
|
||||
const GOARCH = "amd64"
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package runtime
|
||||
|
||||
const GOARCH = "arm"
|
||||
|
||||
// The bitness of the CPU (e.g. 8, 32, 64).
|
||||
const TargetBits = 32
|
||||
|
||||
// Align on word boundary.
|
||||
func align(ptr uintptr) uintptr {
|
||||
return (ptr + 3) &^ 3
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package runtime
|
||||
|
||||
const GOARCH = "arm64"
|
||||
|
||||
// The bitness of the CPU (e.g. 8, 32, 64).
|
||||
const TargetBits = 64
|
||||
|
||||
// Align on word boundary.
|
||||
func align(ptr uintptr) uintptr {
|
||||
return (ptr + 7) &^ 7
|
||||
}
|
||||
Reference in New Issue
Block a user