directfb2 / DirectFB2

Core DirectFB library
GNU Lesser General Public License v2.1
132 stars 15 forks source link

musl-libc compatibility #57

Open nistvan86 opened 1 year ago

nistvan86 commented 1 year ago

Hi,

I'm trying to build DirectFB2 with musl-libc for embedded use, but it fails at various points complaining about types and definitions.

I've found some patches fixing similar issues in the Alpine aports repositories as well as on a mailing list related to buildroot. Applying these on DirectFB 1.7.7 makes it compliable with musl-libc, if I disable the gfxdrivers during configure. However, these patches are now incompatible with the DirectFB2 codebase.

An "official" support for musl-libc would be nice, if it's something you would keep on your roadmap.

caramelli commented 1 year ago

Completely agree that musl compatibility is important: I hope it's ok with this latest commit https://github.com/directfb2/DirectFB2/commit/85ee588f636d4836bdf7c1d0db47b74d4ec3827d I will try to test on my STM32MP1 board.

Thanks for reporting this issue!

nistvan86 commented 1 year ago

Thank you! Quick checking it, seems to be fine. But haven't run it on any actual hardware yet. I'm using a cross-rs Docker image for testing, and it seems to build just fine.

# docker run -it --rm ghcr.io/cross-rs/armv7-unknown-linux-musleabihf:main bash

apt install meson -y
scratch=$(mktemp -d)
pushd $scratch

git clone https://github.com/deniskropp/flux
pushd flux
./autogen.sh
./configure
make install
popd

git clone https://github.com/directfb2/DirectFB2
pushd DirectFB2
tee -a meson-armv7.txt <<EOF
[binaries]
c = 'arm-linux-musleabihf-gcc'
cpp = 'arm-linux-musleabihf-g++'
ar = 'arm-linux-musleabihf-ar'
strip = 'arm-linux-musleabihf-strip'
pkgconfig = 'arm-linux-musleabihf-pkg-config'
ld = 'arm-linux-musleabihf-ld'

[properties]
root = '/usr/local/arm-linux-musleabihf/'

[host_machine]
system = 'linux'
cpu_family = 'arm'
cpu = 'armv7' # Not sure if correct.
endian = 'little'
EOF

meson . build/ --cross-file meson-armv7.txt
ninja -C build install
popd

popd
rm -rf $scratch