golang/go

runtime: c-shared builds fail to load with dlopen with musllibc: `initial-exec TLS resolves to dynamic definition`

Open

#54,805 opened on Sep 1, 2022

View on GitHub
 (10 comments) (6 reactions) (0 assignees)Go (19,008 forks)batch import
NeedsFixcompiler/runtimehelp wanted

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Splitting out from #13492:

@ansiwen's comment:

For what it's worth, compiled with -buildmode=c-shared I get:

sc_dlopen failed: Error relocating ./foobar.so: (null): initial-exec TLS resolves to dynamic definition in ./foobar.so

with

$ go version
go version go1.17.5 linux/amd64
$ cat /etc/alpine-release 
3.15.0
$ apk version musl
Installed:                                Available:
musl-1.2.2-r7                           = 1.2.2-r7 

I am still seeing a similar issue today with Go 1.19.

Contributor guide