Re: [go-nuts] Build error from pragma warnings when doing "go build -buildmode=c shared..."
On Thu, May 20, 2021 at 6:46 AM Aaron Epstein wrote: > > gcc > > Is there a way to see which version go is picking up? I have both 4.9.4 and > 4.1.2. I suspect it is picking up 4.1.2 and this is the cause, but is there a > way to tell? With bash on Unix systems, run $(go env CC) --version GCC 4.1.2 came out in 2007. I guess we no longer support it. I think that's OK. GCC 4.9.4 came out in 2016. The most recent GCC release is 11.1. Ian -- 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/CAOyqgcUjtq%2B5%2Bsgo2M6MW7_MDfcZvguHhTXbCWQYLLVJatF0xw%40mail.gmail.com.
Re: [go-nuts] Build error from pragma warnings when doing "go build -buildmode=c shared..."
On Thu, 20 May 2021 07:05:22 -0700 (PDT) Aaron Epstein wrote: > Removing gcc 4.1.2 from PATH so it picked up 4.9.4 which resolved > this issue. > > Still would be good to know if it is possible to know which gcc go is > using... > As addition to Manlio reply, for more information about using cgo https://golang.org/cmd/cgo/ Snip from, "... The default C and C++ compilers may be changed by the CC and CXX environment variables, respectively; those environment variables may include command line options." -- 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/20210520215343.6aae484e%40inspiro.localdomain. pgpon8MZr9VsW.pgp Description: OpenPGP digital signature
Re: [go-nuts] Build error from pragma warnings when doing "go build -buildmode=c shared..."
Note that you can explicitly tell go the C compiler to use, by setting the CC environment variable. As an example: go env -w CC=path-to-gcc4.9.4 Manlio On Thursday, May 20, 2021 at 4:05:22 PM UTC+2 slugge...@gmail.com wrote: > Removing gcc 4.1.2 from PATH so it picked up 4.9.4 which resolved this > issue. > > Still would be good to know if it is possible to know which gcc go is > using... > > On Thursday, May 20, 2021 at 9:46:34 AM UTC-4 Aaron Epstein wrote: > >> gcc >> >> Is there a way to see which version go is picking up? I have both 4.9.4 >> and 4.1.2. I suspect it is picking up 4.1.2 and this is the cause, but is >> there a way to tell? >> >> On Thursday, May 20, 2021 at 9:36:57 AM UTC-4 Ian Lance Taylor wrote: >> >>> On Thu, May 20, 2021, 4:47 AM Aaron Epstein wrote: >>> I am seeing a compiler error when building a shared c library from a go program. The error is: GO111MODULE=on go build -buildmode=c-shared -o mylib.so myfile.go # runtime/cgo cc1: warnings being treated as errors _cgo_export.c:6: warning: ignoring #pragma GCC diagnostic _cgo_export.c:7: warning: ignoring #pragma GCC diagnostic _cgo_export.c:8: warning: ignoring #pragma GCC diagnostic CGO_ENABLED=1 is set as well. This is using go 1.13. Any ideas? >>> >>> What C compiler are you using? What version? >>> >>> Ian >>> >>> -- 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/03210d22-bb44-47ae-bf9e-57a70a6c2070n%40googlegroups.com.
Re: [go-nuts] Build error from pragma warnings when doing "go build -buildmode=c shared..."
Removing gcc 4.1.2 from PATH so it picked up 4.9.4 which resolved this issue. Still would be good to know if it is possible to know which gcc go is using... On Thursday, May 20, 2021 at 9:46:34 AM UTC-4 Aaron Epstein wrote: > gcc > > Is there a way to see which version go is picking up? I have both 4.9.4 > and 4.1.2. I suspect it is picking up 4.1.2 and this is the cause, but is > there a way to tell? > > On Thursday, May 20, 2021 at 9:36:57 AM UTC-4 Ian Lance Taylor wrote: > >> On Thu, May 20, 2021, 4:47 AM Aaron Epstein wrote: >> >>> >>> I am seeing a compiler error when building a shared c library from a go >>> program. The error is: >>> >>> GO111MODULE=on go build -buildmode=c-shared -o mylib.so myfile.go >>> # runtime/cgo >>> cc1: warnings being treated as errors >>> _cgo_export.c:6: warning: ignoring #pragma GCC diagnostic >>> _cgo_export.c:7: warning: ignoring #pragma GCC diagnostic >>> _cgo_export.c:8: warning: ignoring #pragma GCC diagnostic >>> >>> CGO_ENABLED=1 is set as well. This is using go 1.13. Any ideas? >>> >> >> What C compiler are you using? What version? >> >> Ian >> >> -- 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/352236d1-1f21-4602-b250-154c44a5fc01n%40googlegroups.com.
Re: [go-nuts] Build error from pragma warnings when doing "go build -buildmode=c shared..."
gcc Is there a way to see which version go is picking up? I have both 4.9.4 and 4.1.2. I suspect it is picking up 4.1.2 and this is the cause, but is there a way to tell? On Thursday, May 20, 2021 at 9:36:57 AM UTC-4 Ian Lance Taylor wrote: > On Thu, May 20, 2021, 4:47 AM Aaron Epstein wrote: > >> >> I am seeing a compiler error when building a shared c library from a go >> program. The error is: >> >> GO111MODULE=on go build -buildmode=c-shared -o mylib.so myfile.go >> # runtime/cgo >> cc1: warnings being treated as errors >> _cgo_export.c:6: warning: ignoring #pragma GCC diagnostic >> _cgo_export.c:7: warning: ignoring #pragma GCC diagnostic >> _cgo_export.c:8: warning: ignoring #pragma GCC diagnostic >> >> CGO_ENABLED=1 is set as well. This is using go 1.13. Any ideas? >> > > What C compiler are you using? What version? > > Ian > > -- 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/bf6644e9-6ad9-48cd-a754-40ccec1fb1ecn%40googlegroups.com.
Re: [go-nuts] Build error from pragma warnings when doing "go build -buildmode=c shared..."
On Thu, May 20, 2021, 4:47 AM Aaron Epstein wrote: > > I am seeing a compiler error when building a shared c library from a go > program. The error is: > > GO111MODULE=on go build -buildmode=c-shared -o mylib.so myfile.go > # runtime/cgo > cc1: warnings being treated as errors > _cgo_export.c:6: warning: ignoring #pragma GCC diagnostic > _cgo_export.c:7: warning: ignoring #pragma GCC diagnostic > _cgo_export.c:8: warning: ignoring #pragma GCC diagnostic > > CGO_ENABLED=1 is set as well. This is using go 1.13. Any ideas? > What C compiler are you using? What version? Ian -- 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/CAOyqgcX%2BGx%3D_7Bt0%2B5VTPDXXuPboV89xWsB4UZk_wYeO2n6n%3Dg%40mail.gmail.com.
[go-nuts] Build error from pragma warnings when doing "go build -buildmode=c shared..."
Hi, I am seeing a compiler error when building a shared c library from a go program. The error is: GO111MODULE=on go build -buildmode=c-shared -o mylib.so myfile.go # runtime/cgo cc1: warnings being treated as errors _cgo_export.c:6: warning: ignoring #pragma GCC diagnostic _cgo_export.c:7: warning: ignoring #pragma GCC diagnostic _cgo_export.c:8: warning: ignoring #pragma GCC diagnostic CGO_ENABLED=1 is set as well. This is using go 1.13. Any ideas? Thanks, Aaron -- 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/09123e31-2032-42c0-b449-70d783ddbcecn%40googlegroups.com.