Hello,

I am working on upgrading go version on our service from 1.9.6 to 1.14.6. 
We are linking static libraries to the executable using the following 
makefile script. 

export CGO_LDFLAGS="-Wl,--start-group -Wl,--whole-archive -lsmuxed_a 
-Wl,--no-whole-archive -l:libx265.a $(addprefix -l,${GO_LIBS}) 
-Wl,--end-group $(addprefix -L,${GO_LIB_PATHS})"; \
cd ${OUT} && ${CURDIR}/${GO_PATH}/bin/go build -x -ldflags '-X 
dynaserve.version=$(strip $(shell cat version.txt))' -o dynapackd 
${CURDIR}/src/server.go

Archive in question - libsmuxed.a - whole-archive option is required for 
the executable to work. 

GO_LIBS = does not include libsmuxed.a

The above script works fine on go 1.9.6. 

After updating to 1.14.6, I am facing multiple definition issues for the 
whole libsmuxed.a static library. From the errors, It seems like the 
library in linked twice. 

I am able to successfully test the executable only if 
--allow-multiple-definition option is added to CGO_LDFLAGS. I think this 
can be a temporary solution until i figure out why go build linker is 
linking libraries with whole-archive twice.

Could you please let me know how to solve this issue? 

Thanks,

Best,
Athith

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/28df3509-8990-4fcb-b097-11ca6142e3a1n%40googlegroups.com.

Reply via email to