[OE-core] Sudden errors building Sumo

Ferry Toth ftoth at telfort.nl
Fri Jan 11 16:06:32 UTC 2019


Op 10-01-19 om 21:52 schreef Marek Vasut:
> On 1/10/19 9:49 PM, Marek Vasut wrote:
>> On 1/10/19 9:48 PM, akuster808 wrote:
>>>
>>> On 1/10/19 8:23 AM, Ferry Toth wrote:
>>>> After a new checkout I am experiencing multiple errors building Sumo
>>>> that might be related:
>>>> bison-3.0.4
>>>>
>>>> cross-localedef-native_2.27
>>>>
>>>> coreutils-8.29
>>>>
>>>> On another machine with slightly out-of-date Sumo these problems do
>>>> not occur.
>>>>
>>>>
>>>> Detail below.
>>>>
>>>>
>>>> Any ideas how to fix?
>>> Can you provide how you are building this ie, local.conf, MACHINE and host
>>>
>>> What are your before and after commit hashes used?
>>>
>>> - armin
>>>> Ferry
>>>>
>>>>
>>>> virtual:native:/home/ferry/Develop/tmp/out/linux64/poky/meta/recipes-devtools/bison/bison_3.0.4.bb:do_compile
>>>>
>>>>
>>>> | ../bison-3.0.4/lib/fseterr.c: In function 'fseterr':
>>>> | ../bison-3.0.4/lib/fseterr.c:77:3: error: #error "Please port gnulib
>>>> fseterr.c to your platform! Look at the definitions of ferror and
>>>> clearerr on your system, then report this to bug-gnulib."
>>>> | #error "Please port gnulib fseterr.c to your platform! Look at the
>>>> definitions of ferror and clearerr on your system, then report this to
>>>> bug-gnulib."
>>>> | ^~~~~
>>>>
>>>>
>>>> /home/ferry/Develop/tmp/out/linux64/poky/meta/recipes-core/glibc/cross-localedef-native_2.27.bb:do_compile
>>>>
>>>>
>>>> | /home/ferry/Develop/tmp/out/linux64/build/tmp/hosttools/ld:
>>>> argp-fmtstream.c:(.text+0x525): undefined reference to `_IO_fwide'
>>>> | /home/ferry/Develop/tmp/out/linux64/build/tmp/hosttools/ld:
>>>> argp-help.o: in function `argp_failure':
>>>> | argp-help.c:(.text+0x20b3): undefined reference to `_IO_fwide'
>>>> | collect2: error: ld returned 1 exit status
>>>>
>>>>
>>>> virtual:native:/home/ferry/Develop/tmp/out/linux64/poky/meta/recipes-core/coreutils/coreutils_8.29.bb:do_compile
>>>>
>>>>
>>>> | ../coreutils-8.29/lib/freadseek.c: In function 'freadptrinc':
>>>> | ../coreutils-8.29/lib/freadseek.c:68:3: error: #error "Please port
>>>> gnulib freadseek.c to your platform! Look at the definition of getc,
>>>> getc_unlocked on your system, then report this to bug-gnulib."
>>>> | #error "Please port gnulib freadseek.c to your platform! Look at the
>>>> definition of getc, getc_unlocked on your system, then report this to
>>>> bug-gnulib."
>>>> | ^~~~~
>> Sounds like one of those glibc-2.28 problems ?
> Oh, in fact, I have this fixed locally, didn't get to sending the
> patches out, see the two attached patches. One is backport from
> oe-core/master , the other is something I grab'd from who knows where,
> feel free to tweak the patches and post them.
>
Thanks, no need to tweak them. The 2 patches solve 2 of the above errors.

For the 3rd (coreutils-native) I created asimilar patch, which fixes the 
build (see attached).

I haven't run-time tested the result. Hope to do that tonight.

-------------- next part --------------
From e619a55c0a299a59f3217ad145a5b69428a8e37e Mon Sep 17 00:00:00 2001
From: Ferry Toth <ftoth at exalondelft.nl>
Date: Fri, 11 Jan 2019 16:00:58 +0100
Subject: [PATCH] [PATCH] coreutils: Fix build break with glibc 2.28

Exposed when building sumo on Ubuntu 18.10

Signed-off-by: Ferry Toth <ftoth at exalondelft.nl>
---
 .../coreutils/coreutils/sumo.patch            | 151 ++++++++++++++++++
 meta/recipes-core/coreutils/coreutils_8.29.bb |   1 +
 2 files changed, 152 insertions(+)
 create mode 100755 meta/recipes-core/coreutils/coreutils/sumo.patch
 mode change 100644 => 100755 meta/recipes-core/coreutils/coreutils_8.29.bb

diff --git a/meta/recipes-core/coreutils/coreutils/sumo.patch b/meta/recipes-core/coreutils/coreutils/sumo.patch
new file mode 100755
index 0000000000..03cf3c1b52
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils/sumo.patch
@@ -0,0 +1,151 @@
+diff -ur coreutils-8.29/lib/fflush.c coreutils-8.29-mod/lib/fflush.c
+--- coreutils-8.29/lib/fflush.c	2019-01-11 15:10:49.792047031 +0100
++++ coreutils-8.29-mod/lib/fflush.c	2019-01-11 15:51:18.831796152 +0100
+@@ -33,7 +33,7 @@
+ #undef fflush
+ 
+ 
+-#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 */
+ 
+ /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
+ static void
+@@ -72,7 +72,7 @@
+ 
+ #endif
+ 
+-#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 */)
+ 
+ # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+@@ -148,7 +148,7 @@
+   if (stream == NULL || ! freading (stream))
+     return fflush (stream);
+ 
+-#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 */
+ 
+   clear_ungetc_buffer_preserving_position (stream);
+ 
+diff -ur coreutils-8.29/lib/fpending.c coreutils-8.29-mod/lib/fpending.c
+--- coreutils-8.29/lib/fpending.c	2019-01-11 15:10:50.711269845 +0100
++++ coreutils-8.29-mod/lib/fpending.c	2019-01-11 15:50:11.153232743 +0100
+@@ -32,7 +32,7 @@
+   /* 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 */
+   return fp->_IO_write_ptr - fp->_IO_write_base;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+diff -ur coreutils-8.29/lib/fpurge.c coreutils-8.29-mod/lib/fpurge.c
+--- coreutils-8.29/lib/fpurge.c	2019-01-11 15:10:56.699812540 +0100
++++ coreutils-8.29-mod/lib/fpurge.c	2019-01-11 15:50:12.552242461 +0100
+@@ -62,7 +62,7 @@
+   /* 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->_IO_read_end = fp->_IO_read_ptr;
+   fp->_IO_write_ptr = fp->_IO_write_base;
+   /* Avoid memory leak when there is an active ungetc buffer.  */
+diff -ur coreutils-8.29/lib/freadahead.c coreutils-8.29-mod/lib/freadahead.c
+--- coreutils-8.29/lib/freadahead.c	2019-01-11 15:11:03.301249088 +0100
++++ coreutils-8.29-mod/lib/freadahead.c	2019-01-11 15:50:13.826993749 +0100
+@@ -30,7 +30,7 @@
+ size_t
+ freadahead (FILE *fp)
+ {
+-#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 */
+   if (fp->_IO_write_ptr > fp->_IO_write_base)
+     return 0;
+   return (fp->_IO_read_end - fp->_IO_read_ptr)
+diff -ur coreutils-8.29/lib/freading.c coreutils-8.29-mod/lib/freading.c
+--- coreutils-8.29/lib/freading.c	2019-01-11 15:11:02.812511550 +0100
++++ coreutils-8.29-mod/lib/freading.c	2019-01-11 15:50:21.392772123 +0100
+@@ -31,7 +31,7 @@
+   /* 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 */
+   return ((fp->_flags & _IO_NO_WRITES) != 0
+           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
+               && fp->_IO_read_base != NULL));
+diff -ur coreutils-8.29/lib/freadptr.c coreutils-8.29-mod/lib/freadptr.c
+--- coreutils-8.29/lib/freadptr.c	2019-01-11 15:10:56.059010089 +0100
++++ coreutils-8.29-mod/lib/freadptr.c	2019-01-11 14:49:54.293455980 +0100
+@@ -29,7 +29,7 @@
+   size_t size;
+ 
+   /* Keep this code in sync with freadahead!  */
+-#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 */
+   if (fp->_IO_write_ptr > fp->_IO_write_base)
+     return NULL;
+   size = fp->_IO_read_end - fp->_IO_read_ptr;
+diff -ur coreutils-8.29/lib/freadseek.c coreutils-8.29-mod/lib/freadseek.c
+--- coreutils-8.29/lib/freadseek.c	2019-01-11 15:10:50.220888727 +0100
++++ coreutils-8.29-mod/lib/freadseek.c	2019-01-11 15:49:01.170630156 +0100
+@@ -36,7 +36,7 @@
+   /* Keep this code in sync with freadptr!  */
+ #if HAVE___FREADPTRINC              /* musl libc */
+   __freadptrinc (fp, increment);
+-#elif defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#elif defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   fp->_IO_read_ptr += increment;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+diff -ur coreutils-8.29/lib/fseeko.c coreutils-8.29-mod/lib/fseeko.c
+--- coreutils-8.29/lib/fseeko.c	2019-01-11 15:10:56.840171355 +0100
++++ coreutils-8.29-mod/lib/fseeko.c	2019-01-11 15:51:28.260424120 +0100
+@@ -47,7 +47,7 @@
+ #endif
+ 
+   /* These tests are based on fpurge.c.  */
+-#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 */
+   if (fp->_IO_read_end == fp->_IO_read_ptr
+       && fp->_IO_write_ptr == fp->_IO_write_base
+       && fp->_IO_save_base == NULL)
+@@ -123,7 +123,7 @@
+           return -1;
+         }
+ 
+-#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_EOF_SEEN;
+       fp->_offset = pos;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+diff -ur coreutils-8.29/lib/fseterr.c coreutils-8.29-mod/lib/fseterr.c
+--- coreutils-8.29/lib/fseterr.c	2019-01-11 15:10:55.996374096 +0100
++++ coreutils-8.29-mod/lib/fseterr.c	2019-01-11 14:49:54.268664903 +0100
+@@ -29,7 +29,7 @@
+   /* 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__ || defined __ANDROID__
+   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+diff -ur coreutils-8.29/lib/stdio-impl.h coreutils-8.29-mod/lib/stdio-impl.h
+--- coreutils-8.29/lib/stdio-impl.h	2019-01-11 15:11:01.851395400 +0100
++++ coreutils-8.29-mod/lib/stdio-impl.h	2019-01-11 15:38:43.268798497 +0100
+@@ -18,6 +18,12 @@
+    the same implementation of stdio extension API, except that some fields
+    have different naming conventions, or their access requires some casts.  */
+ 
++/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
++   problem by defining it ourselves.  FIXME: Do not rely on glibc
++   internals.  */
++#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
++# define _IO_IN_BACKUP 0x100
++#endif
+ 
+ /* BSD stdio derived implementations.  */
+ 
diff --git a/meta/recipes-core/coreutils/coreutils_8.29.bb b/meta/recipes-core/coreutils/coreutils_8.29.bb
old mode 100644
new mode 100755
index b0572afdc0..d525b3c3b4
--- a/meta/recipes-core/coreutils/coreutils_8.29.bb
+++ b/meta/recipes-core/coreutils/coreutils_8.29.bb
@@ -21,6 +21,7 @@ SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \
            file://0001-local.mk-fix-cross-compiling-problem.patch \
            file://CVE-2017-18018-1.patch \
            file://CVE-2017-18018-2.patch \
+           file://sumo.patch \
           "
 
 SRC_URI[md5sum] = "960cfe75a42c9907c71439f8eb436303"
-- 
2.19.1


More information about the Openembedded-core mailing list