Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/link: illegal text-relocation for c-archive darwin/amd64 #14217
When compiling using buildmode c-archive on darwin/amd64 (targeting the iOS simulator), I run into this error when trying to link the resulting archive to my Swift code:
ld: illegal text-relocation to 'type..eq.encoding/xml.Attr' in .../lib.a(go.o) from 'runtime.rodata' in .../lib.a(go.o) for architecture x86_64
Looking at the cmd/link/internal/ld/macho.go, it seems that it currently is only checking for shared archives on amd64 when it chooses to use the DATA segment over TEXT.