I am compiling a golang package, which includes the integration of a shared c library using cgo
.
Everything builds successfully inside docker images golang:1.15.15
, golang:1.16.6
, but since golang:1.16.7
(also golang:1.17
) it fails with error:
/usr/bin/ld: src/foobar/lib/libXYZ.so: undefined reference to `feenableexcept'
/usr/bin/ld: src/foobar/lib/libXYZ.so: undefined reference to `floor'
...
/usr/bin/ld: src/foobar/lib/libXYZ.so: undefined reference to `memoFree'
/usr/bin/ld: src/foobar/lib/libXYZ.so: undefined reference to `memoMalloc'
collect2: error: ld returned 1 exit status
I checked the golang release notes, and could not find any relevant changes for cgo
.
I checked versions of gcc and ld, those are all different. I even setup a ubuntu distro with go1.13.8
, gcc (Ubuntu 8.4.0-3ubuntu2) 8.4.0
and GNU ld (GNU Binutils for Ubuntu) 2.34
, where I run into this issue, so I guess, that go
goes not cause it.
Do you have any clue or suggestion, how I can find the root cause of this issue? Is it right to check gcc and ld, or which other tools need investigation?