Skip to contentSkip to conversation

sharutils: Build error

meta-oe [email protected] 2 participants 2 messages Apr 26, 2023

lore
Share & tools
lore
#0 lore raw

Hi, I found a bug when building sharutils-native:

Quoted 10 lines

| ../../sharutils-4.15.2/lib/fseeko.c: In function ‘rpl_fseeko’:
| ../../sharutils-4.15.2/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."
|   110 |   #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."

|       |    ^~~~~
| make[4]: *** [Makefile:1598: fseeko.o] Error 1

The bug is known and there are patches available in Debian and other distributions.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=915173

Looking at the patch that is used in debian, it states it was introduced in debian with glibc 2.28.

I saw this bug in mickledore, but also in honister, which makes sense since honister uses glibc 2.34.
The strange thing is more that it seemed to work in my honister setup before. I lately updated the build machine from Ubuntu 18.04 to Ubuntu 22.04. Then, the build still worked, but after deleting the sstate cache, it did not build again and failed with the error above. So, seemingly, somehow it seemed to build before with the same meta data. So one question is why it actually worked before. My best guess is somehow that the host glibc might have been taken into the build, since Ubuntu 18.04 uses glibc 2.27, but as said, that is only a guess.

Looking forward, I testet two different strategies that both seemed to work:

1) Adding a pre-configure step
Inspired by https://www.linuxfromscratch.org/blfs/view/svn/general/sharutils.html, I added the following lines to the bb file:

Quoted 8 lines

do_configure:prepend() {
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' ${WORKDIR}/${BPN}-${PV}/lib/*.c &&
echo "#define _IO_IN_BACKUP 0x100" >> ${WORKDIR}/${BPN}-${PV}/lib/stdio-impl.h &&
}

2) Adding the debian patch
As a better option, I added the patch from debian to the recipe in my setup and it built as well with that. The patch can be found here: https://sources.debian.org/patches/sharutils/1:4.15.2-5/02-fix-ftbfs-with-glibc-2.28.patch/

The second option seems like a good solution, but I think it should be reproduced and verified by someone else as well. Also, I don't have knowledge regarding licenses etc when it comes to posting patches from other distros to OE, so it would be nice if someone else could port the patch to OE.

#1 lore raw
Quoted 1 line · dev via lists.openembedded.org

The strange thing is more that it seemed to work in my honister setup before. I lately updated the build machine from Ubuntu 18.04 to Ubuntu 22.04. Then, the build still worked, but after deleting the sstate cache, it did not build again and failed with the error above. So, seemingly, somehow it seemed to build before with the same meta data. So one question is why it actually worked before. My best guess is somehow that the host glibc might have been taken into the build, since Ubuntu 18.04 uses glibc 2.27, but as said, that is only a guess.

That’s a native recipe so the host glibc is the relevant glibc, the target glibc isn’t relevant.

Quoted 11 lines

Looking forward, I testet two different strategies that both seemed to work:
1) Adding a pre-configure step
Inspired by https://www.linuxfromscratch.org/blfs/view/svn/general/sharutils.html, I added the following lines to the bb file:

  do_configure:prepend() {
    sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' ${WORKDIR}/${BPN}-${PV}/lib/*.c        &&
    echo "#define _IO_IN_BACKUP 0x100" >> ${WORKDIR}/${BPN}-${PV}/lib/stdio-impl.h &&
}

2) Adding the debian patch
As a better option, I added the patch from debian to the recipe in my setup and it built as well with that.
The patch can be found here: https://sources.debian.org/patches/sharutils/1:4.15.2-5/02-fix-ftbfs-with-glibc-2.28.patch/
The second option seems like a good solution, but I think it should be reproduced and verified by someone else as well. Also, I don't have knowledge regarding licenses etc when it comes to posting patches from other distros to OE, so it would be nice if someone else could port the patch to OE.

Adding the patch is the best solution. The patch is basically a change in gnulib that needs to be synced into the (apparently now unmaintained) sharutils, so the license isn’t a concern.

Ross