Skip to contentSkip to conversation

libglib2: backport upstream patch to handle missing fcntl() flags

PATCH New Hollis Blanchard 3 participants 7 messages Jul 30, 2018 – Aug 20, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 libglib2: backport upstream patch to handle missing fcntl() flags

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.

---
 ...-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
package/libglib2/0005-gio-fix-compilation-without-F_-S-G-ETPIPE_SZ.patch new file +52 -0
new file mode 100644
index 0000000000..032f4851c4
@@ -0,0 +1,52 @@
+From 0beb62f564072f3585762c9c55fe894485993b62 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+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 <[email protected]> to add an
+explanatory comment.)
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+
+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
+
Signature · 1 line
2.13.0
#1 lore raw

PATCH v2 2/3 host-attr: build fix for GCC <4.5

---
 package/attr/0001-build-with-older-GCCs.patch | 87 +++++++++++++++++++++++++++
 1 file changed, 87 insertions(+)
 create mode 100644 package/attr/0001-build-with-older-GCCs.patch
package/attr/0001-build-with-older-GCCs.patch new file +87 -0
new file mode 100644
index 0000000000..2aa41107f9
@@ -0,0 +1,87 @@
+From 3ac428794ea0f95c854166c9c0cffb0267c5e98b Mon Sep 17 00:00:00 2001
+From: Hollis Blanchard <[email protected]>
+Date: Mon, 30 Jul 2018 14:17:21 -0700
+Subject: [PATCH] build with older GCCs
+
+GCC versions up through 4.4.7 (which is used in RHEL 6) do not accept any
+argument for the deprecated attribute. GCC 4.5 and later say the "msg"
+argument is optional. We don't need the messages during Buildroot builds
+anyways.
+
+Signed-off-by: Hollis Blanchard <[email protected]>
+---
+ include/attributes.h | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/include/attributes.h b/include/attributes.h
+index 14beb8f..23c39c8 100644
+--- a/include/attributes.h
++++ b/include/attributes.h
+@@ -127,10 +127,10 @@ typedef struct attr_multiop {
+  */
+ EXPORT int attr_get (const char *__path, const char *__attrname,
+ 			char *__attrvalue, int *__valuelength, int __flags)
+-	__attribute__ ((deprecated ("Use getxattr or lgetxattr instead")));
++	__attribute__ ((deprecated));
+ EXPORT int attr_getf (int __fd, const char *__attrname, char *__attrvalue,
+ 			int *__valuelength, int __flags)
+-	__attribute__ ((deprecated ("Use fgetxattr instead")));
++	__attribute__ ((deprecated));
+ 
+ /*
+  * Set the value of an attribute, creating the attribute if necessary.
+@@ -139,11 +139,11 @@ EXPORT int attr_getf (int __fd, const char *__attrname, char *__attrvalue,
+ EXPORT int attr_set (const char *__path, const char *__attrname,
+ 			const char *__attrvalue, const int __valuelength,
+ 			int __flags)
+-	__attribute__ ((deprecated ("Use setxattr or lsetxattr instead")));
++	__attribute__ ((deprecated));
+ EXPORT int attr_setf (int __fd, const char *__attrname,
+ 			const char *__attrvalue, const int __valuelength,
+ 			int __flags)
+-	__attribute__ ((deprecated ("Use fsetxattr instead")));
++	__attribute__ ((deprecated));
+ 
+ /*
+  * Remove an attribute.
+@@ -151,9 +151,9 @@ EXPORT int attr_setf (int __fd, const char *__attrname,
+  */
+ EXPORT int attr_remove (const char *__path, const char *__attrname,
+ 			int __flags)
+-	__attribute__ ((deprecated ("Use removexattr or lremovexattr instead")));
++	__attribute__ ((deprecated));
+ EXPORT int attr_removef (int __fd, const char *__attrname, int __flags)
+-	__attribute__ ((deprecated ("Use fremovexattr instead")));
++	__attribute__ ((deprecated));
+ 
+ /*
+  * List the names and sizes of the values of all the attributes of an object.
+@@ -164,10 +164,10 @@ EXPORT int attr_removef (int __fd, const char *__attrname, int __flags)
+  */
+ EXPORT int attr_list(const char *__path, char *__buffer, const int __buffersize,
+ 		int __flags, attrlist_cursor_t *__cursor)
+-	__attribute__ ((deprecated ("Use listxattr or llistxattr instead")));
++	__attribute__ ((deprecated));
+ EXPORT int attr_listf(int __fd, char *__buffer, const int __buffersize,
+ 		int __flags, attrlist_cursor_t *__cursor)
+-	__attribute__ ((deprecated ("Use flistxattr instead")));
++	__attribute__ ((deprecated));
+ 
+ /*
+  * Operate on multiple attributes of the same object simultaneously.
+@@ -188,10 +188,10 @@ EXPORT int attr_listf(int __fd, char *__buffer, const int __buffersize,
+  */
+ EXPORT int attr_multi (const char *__path, attr_multiop_t *__oplist,
+ 			int __count, int __flags)
+-	__attribute__ ((deprecated ("Use getxattr, setxattr, listxattr, removexattr instead")));
++	__attribute__ ((deprecated));
+ EXPORT int attr_multif (int __fd, attr_multiop_t *__oplist,
+ 			int __count, int __flags)
+-	__attribute__ ((deprecated ("Use getxattr, setxattr, listxattr, removexattr instead")));
++	__attribute__ ((deprecated));
+ 
+ #ifdef __cplusplus
+ }
+-- 
+2.13.0
+
Signature · 1 line
2.13.0
#2 lore raw

