I'm banging my head against a wall here. I built a a go binary against libGraphicsMagick.a a few times, and now I can't replicate the build. I must have not had a clean environment, but I cannot figure out what I'm missing now.
Using `GraphicsMagick-config` I can generate the following gcc command to compile a test program:
gcc -o convert convert.c -fopenmp -g -O2 -Wall -pthread -L/usr/local/lib -L/usr/lib -lGraphicsMagick -llcms -ltiff -lfreetype -ljasper -ljpeg -lpng16 -lwmflite -lbz2 -lz -lm -lgomp -lpthread -I/usr/local/include/GraphicsMagick
This works with `gcc -static` too.
I *thought* I passed these same linker options into `go build`, but no matter what I do, I cannot get the external linker to find all the libs, and I get tons of "undefined reference to `cos'" and so on.
What I "documented" doing was:
GO_LD_FLAGS=-linkmode external -extldflags "-Wl,-Bstatic -lGraphicsMagick -llcms -ltiff -lfreetype -ljasper -ljpeg -lpng16 -lwmflite -lbz2 -lz -lm -lgomp -lpthread -Wl,-Bdynamic"
go build -ldflags "$GO_LD_FLAGS"
But now it doesn't work (I also had a fully static binary built and verified, but I added the -Wl,-Bstatic/dynamic options to dynamically link libc.)
Any idea what I could be missing?