You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golan...@googlegroups.com
Can gccgo cross compile fully static binaries? I can't seem to stop it from dynamically linking glibc.
mipsel-linux-go build -gccgoflags="-static" /home/andrewc/Desktop/mips/cross/output/lib/gcc/mipsel-linux/5.1.0/../../../../mipsel-linux/lib/libgo.a(user.o): In function `user.lookupUnix': /home/andrewc/Desktop/mips/cross/build-gcc/mipsel-linux/libgo/../../../gcc/libgo/go/os/user/lookup_unix.go:67: warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /home/andrewc/Desktop/mips/cross/build-gcc/mipsel-linux/libgo/../../../gcc/libgo/go/os/user/lookup_unix.go:81: warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /home/andrewc/Desktop/mips/cross/output/lib/gcc/mipsel-linux/5.1.0/../../../../mipsel-linux/lib/libgo.a(net.o): In function `net.cgoLookupPort': /home/andrewc/Desktop/mips/cross/build-gcc/mipsel-linux/libgo/../../../gcc/libgo/go/net/cgo_unix.go:83: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
Ian Lance Taylor
unread,
May 26, 2015, 9:54:58 AM5/26/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Andrew Chambers, golang-nuts
This is not a gccgo issue. It's a glibc issue. If you look at the
resulting executable, it should be statically linked. However, as the
warning indicates, if you want to actually run the executable, it must
be able to find, at runtime, the dynamic libraries from the same glibc
version. Glibc requires this for any program that looks up user or
host information.
I haven't tried this, but you can apparently avoid this by rebuilding
glibc itself, which is not a task recommended for beginners:
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golan...@googlegroups.com, andrewc...@gmail.com
Thanks, perhaps I can avoid this by building gcc newlib instead of glibc. I am trying to produce entirely static binaries for running on a router even if the libc version etc may change.