Improved mac support

This commit is contained in:
2024-08-12 12:16:01 +02:00
parent 58f010b81a
commit cf52919edc
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"
}
}

View File

@ -16,6 +16,7 @@ var (
func init() {
debug.SetGCPercent(-1)
Reset()
var err error
Executable, err = os.Executable()