darling icon indicating copy to clipboard operation
darling copied to clipboard

Cannot run Go compiler

Open acheong08 opened this issue 3 years ago • 4 comments

Expected Result Run a normal executable Actual Result Cannot mmap segment __LINKEDIT at 0x19ff000: File exists Steps To Reproduce

  1. darling shell installer -pkg ./go1.18.2.darwin-amd64.pkg -target /
  2. $ darling shell go --version

System Information What system are you using?

Software Version
Linux Kernel 5.17.4
Darling b48b35c945d6d28b891c500ee4ae09f9512f5f56

acheong08 avatar Jun 01 '22 07:06 acheong08

the same error happened on Darwin Kernel Version 19.6.0 x86_64 when run a binary of Golang. Linux kernel is 5.4.0-125-generic

Xarrow avatar Jan 15 '23 20:01 Xarrow

Any updates on this?

acheong08 avatar Mar 26 '23 04:03 acheong08

 $ darling shell installer -pkg go1.20.2.darwin-amd64.pkg -target /
installer: Package name is Go
installer: Installing at base path /
installer: Installing selected choice Go
installer: Installing package org.golang.go version go1.20.2 (242215 KB)
Removing previous installation
installer: Extracting files
Fixing permissions
installer: Installation complete
Darling [/Volumes/SystemRoot/home/acheong/workspace/test]$ cat hello.go 
package main

func main() {
	println("Hello world")
}
Darling [/Volumes/SystemRoot/home/acheong/workspace/test]$ go build hello.go 
Cannot mmap segment __LINKEDIT at 0x1aa2000: File exists
Darling [/Volumes/SystemRoot/home/acheong/workspace/test]$

acheong08 avatar Apr 02 '23 11:04 acheong08

The issue basically running all Golang app

ii64 avatar Nov 10 '23 02:11 ii64

I do not know much about Go and Mac OS, but I think Cannot mmap segment __LINKEDIT at ...: File exists is printed because __LINKEDIT probably usually has same vmaddr with __DWARF in Go executable files. I build Go programs on Linux only and this is a workaround, but I was able to build and run programs when doing something like GOOS=darwin go build -ldflags "-w" hello.go.

niten94 avatar Dec 26 '24 03:12 niten94