Improved mac support

This commit is contained in:
Eduard Urbach 2024-08-12 12:16:01 +02:00
parent af259b364c
commit f70a2e848d
Signed by: eduard
GPG key ID: 49226B848C78F6C8
25 changed files with 119 additions and 34 deletions

View file

@ -1,5 +1,7 @@
package config
import "runtime"
const (
// This is the absolute virtual minimum address we can load a program at, see `sysctl vm.mmap_min_addr`.
MinAddress = 0x10000
@ -16,11 +18,30 @@ const (
var (
// Shows the assembly instructions at the end of the compilation.
Assembler = false
Assembler bool
// Calculates the result of operations on constants at compile time.
ConstantFold = true
ConstantFold bool
// Skips writing the executable to disk.
Dry = false
Dry bool
// Target architecture.
TargetArch string
// Target platform.
TargetOS string
)
// Reset resets the configuration to its default values.
func Reset() {
Assembler = false
ConstantFold = true
Dry = false
TargetArch = runtime.GOARCH
TargetOS = runtime.GOOS
if TargetOS == "darwin" {
TargetOS = "mac"
}
}