trapexit / mergerfs

a featureful union filesystem
http://spawn.link
Other
4.21k stars 170 forks source link

cannot build 2.37.1 for musl libc, undefined reference to `malloc_trim' #1260

Closed pfpulux closed 11 months ago

pfpulux commented 12 months ago

Try to build release 2.37.1 for musl and it failed, see the build.log.

Build with the voidlinux build system ./xbps-src -a x86_64-musl pkg mergerfs. A build for glibc is ok.

Use this template:

pkgname=mergerfs
version=2.37.1
revision=1
build_style=gnu-makefile
make_use_env=yes
hostmakedepends="automake libtool pkg-config which"
makedepends="fuse-devel"
short_desc="FUSE union filesystem"
maintainer="Pulux <pulux@pf4sh.eu>"
license="ISC"
homepage="https://github.com/trapexit/mergerfs"
distfiles="https://github.com/trapexit/mergerfs/releases/download/${version}/mergerfs-${version}.tar.gz"
checksum=5cb93b628c28105f42dc7a06f24007a961e19d5e877e91a6ec87c1b7cc611443

pre_build() {
    # we build from source, spoof release tarball
    vsed -i "s|^VERSION=.*|VERSION=$pkgver|" tools/update-version
}

post_install() {
    vlicense LICENSE
}
trapexit commented 12 months ago

It has nothing to do with malloc_trim. You are reading logs from the build config stage.

The problem is muslc you are using doesn't have thread set name function. Newer versions do. My static builds are using it on alpine. What version is void using?

pfpulux commented 12 months ago

The version used by voidlinux is: musl-1.1.24

trapexit commented 12 months ago

Apparently that version is marked EOL. Oddly musl added pthread_getname_np only in 2021 but setname_np back in 2016. I guess I can write my own implementation for old versions of musl for the next release.