build of erofs-utils 1.8.6 fails with musl libc

Milan P. Stanić mps at arvanta.net
Tue May 6 22:11:02 AEST 2025


Hi,

I'm maintainer of erofs-utils for Alpine linux, distribution which use
musl libc instead of glibc.

Building version 1.8.6 gives error:
------------------
Making all in contrib
make[2]: Entering directory '/home/mps/aports/community/erofs-utils/src/erofs-utils-1.8.6/contrib'
cc -DHAVE_CONFIG_H -I. -I..   -DNDEBUG -Wall -I../include -Os -fstack-clash-protection -Wformat -Werror=format-security -fno-plt -MT stress-stress.o -MD -MP -MF .deps/stress-stress.Tpo -c -o stress-stress.o `test -f 'stress.c' || echo './'`stress.c
stress.c: In function '__getdents_f':
stress.c:274:16: error: implicit declaration of function 'readdir64'; did you mean 'readdir_r'? [-Wimplicit-function-declaration]
  274 |         while (readdir64(dir) != NULL)
      |                ^~~~~~~~~
      |                readdir_r
stress.c:274:31: warning: comparison between pointer and integer
  274 |         while (readdir64(dir) != NULL)
      |                               ^~
stress.c: In function '__read_f':
stress.c:431:17: error: implicit declaration of function 'pread64'; did you mean 'pread'? [-Wimplicit-function-declaration]
  431 |         nread = pread64(fe->fd, buf, len, off);
      |                 ^~~~~~~
      |                 pread
stress.c: In function 'read_f':
stress.c:480:15: error: implicit declaration of function 'lseek64'; did you mean 'lseek'? [-Wimplicit-function-declaration]
  480 |         fsz = lseek64(fe->fd, 0, SEEK_END);
      |               ^~~~~~~
      |               lseek
make[2]: *** [Makefile:420: stress-stress.o] Error 1
make[2]: Leaving directory '/home/mps/aports/community/erofs-utils/src/erofs-utils-1.8.6/contrib'
make[1]: *** [Makefile:447: all-recursive] Error 1
make[1]: Leaving directory '/home/mps/aports/community/erofs-utils/src/erofs-utils-1.8.6'
make: *** [Makefile:379: all] Error 2
>>> ERROR: erofs-utils: build failed
>>> erofs-utils: Uninstalling dependencies...
(1/19) Purging .makedepends-erofs-utils (20250506.063719)
------------------

This is because musl use readdir, pread and lseek instead of readdir64,
pread64 and lseek64.
(IMO musl does this properly)

Natanael Copa <ncopa at alpinelinux.org> created patch with which I build
erofs-utils successfully. I'm attaching patch to this mail.

Feel free to contact me if you more information or to try some new
patches.

-- 
Kind regards

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-read-pread-seek-64.patch
Type: text/x-diff
Size: 3413 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linux-erofs/attachments/20250506/ba0a28c9/attachment.patch>


More information about the Linux-erofs mailing list