aboutsummaryrefslogtreecommitdiff
path: root/projects/cros-ec/patches/nyan/0001-use-_DEFAULT_SOURCE-for-newer-glibc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'projects/cros-ec/patches/nyan/0001-use-_DEFAULT_SOURCE-for-newer-glibc.patch')
-rw-r--r--projects/cros-ec/patches/nyan/0001-use-_DEFAULT_SOURCE-for-newer-glibc.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/projects/cros-ec/patches/nyan/0001-use-_DEFAULT_SOURCE-for-newer-glibc.patch b/projects/cros-ec/patches/nyan/0001-use-_DEFAULT_SOURCE-for-newer-glibc.patch
new file mode 100644
index 00000000..ef3d40dc
--- /dev/null
+++ b/projects/cros-ec/patches/nyan/0001-use-_DEFAULT_SOURCE-for-newer-glibc.patch
@@ -0,0 +1,53 @@
+From b98bd2808f4185970781bd4dcca141cbda9b03c6 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@chromium.org>
+Date: Mon, 7 Dec 2015 21:46:13 -0500
+Subject: [PATCH 1/4] use _DEFAULT_SOURCE for newer glibc
+
+Newer versions of glibc have moved to _DEFAULT_SOURCE and away from
+_BSD_SOURCE. Trying to use the BSD define by itself leads to warnings
+which causes build failures.
+
+BRANCH=none
+BUG=None
+TEST=precq still works
+
+Signed-off-by: Mike Frysinger <vapier@chromium.org>
+Change-Id: Ice24b84dc6a540695fc7b76e8f22a4c85c301976
+Reviewed-on: https://chromium-review.googlesource.com/316730
+Reviewed-by: Bill Richardson <wfrichar@chromium.org>
+---
+ util/ec_uartd.c | 3 ++-
+ util/stm32mon.c | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/util/ec_uartd.c b/util/ec_uartd.c
+index fbf4a5e..bfd0642 100644
+--- a/util/ec_uartd.c
++++ b/util/ec_uartd.c
+@@ -11,7 +11,8 @@
+ */
+
+ /* Force header files to define grantpt(), posix_openpt(), cfmakeraw() */
+-#define _BSD_SOURCE
++#define _DEFAULT_SOURCE /* Newer glibc */
++#define _BSD_SOURCE /* Older glibc */
+ #define _XOPEN_SOURCE 600
+ /* Force header file to declare ptsname_r(), etc. */
+ #ifndef _GNU_SOURCE
+diff --git a/util/stm32mon.c b/util/stm32mon.c
+index 2e73bcf..f65cd64 100644
+--- a/util/stm32mon.c
++++ b/util/stm32mon.c
+@@ -6,7 +6,8 @@
+ */
+
+ /* use cfmakeraw() */
+-#define _BSD_SOURCE
++#define _DEFAULT_SOURCE /* Newer glibc */
++#define _BSD_SOURCE /* Older glibc */
+
+ #include <arpa/inet.h>
+ #include <errno.h>
+--
+2.9.0
+