Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/3] libglib2: backport upstream patch to handle missing fcntl() flags
@ 2018-07-30 22:02 Hollis Blanchard
  2018-07-30 22:02 ` [Buildroot] [PATCH v2 2/3] host-attr: build fix for GCC <4.5 Hollis Blanchard
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Hollis Blanchard @ 2018-07-30 22:02 UTC (permalink / raw)
  To: buildroot

On RHEL6 hosts, fcntl.h doesn't define F_SETPIPE_SZ or F_GETPIPE_SZ. Upstream
glib has a patch for this case that wasn't applied to their 2.56.1 branch.

Signed-off-by: Hollis Blanchard <hollis_blanchard@mentor.com>
---
 ...-fix-compilation-without-F_-S-G-ETPIPE_SZ.patch | 52 ++++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 package/libglib2/0005-gio-fix-compilation-without-F_-S-G-ETPIPE_SZ.patch

diff --git a/package/libglib2/0005-gio-fix-compilation-without-F_-S-G-ETPIPE_SZ.patch b/package/libglib2/0005-gio-fix-compilation-without-F_-S-G-ETPIPE_SZ.patch
new file mode 100644
index 0000000000..032f4851c4
--- /dev/null
+++ b/package/libglib2/0005-gio-fix-compilation-without-F_-S-G-ETPIPE_SZ.patch
@@ -0,0 +1,52 @@
+From 0beb62f564072f3585762c9c55fe894485993b62 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Tue, 10 Apr 2018 18:55:11 +0200
+Subject: [PATCH] gio: fix compilation without F_{S,G}ETPIPE_SZ
+
+Commit a5778ef7c51044147fe470ea1707dd297f44f880 broke compilation on
+architectures without F_SETPIPE_SZ and F_GETPIPE_SZ such as or1k.
+If those variables are undefined, put back previous behavior, buffer
+size set to 1024 * 64
+
+Fixes:
+ - http://autobuild.buildroot.net/results/398490e07343a931b25ca6ab5c90a75d7a073e9f
+
+(Modified by Philip Withnall <withnall@endlessm.com> to add an
+explanatory comment.)
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+
+https://bugzilla.gnome.org/show_bug.cgi?id=795133
+---
+ gio/gfile.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/gio/gfile.c b/gio/gfile.c
+index 334ad8ec3..a67aad383 100644
+--- a/gio/gfile.c
++++ b/gio/gfile.c
+@@ -3012,6 +3012,7 @@ splice_stream_with_progress (GInputStream           *in,
+   if (!g_unix_open_pipe (buffer, FD_CLOEXEC, error))
+     return FALSE;
+ 
++#if defined(F_SETPIPE_SZ) && defined(F_GETPIPE_SZ)
+   /* Try a 1MiB buffer for improved throughput. If that fails, use the default
+    * pipe size. See: https://bugzilla.gnome.org/791457 */
+   buffer_size = fcntl (buffer[1], F_SETPIPE_SZ, 1024 * 1024);
+@@ -3029,6 +3030,13 @@ splice_stream_with_progress (GInputStream           *in,
+           goto out;
+         }
+     }
++#else
++  /* If #F_GETPIPE_SZ isn?t available, assume we?re on Linux < 2.6.35,
++   * but ? 2.6.11, meaning the pipe capacity is 64KiB. Ignore the possibility of
++   * running on Linux < 2.6.11 (where the capacity was the system page size,
++   * typically 4KiB) because it?s ancient. See pipe(7). */
++  buffer_size = 1024 * 64;
++#endif
+ 
+   g_assert (buffer_size > 0);
+ 
+-- 
+2.13.0
+
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-08-20 20:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-30 22:02 [Buildroot] [PATCH v2 1/3] libglib2: backport upstream patch to handle missing fcntl() flags Hollis Blanchard
2018-07-30 22:02 ` [Buildroot] [PATCH v2 2/3] host-attr: build fix for GCC <4.5 Hollis Blanchard
2018-07-31 19:47   ` Thomas Petazzoni
2018-07-30 22:02 ` [Buildroot] [PATCH v2 3/3] host-acl: build fix for GCC 4.4.7 Hollis Blanchard
2018-07-31 19:50   ` Thomas Petazzoni
2018-07-31 19:43 ` [Buildroot] [PATCH v2 1/3] libglib2: backport upstream patch to handle missing fcntl() flags Thomas Petazzoni
2018-08-20 20:32 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox