Improved mac support
This commit is contained in:
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ var (
|
||||
|
||||
func init() {
|
||||
debug.SetGCPercent(-1)
|
||||
Reset()
|
||||
|
||||
var err error
|
||||
Executable, err = os.Executable()
|
||||
|
Reference in New Issue
Block a user