Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
net: sendfile needs -lsendfile for external linker on Solaris #12390
With Go 1.5.0 on SunOS/amd64 (namely SmartOS), packages employing the external linker and net/* packages (e.g. CouchBase or github.com/mongodb/mongo-tools) will fail due to an undefined 'sendfile' symbol.
The following patch (from pkgsrc's package for go-1.5.0) works around the problem:
Steps to repeat:
For the record, libsocket, libnsl, and libsendfile may be filter libraries in a future release of Solaris -- typically such libraries are merged into libc. So this change won't cause any problems, as the filter libraries will provide the necessary symbol compatibility, but is unnecessary starting with a future release:
Fixes external linking of net/http tests (or anything that uses sendfile). Fixes #12390. Change-Id: Iee08998cf66e7b0ce851db138a00ebae6dc2395e Reviewed-on: https://go-review.googlesource.com/14072 Reviewed-by: Dave Cheney <email@example.com> Reviewed-by: Aram Hăvărneanu <firstname.lastname@example.org> Reviewed-on: https://go-review.googlesource.com/14246 Run-TryBot: Chris Broadfoot <email@example.com> Reviewed-by: Minux Ma <firstname.lastname@example.org>