summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/go
diff options
context:
space:
mode:
authorAmy Fong <amy.fong@windriver.com>2015-06-19 12:00:45 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2015-06-19 15:31:34 -0400
commit0682e9edcb7ca9c92eb40b61a01a12e20f1791b1 (patch)
tree9c7df8f629df3916733bfb41d2fd91d8016c50ae /recipes-devtools/go
parent336cb30da95e199dac299d2dc08050aad0e95e0a (diff)
downloadmeta-virtualization-0682e9edcb7ca9c92eb40b61a01a12e20f1791b1.tar.gz
golang-cross: do_compile fails on warnings treated as error
On glibc 2.20+, the _BSD_SOURCE and _SVID_SOURCE feature test macros are deprecated as of glibc 2.19.90 (2.20 devel), we define _DEFAULT_SOURCE instead. (fixed upstream) https://groups.google.com/forum/#!topic/golang-codereviews/S4TARFCxu2k Signed-off-by: Amy Fong <amy.fong@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-devtools/go')
-rw-r--r--recipes-devtools/go/files/bsd_svid_source.patch37
-rw-r--r--recipes-devtools/go/golang-cross.inc6
2 files changed, 42 insertions, 1 deletions
diff --git a/recipes-devtools/go/files/bsd_svid_source.patch b/recipes-devtools/go/files/bsd_svid_source.patch
new file mode 100644
index 00000000..21e1d4cb
--- /dev/null
+++ b/recipes-devtools/go/files/bsd_svid_source.patch
@@ -0,0 +1,37 @@
1golang-cross: do_compile fails cc1: all warnings being treated as errors
2
3glibc 2.20 deprecates _BSD_SOURCE and _SVID_SOURCE and emits an error
4message. From patch 16632:
5 libc [PATCH] BZ #16632: Disable _SVID_SOURCE/_BSD_SOURCE warning
6 if _DEFAULT_SOURCE is defined
7
8Since we also need to support glibc before 2.20, from the release notes
9for glibc 2.20, the recommended fix is to define _DEFAULT_SOURCE
10
11(fixed upstream)
12https://groups.google.com/forum/#!topic/golang-codereviews/S4TARFCxu2k
13
14Signed-off-by: Amy Fong <amy.fong@windriver.com>
15---
16 include/u.h | 10 ++++++++++
17 1 file changed, 10 insertions(+)
18
19--- a/include/u.h
20+++ b/include/u.h
21@@ -38,6 +38,16 @@
22 # define __MAKECONTEXT_V2_SOURCE 1
23 # endif
24 #endif
25+/**
26+ * in glibc >= 2.20, _BSD_SOURCE and _SVID_SOURCE causes warning
27+ * messages if _DEFAULT_SOURCE is not defined.
28+ *
29+ * From glibc 2.20 release notes, since this application needs _BSD_SOURCE
30+ * and/or _SVID_SOURCE and we must support glibc < 2.19 and
31+ * glibc >= 2.20, then define all 3 (_DEFAULT_SOURCE, _BSD_SOURCE,
32+ * and _SVID_SOURCE) unconditionally
33+ */
34+#define _DEFAULT_SOURCE 1
35 #define _BSD_SOURCE 1
36 #define _NETBSD_SOURCE 1 /* NetBSD */
37 #define _SVID_SOURCE 1
diff --git a/recipes-devtools/go/golang-cross.inc b/recipes-devtools/go/golang-cross.inc
index 9330572d..ce4ee0e9 100644
--- a/recipes-devtools/go/golang-cross.inc
+++ b/recipes-devtools/go/golang-cross.inc
@@ -3,7 +3,11 @@ HOMEPAGE = "golang.org"
3# DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc" 3# DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc"
4DEPENDS = "libgcc" 4DEPENDS = "libgcc"
5PROVIDES = "virtual/${TARGET_PREFIX}golang" 5PROVIDES = "virtual/${TARGET_PREFIX}golang"
6SRC_URI = "http://golang.org/dl/go${PV}.src.tar.gz" 6SRC_URI = "\
7 http://golang.org/dl/go${PV}.src.tar.gz \
8 file://bsd_svid_source.patch \
9 "
10
7S="${WORKDIR}/go" 11S="${WORKDIR}/go"
8 12
9do_compile () { 13do_compile () {