You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried go build -ldflags '-extldflags "-fno-PIC -static"' -buildmode pie -tags 'osusergo netgo static_build' and go build -ldflags '-extldflags "-fPIC -static"' -buildmode pie -tags 'osusergo netgo static_build'.
Both get issues with trying to link.
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libpthread.a(pthread_create.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libpthread.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
I don't want a shared object I want a self-contained static binary that I can use in a Docker container FROM scratch.
The text was updated successfully, but these errors were encountered:
I've tried
go build -ldflags '-extldflags "-fno-PIC -static"' -buildmode pie -tags 'osusergo netgo static_build'
andgo build -ldflags '-extldflags "-fPIC -static"' -buildmode pie -tags 'osusergo netgo static_build'
.Both get issues with trying to link.
I don't want a shared object I want a self-contained static binary that I can use in a Docker container
FROM scratch
.The text was updated successfully, but these errors were encountered: