New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: '_GNU_SOURCE' macro redefined in net package when building TinyGo on Linux #66325
Comments
here's the fix: $ git log --oneline -1
db6097f8cb (HEAD -> release-branch.go1.22, tag: go1.22.1, origin/release-branch.go1.22) [release-branch.go1.22] go1.22.1
b@anakin:~/git/go1.22 (release-branch.go1.22)*
$ git diff
diff --git a/src/net/cgo_unix_cgo.go b/src/net/cgo_unix_cgo.go
index 7c609eddbf..ac86575652 100644
--- a/src/net/cgo_unix_cgo.go
+++ b/src/net/cgo_unix_cgo.go
@@ -7,7 +7,9 @@
package net
/*
+#ifndef _GNU_SOURCE
#define _GNU_SOURCE
+#endif
#cgo CFLAGS: -fno-stack-protector
#include <sys/types.h>
b@anakin:~/git/go1.22 (release-branch.go1.22)*
$ |
Change https://go.dev/cl/571875 mentions this issue: |
@ianlancetaylor thanks for fixing. I did not know |
@awmorgan |
If you use the C compiler |
@fweimer @ianlancetaylor thanks! |
Makes the build work with CGO_CPPFLAGS=-D_GNU_SOURCE, as reportedly used by TinyGo. Fixes golang#66325 Change-Id: I794f1cd89814638fdb6c3066d13bbd7da88c9d93 Reviewed-on: https://go-review.googlesource.com/c/go/+/571875 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> Commit-Queue: Ian Lance Taylor <iant@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Makes the build work with CGO_CPPFLAGS=-D_GNU_SOURCE, as reportedly used by TinyGo. Fixes golang#66325 Change-Id: I794f1cd89814638fdb6c3066d13bbd7da88c9d93 Reviewed-on: https://go-review.googlesource.com/c/go/+/571875 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> Commit-Queue: Ian Lance Taylor <iant@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Go version
go version go1.22.1 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I built TinyGo and got a warning.
To reproduce checkout and build TinyGo
What did you see happen?
warning is at end of output:
What did you expect to see?
Expected to see no warning from Go standard library file src/net/cgo_unix_cgo.go
The text was updated successfully, but these errors were encountered: