public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "yohei at jp dot ibm.com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug go/63731] New: Fallback to netgo does not work Date: Tue, 04 Nov 2014 08:08:00 -0000 [thread overview] Message-ID: <bug-63731-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63731 Bug ID: 63731 Summary: Fallback to netgo does not work Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: go Assignee: ian at airs dot com Reporter: yohei at jp dot ibm.com CC: cmang at google dot com When the DNS resolver with CGO fails for statically linked binaries, it should fall back to the pure-go DNS resolver, if I understand correctly. This fallback mechanism does work at least on Linux for x86_64 and ppc64le. The variable ok in lookupIP in go/net/lookup_unix.go seems always set to true, so the fallback mechanism would never be called. Here is an example code to demonstrate the problem. $ gccgo -v Using built-in specs. COLLECT_GCC=gccgo COLLECT_LTO_WRAPPER=/usr/local/gccgo-216834/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../src/configure --enable-threads=posix --enable-shared --enable-__cxa_atexit --enable-languages=c,c++,go --enable-secureplt --enable-checking=yes --with-long-double-128 --enable-decimal-float --disable-bootstrap --disable-alsa --disable-multilib --prefix=/usr/local/gccgo-216834 Thread model: posix gcc version 5.0.0 20141029 (experimental) (GCC) $ cat lookup.go package main import ( "fmt" "net" ) func main() { addrs, err := net.LookupHost("gcc.gnu.org") if err != nil { fmt.Println(err) } else { for i := 0; i < len(addrs); i++ { fmt.Println(addrs[i]) } } } $ gccgo lookup.go $ ./a.out 209.132.180.131 $ gccgo -static lookup.go /usr/local/gccgo-216834/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/../../../../lib64/libgo.a(net.o): In function `net.cgoLookupPort': /home/yohei/gccgo.216834/bld/x86_64-unknown-linux-gnu/libgo/../../../src/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 $ ./a.out lookup gcc.gnu.org: Name or service not known $ LD_LIBRARY_PATH=/lib/x86_64-linux-gnu ./a.out 209.132.180.131
next reply other threads:[~2014-11-04 8:08 UTC|newest] Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-11-04 8:08 yohei at jp dot ibm.com [this message] 2014-11-14 4:15 ` [Bug go/63731] " yohei at jp dot ibm.com 2014-11-14 4:49 ` yohei at jp dot ibm.com 2014-11-14 15:54 ` ian at airs dot com 2014-11-17 8:16 ` yohei at jp dot ibm.com 2014-11-17 15:44 ` ian at airs dot com 2014-11-17 18:27 ` boger at us dot ibm.com 2014-11-18 0:24 ` ian at airs dot com 2014-11-18 6:15 ` yohei at jp dot ibm.com 2014-11-18 13:16 ` boger at us dot ibm.com 2014-11-18 13:52 ` yohei at jp dot ibm.com 2014-11-19 20:32 ` boger at us dot ibm.com 2014-11-20 13:25 ` boger at us dot ibm.com 2014-11-20 14:49 ` yohei at jp dot ibm.com 2014-11-20 20:02 ` boger at us dot ibm.com 2014-11-21 4:26 ` ian at airs dot com 2014-11-21 15:12 ` boger at us dot ibm.com 2014-11-21 17:10 ` ian at airs dot com 2014-11-25 15:35 ` boger at us dot ibm.com 2014-12-03 13:03 ` yohei at jp dot ibm.com 2014-12-03 16:10 ` boger at us dot ibm.com 2014-12-03 18:39 ` boger at us dot ibm.com 2014-12-03 19:17 ` ian at airs dot com 2015-02-28 10:16 ` e29253 at jp dot ibm.com 2015-02-28 21:01 ` ian at airs dot com 2015-03-01 23:40 ` ian at airs dot com 2015-03-02 21:58 ` boger at us dot ibm.com 2015-03-02 23:34 ` ian at airs dot com 2015-03-31 16:06 ` boger at us dot ibm.com 2015-04-01 14:11 ` boger at us dot ibm.com 2015-04-07 18:10 ` ian at gcc dot gnu.org 2015-04-07 18:10 ` ian at airs dot com 2015-04-08 14:41 ` boger at us dot ibm.com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-63731-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).