cgo: use slash-free relative paths for .so references

The Makefile and cgo now rewrite / to _ when creating the path.
The .so for gosqlite.googlecode.com/hg/sqlite is named
cgo_gosqlite.googlecode.com_hg_sqlite.so, and then 6l and 8l
both include a default rpath of $GOROOT/pkg/$GOOS_$GOARCH.
This should make it easier to move binaries from one system
to another.

Fixes #857.

R=iant, r
CC=golang-dev
https://golang.org/cl/1700048
diff --git a/src/cmd/6l/obj.c b/src/cmd/6l/obj.c
index 6a0d49f..5a4b6a3 100644
--- a/src/cmd/6l/obj.c
+++ b/src/cmd/6l/obj.c
@@ -138,6 +138,8 @@
 		usage();
 
 	libinit();
+	if(rpath == nil)
+		rpath = smprint("%s/pkg/%s_%s", goroot, goos, goarch);
 
 	if(HEADTYPE == -1) {
 		HEADTYPE = 2;