Ubuntu 18.10/glibc 2.28: Image build fails

I just set up a new virtual machine with Ubuntu 18.10, checked out the Linux 2.8b5 sources and tried to build it.

However I get the following error:

ERROR: m4-native-1.4.18-r0 do_compile: oe_runmake failed
ERROR: m4-native-1.4.18-r0 do_compile: Function failed: do_compile (log file is located at /home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/temp/log.do_compile.4802)
ERROR: Logfile of failure stored in: /home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/temp/log.do_compile.4802
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 4 infodir=/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr/share/info
| make  all-recursive
| make[1]: Entering directory '/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/build'
| Making all in .
| make[2]: Entering directory '/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/build'
| make[2]: Nothing to be done for 'all-am'.
| make[2]: Leaving directory '/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/build'
| Making all in examples
| make[2]: Entering directory '/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/build/examples'
| make[2]: Nothing to be done for 'all'.
| make[2]: Leaving directory '/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/build/examples'
| Making all in lib
| make[2]: Entering directory '/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/build/lib'
| make  all-am
| make[3]: Entering directory '/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/build/lib'
| gcc   -I. -I../../m4-1.4.18/lib   -isystem/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr/include  -isystem/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr/include -O2 -pipe -c -o freadahead.o ../../m4-1.4.18/lib/freadahead.c
| gcc   -I. -I../../m4-1.4.18/lib   -isystem/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr/include  -isystem/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr/include -O2 -pipe -c -o fseeko.o ../../m4-1.4.18/lib/fseeko.c
| gcc   -I. -I../../m4-1.4.18/lib   -isystem/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr/include  -isystem/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/recipe-sysroot-native/usr/include -O2 -pipe -c -o vasprintf.o ../../m4-1.4.18/lib/vasprintf.c
| rm -f t-charset.alias charset.alias && \
| /bin/bash ../../m4-1.4.18/lib/config.charset 'x86_64-pc-linux-gnu' > t-charset.alias && \
| mv t-charset.alias charset.alias
| rm -f t-ref-add.sed ref-add.sed && \
| sed -e '/^#/d' -e 's/@''PACKAGE''@/m4/g' ../../m4-1.4.18/lib/ref-add.sin > t-ref-add.sed && \
| mv t-ref-add.sed ref-add.sed
| rm -f t-ref-del.sed ref-del.sed && \
| sed -e '/^#/d' -e 's/@''PACKAGE''@/m4/g' ../../m4-1.4.18/lib/ref-del.sin > t-ref-del.sed && \
| mv t-ref-del.sed ref-del.sed
| ../../m4-1.4.18/lib/freadahead.c: In function ‘freadahead’:
| ../../m4-1.4.18/lib/freadahead.c:92:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
|   #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
|    ^~~~~
| ../../m4-1.4.18/lib/fseeko.c: In function ‘rpl_fseeko’:
| ../../m4-1.4.18/lib/fseeko.c:110:4: error: #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."
|    #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."
|     ^~~~~
| make[3]: *** [Makefile:1915: freadahead.o] Error 1
| make[3]: *** Waiting for unfinished jobs....
| make[3]: *** [Makefile:1915: fseeko.o] Error 1
| make[3]: Leaving directory '/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/build/lib'
| make[2]: *** [Makefile:1674: all] Error 2
| make[2]: Leaving directory '/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/build/lib'
| make[1]: *** [Makefile:1572: all-recursive] Error 1
| make[1]: Leaving directory '/home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/build'
| make: *** [Makefile:1528: all] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/christian/sources/oe-core/build/tmp-glibc/work/x86_64-linux/m4-native/1.4.18-r0/temp/log.do_compile.4802)
ERROR: Task (/home/christian/sources/oe-core/build/../layers/openembedded-core/meta/recipes-devtools/m4/m4-native_1.4.18.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 139 tasks of which 131 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory

According to a little google research, this problem is related to the new glibc 2.28 included in Ubuntu 18.10. I also tried it on a Ubuntu 18.04, where it works as expected.
The Toradex BSP 2.8b4 didn’t seem to have a problem with glibc 2.28 (but, as far as I remember, the first versions of BSP 2.8 had also problems)

Is there any way to fix this issue? (Preferably by Toradex with a new BSP release :D)

BR Christian

1 Like

hi @cheesi

Ubuntu 18.10 is not supported by Yocto, so please use any supported version

Is there any way to fix this issue? (Preferably by Toradex with a new BSP release :D)

Yeah, sure. Use one of supported distributions which are listed here.
Best regards, Jaski

Hi

While Jaski’s advise to use a supported distribution is sound, you might try building with uninative. If it really helps I do not know.

e.g. add the following to local.conf:

require conf/distro/include/yocto-uninative.inc

Note that this will likely rebuild everything.

Max

Thanks! Didn’t know about that.

This answer not solves the problem

Hi,

Try to use the following patch as a workaround:

https://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-devtools/m4/m4/m4-1.4.18-glibc-change-work-around.patch

The patch works for me.

Also, you can look at this issue: buildroot compilation fails with glibc-2.28 · Issue #74 · sifive/freedom-u-sdk · GitHub

Thanks for letting us know. However, as @jaski.tx pointed out building any Yocto Project version with a non approved distro is not adviced. BSP 3.0 will be based on Thud which of course will have all such fixes and lists such distro as approved.