wealdtech / ethereal

Apache License 2.0
209 stars 41 forks source link

bug: ethereal unable to be linked with macOS Xcode 15 beta, requires forcing legacy linker to build successfully #46

Open sambacha opened 10 months ago

sambacha commented 10 months ago

macOS Linker changes cause golang to crash when installing

go install github.com/wealdtech/ethereal/v2@latest

returns this error:

# truncated 
go: downloading github.com/bits-and-blooms/bitset v1.8.0
# github.com/wealdtech/ethereal/v2
ld: warning: '/private/var/folders/18/4p7lgyxj2jd4v2vmv82b25ch0000gn/T/go-link-2801687295/go.o' has malformed LC_DYSYMTAB, expected 128 undefined symbols to start at index 35481, found 202 undefined symbols starting at index 92

macOS env

$  pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 15.0.0.0.1.1692336968
volume: /
location: /

Fix: explicitly force legacy linker when building

go build -ldflags="-extldflags=-Wl,-ld_classic"
$ ./ethereal version
2.8.10
mcdee commented 10 months ago

Apparently this is just a warning and not an error, see https://github.com/golang/go/issues/61229 for details.

According to https://go-review.googlesource.com/c/go/+/505415 this should be addressed in the next golang release.