PATCH v2 2/3 host-attr: build fix for GCC <4.5

Hello,

Quoted 1 line · Hollis Blanchard

An empty commit log is not very good. Also, in the commit title, use just "attr" and not "host-attr" as the prefix.

package/attr/0001-build-with-older-GCCs.patch line 4

Quoted 10 lines
package/attr/0001-build-with-older-GCCs.patch new file +4 -0
new file mode 100644
index 0000000000..2aa41107f9
@@ -0,0 +1,87 @@
+From 3ac428794ea0f95c854166c9c0cffb0267c5e98b Mon Sep 17 00:00:00 2001
+From: Hollis Blanchard <[email protected]>
+Date: Mon, 30 Jul 2018 14:17:21 -0700
+Subject: [PATCH] build with older GCCs

This is not a good title for a patch. We want the title to say what the patch does instead.

package/attr/0001-build-with-older-GCCs.patch line 11

Quoted 7 lines
package/attr/0001-build-with-older-GCCs.patch new file +7 -0
+
+GCC versions up through 4.4.7 (which is used in RHEL 6) do not accept any
+argument for the deprecated attribute. GCC 4.5 and later say the "msg"
+argument is optional. We don't need the messages during Buildroot builds
+anyways.
+
+Signed-off-by: Hollis Blanchard <[email protected]>

I fixed up those minor issues and applied. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH v2 3/3 host-acl: build fix for GCC 4.4.7

In reply to Hollis Blanchard

This didn't introduce any build warnings with host gcc 4.4.7 or gcc 6.3.0.

---
 package/acl/0001-Build-with-old-GCC-versions.patch | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 package/acl/0001-Build-with-old-GCC-versions.patch
package/acl/0001-Build-with-old-GCC-versions.patch new file +32 -0
new file mode 100644
index 0000000000..3d958bffac
@@ -0,0 +1,32 @@
+From a42519dceef0493ece45538375ae1791313f16d3 Mon Sep 17 00:00:00 2001
+From: Hollis Blanchard <[email protected]>
+Date: Mon, 30 Jul 2018 14:29:46 -0700
+Subject: [PATCH] Build with old GCC versions
+
+GCC 4.4.7, as found in RHEL6, reports:
+    libacl/acl_from_text.c:307: error: #pragma GCC diagnostic not allowed inside functions
+
+Signed-off-by: Hollis Blanchard <[email protected]>
+---
+ libacl/acl_from_text.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/libacl/acl_from_text.c b/libacl/acl_from_text.c
+index 09790c9..fb6bc07 100644
+--- a/libacl/acl_from_text.c
++++ b/libacl/acl_from_text.c
+@@ -304,11 +304,8 @@ parse_acl_entry(const char **text_p, acl_t *acl_p)
+ create_entry:
+ 	if (acl_create_entry(acl_p, &entry_d) != 0)
+ 		return -1;
+-#pragma GCC diagnostic push
+-#pragma GCC diagnostic ignored "-Waddress"
+ 	if (acl_copy_entry(entry_d, int2ext(&entry_obj)) != 0)
+ 		return -1;
+-#pragma GCC diagnostic pop
+ 	return 0;
+ 
+ fail:
+-- 
+2.13.0
+
Signature · 1 line
2.13.0
#4 lore raw

PATCH v2 3/3 host-acl: build fix for GCC 4.4.7

Hello,

Quoted 7 lines · Hollis Blanchard

This didn't introduce any build warnings with host gcc 4.4.7 or gcc 6.3.0.

---
 package/acl/0001-Build-with-old-GCC-versions.patch | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 package/acl/0001-Build-with-old-GCC-versions.patch

Applied with a tweaked commit log and patch title.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH v2 1/3 libglib2: backport upstream patch to handle missing fcntl() flags

In reply to Hollis Blanchard

Hello,

Quoted 8 lines · Hollis Blanchard

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.

---
 ...-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

Applied to master after adding a reference to the autobuilder failure being fixed. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#6 lore raw

PATCH v2 1/3 libglib2: backport upstream patch to handle missing fcntl() flags

In reply to Hollis Blanchard
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Hollis" == Hollis Blanchard <[email protected]> writes:

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.

Committed to 2018.05.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard