Skip to contentSkip to conversation

Fix build with host gcc9 / latest glibc

PATCH New Andreas Müller 1 participant 5 messages Sep 24, 2019

lore
Share & tools
lore
#0 lore raw

v2 cover Fix build with host gcc9 / latest glibc

Build errors popped up with Fedora 30

V1 -> V2:
Corrected Upstream-Status

Andreas Müller (3):
elfutils(-native): Add backported patch to fix build with host gcc9 glib-2.0: Add patch from upstream to fix build with host gcc9
cross-localedef-native: Fix build for hosts with recent glibc

Khem Raj (1):
bison: Fix build break with glibc 2.28

 ...11-gdbus-Avoid-printing-null-strings.patch | 77 ++++++++++++++++++
 meta/recipes-core/glib-2.0/glib-2.0_2.54.3.bb |  1 +
 .../glibc/cross-localedef-native_2.27.bb      |  1 +
 ...ll-_IO_fwide-if-_LIBC-is-not-defined.patch | 78 +++++++++++++++++++
 .../recipes-devtools/bison/bison/gnulib.patch | 21 +++++
 meta/recipes-devtools/bison/bison_3.0.4.bb    |  1 +
 .../elfutils/elfutils_0.170.bb                |  1 +
 ...-fsize-and-msize-with-const-attribut.patch | 42 ++++++++++
 8 files changed, 222 insertions(+)
 create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/0011-gdbus-Avoid-printing-null-strings.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0032-argp-do-not-call-_IO_fwide-if-_LIBC-is-not-defined.patch
 create mode 100644 meta/recipes-devtools/bison/bison/gnulib.patch
 create mode 100644 meta/recipes-devtools/elfutils/files/0009-libelf-Mark-both-fsize-and-msize-with-const-attribut.patch
Signature · 1 line
2.21.0
#1 lore raw

PATCH v2 1/4 elfutils(-native): Add backported patch to fix build with host gcc9

---
 .../elfutils/elfutils_0.170.bb                |  1 +
 ...-fsize-and-msize-with-const-attribut.patch | 42 +++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 meta/recipes-devtools/elfutils/files/0009-libelf-Mark-both-fsize-and-msize-with-const-attribut.patch
meta/recipes-devtools/elfutils/elfutils_0.170.bb +1 -0
index 14ac22ee643..48f14286203 100644
@@ -25,6 +25,7 @@ SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
            file://debian/0003-Add-mips-n64-relocation-format-hack.patch \
            file://0001-Use-fallthrough-attribute.patch \
            file://0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch \
+           file://0009-libelf-Mark-both-fsize-and-msize-with-const-attribut.patch \
            "
 SRC_URI_append_libc-musl = " file://0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch"
 SRC_URI[md5sum] = "03599aee98c9b726c7a732a2dd0245d5"
meta/recipes-devtools/elfutils/files/0009-libelf-Mark-both-fsize-and-msize-with-const-attribut.patch new file +42 -0

42 lines not on this page · raw message

Signature · 1 line
2.21.0
#2 lore raw

PATCH v2 2/4 bison: Fix build break with glibc 2.28

In reply to Andreas Müller

From: Khem Raj <[email protected]>

(From OE-Core rev: 741415c58b3565764000028c26efd081212eb989)

---
 .../recipes-devtools/bison/bison/gnulib.patch | 21 +++++++++++++++++++
 meta/recipes-devtools/bison/bison_3.0.4.bb    |  1 +
 2 files changed, 22 insertions(+)
 create mode 100644 meta/recipes-devtools/bison/bison/gnulib.patch
meta/recipes-devtools/bison/bison/gnulib.patch new file +21 -0
new file mode 100644
index 00000000000..7eaf0ce0fa9
@@ -0,0 +1,21 @@
+Fix gnulib issues found with glibc 2.28 libio.h removal
+
+see
+https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+
+Index: bison-3.0.4/lib/fseterr.c
+===================================================================
+--- bison-3.0.4.orig/lib/fseterr.c
++++ bison-3.0.4/lib/fseterr.c
+@@ -29,7 +29,7 @@ fseterr (FILE *fp)
+   /* Most systems provide FILE as a struct and the necessary bitmask in
+      <stdio.h>, because they need it for implementing getc() and putc() as
+      fast macros.  */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   fp->_flags |= _IO_ERR_SEEN;
+ #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
+   fp_->_flags |= __SERR;
meta/recipes-devtools/bison/bison_3.0.4.bb +1 -0
index 58728f5021f..cc155f0fbe3 100644
@@ -14,6 +14,7 @@ SRC_URI = "${GNU_MIRROR}/bison/bison-${PV}.tar.xz \
            file://dont-depend-on-help2man.patch.patch \
            file://0001-src-local.mk-fix-parallel-issue.patch \
            file://add-with-bisonlocaledir.patch \
+           file://gnulib.patch \
 "
 
 # No point in hardcoding path to m4, just use PATH
Signature · 1 line
2.21.0
#3 lore raw

PATCH v2 3/4 glib-2.0: Add patch from upstream to fix build with host gcc9

In reply to Andreas Müller
---
 ...11-gdbus-Avoid-printing-null-strings.patch | 77 +++++++++++++++++++
 meta/recipes-core/glib-2.0/glib-2.0_2.54.3.bb |  1 +
 2 files changed, 78 insertions(+)
 create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/0011-gdbus-Avoid-printing-null-strings.patch
