Re: [dev] [ubase] compile using musl

From: Eric Pruitt <eric.pruitt_AT_gmail.com>
Date: Fri, 15 Mar 2024 13:52:33 -0700

On Fri, Mar 15, 2024 at 04:22:19PM -0300, Brian Mayer wrote:
> My guess is that glibc provides that function by musl doesn't. So as
> my system is using musl that function is not found. Can I get some
> help?

The splice(2) call is provided by musl:

    src/linux/splice.c:ssize_t splice(int fd_in, off_t *off_in, int fd_out, off_t *off_out, size_t len, unsigned flags)
    include/fcntl.h:ssize_t splice(int, off_t *, int, off_t *, size_t, unsigned);

What version of musl are you using? I don't get that compilation error
on my x86_64 desktop, but the build does fail to find makedev which
seems to be due to an issue with the header includes:

    ubase$ make -j1 CC=/home/ericpruitt/emus/core/musl-1.2.4/bin/musl-cc
    /home/ericpruitt/emus/core/musl-1.2.4/bin/musl-cc -s -o mknod mknod.o libutil.a -lcrypt
    /usr/bin/ld: mknod.o: in function `main':
    mknod.c:(.text+0x27d): undefined reference to `makedev'
    collect2: error: ld returned 1 exit status
    gmake: *** [Makefile:161: mknod] Error 1

The glibc documentation says makedev and related macros should be
included via <sys/sysmacros.h> which mknod.c does not use. I assume it
works on glibc because one of the explicitly mentioned headers itself
pulls in sysmacros.h. I would guess you're running into a similar issue.

Eric
Received on Fri Mar 15 2024 - 21:52:33 CET

This archive was generated by hypermail 2.3.0 : Mon Mar 18 2024 - 09:36:09 CET