Thanks for the comments. I had to do it as root because running

go install -buildmode=shared std

as me results in

go install internal/goarch: mkdir /usr/local/go/pkg/linux_amd64_dynlink: 
permission denied

As root, changing the ownership of /usr/local/go/pkg/linux_amd64_dynlink to 
me, and then, as me, running

go install -buildmode=shared std 

ran to completion. So, the solution to problem #1 is to make sure a normal 
user can create
/usr/local/go/pkg/linux_amd64_dynlink and files in and underneath it.

(I did all this after reinstalling go from scratch).

However, none of this changed the possible creation of an possibly 
unnecessary  shared lib, and the
resulting build time penalty, e.g

% time go build -linkshared t.go
go build -linkshared t.go  1.22s user 0.29s system 103% cpu 1.455 total
% time go build t.go
go build t.go  0.10s user 0.04s system 132% cpu 0.102 total

In looking at the commands executed by go build, I still see what looks 
like a lot
of extra work being done, but I'm not 100% sure. That's what I'm hoping a Go
expert can comment on. (I'd be happy to send the list of commands being 
executed
to anybody who wants it. )

I agree it wouldn't make any sense for a shared library to be created that 
only contains
the code that my program needs. I was expecting for a shared library to be 
created that
contains the entire go runtime.

 Jon



-- 
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/0277b068-2b27-46b1-b190-9e4e0067cc43n%40googlegroups.com.

Reply via email to