meta/recipes-core/glib-2.0/glib-2.0/0011-gdbus-Avoid-printing-null-strings.patch new file +77 -0
new file mode 100644
index 00000000000..19085d0b789
@@ -0,0 +1,77 @@
+From 566e1d61a500267c7849ad0b2552feec9c9a29a6 Mon Sep 17 00:00:00 2001
+From: Ernestas Kulik <[email protected]>
+Date: Tue, 29 Jan 2019 09:50:46 +0100
+Subject: [PATCH] gdbus: Avoid printing null strings
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This mostly affects the 2.56 branch, but, given that GCC 9 is being
+stricter about passing null string pointers to printf-like functions, it
+might make sense to proactively fix such calls.
+
+gdbusauth.c: In function '_g_dbus_auth_run_server':
+gdbusauth.c:1302:11: error: '%s' directive argument is null
+[-Werror=format-overflow=]
+ 1302 |           debug_print ("SERVER: WaitingForBegin, read '%s'",
+ line);
+       |
+
+gdbusmessage.c: In function ‘g_dbus_message_to_blob’:
+gdbusmessage.c:2730:30: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
+ 2730 |       tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
+      |
+
+Upstream-Status: Accepted
+
+[1] https://gitlab.gnome.org/GNOME/glib/commit/566e1d61a500267c7849ad0b2552feec9c9a29a6
+
+Signed-off-by: Andreas Müller <[email protected]>
+---
+ gio/gdbusauth.c    | 2 +-
+ gio/gdbusmessage.c | 5 ++---
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c
+index 1f8ea8057..752ec23fc 100644
+--- a/gio/gdbusauth.c
++++ b/gio/gdbusauth.c
+@@ -1272,9 +1272,9 @@ _g_dbus_auth_run_server (GDBusAuth              *auth,
+                                                     &line_length,
+                                                     cancellable,
+                                                     error);
+-          debug_print ("SERVER: WaitingForBegin, read '%s'", line);
+           if (line == NULL)
+             goto out;
++          debug_print ("SERVER: WaitingForBegin, read '%s'", line);
+           if (g_strcmp0 (line, "BEGIN") == 0)
+             {
+               /* YAY, done! */
+diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
+index 3221b925d..3a1a1f9e9 100644
+--- a/gio/gdbusmessage.c
++++ b/gio/gdbusmessage.c
+@@ -2731,7 +2731,6 @@ g_dbus_message_to_blob (GDBusMessage          *message,
+   if (message->body != NULL)
+     {
+       gchar *tupled_signature_str;
+-      tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
+       if (signature == NULL)
+         {
+           g_set_error (error,
+@@ -2739,10 +2738,10 @@ g_dbus_message_to_blob (GDBusMessage          *message,
+                        G_IO_ERROR_INVALID_ARGUMENT,
+                        _("Message body has signature “%s” but there is no signature header"),
+                        signature_str);
+-          g_free (tupled_signature_str);
+           goto out;
+         }
+-      else if (g_strcmp0 (tupled_signature_str, g_variant_get_type_string (message->body)) != 0)
++      tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
++      if (g_strcmp0 (tupled_signature_str, g_variant_get_type_string (message->body)) != 0)
+         {
+           g_set_error (error,
+                        G_IO_ERROR,
+-- 
+2.21.0
+
meta/recipes-core/glib-2.0/glib-2.0_2.54.3.bb +1 -0
index faf594569d6..35fd86819bf 100644
@@ -16,6 +16,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
            file://0001-Do-not-ignore-return-value-of-write.patch \
            file://0001-Test-for-pthread_getname_np-before-using-it.patch \
            file://0010-Do-not-hardcode-python-path-into-various-tools.patch \
+           file://0011-gdbus-Avoid-printing-null-strings.patch \
            "
 
 SRC_URI_append_class-native = " file://relocate-modules.patch"
Signature · 1 line
2.21.0
#4 lore raw

PATCH v2 4/4 cross-localedef-native: Fix build for hosts with recent glibc

In reply to Andreas Müller

Fixes:

| argp-help.c:(.text+0x1f51): undefined reference to `_IO_fwide'
| collect2: error: ld returned 1 exit status
| make: *** [Makefile:60: localedef] Error 1
---
 .../glibc/cross-localedef-native_2.27.bb      |  1 +
 ...ll-_IO_fwide-if-_LIBC-is-not-defined.patch | 78 +++++++++++++++++++
 2 files changed, 79 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/0032-argp-do-not-call-_IO_fwide-if-_LIBC-is-not-defined.patch
meta/recipes-core/glibc/cross-localedef-native_2.27.bb +1 -0
index 5e92eb71d55..a999d35201a 100644
@@ -35,6 +35,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
            file://0021-eglibc-Install-PIC-archives.patch \
            file://0022-eglibc-Forward-port-cross-locale-generation-support.patch \
            file://0023-Define-DUMMY_LOCALE_T-if-not-defined.patch \
+           file://0032-argp-do-not-call-_IO_fwide-if-_LIBC-is-not-defined.patch \
            file://archive-path.patch \
 "
 # Makes for a rather long rev (22 characters), but...
meta/recipes-core/glibc/glibc/0032-argp-do-not-call-_IO_fwide-if-_LIBC-is-not-defined.patch new file +78 -0

78 lines not on this page · raw message

Signature · 1 line
2.21.0