Building blender with musl currently fails. Void Linux patch resolves the issue. Bug also filed at upstream URL. Reproducible: Always
https://github.com/void-linux/void-packages/blob/master/srcpkgs/blender/patches/musl.patch
Please provide the build.log of it failing if it's still an issue. But latest version of the patch: https://raw.githubusercontent.com/void-linux/void-packages/master/srcpkgs/blender/patches/0001-musl-fixes.patch
(In reply to Sam James from comment #2) > Please provide the build.log of it failing if it's still an issue. > > But latest version of the patch: > https://raw.githubusercontent.com/void-linux/void-packages/master/srcpkgs/ > blender/patches/0001-musl-fixes.patch We can try push this through upstream but I'd need a log first (or motivation to build it myself on musl) to verify the patch.
the __linux__ check is causing the issue. I was able to fix it with the following patch ```diff diff --git a/intern/guardedalloc/intern/mallocn_intern.h b/intern/guardedalloc/intern/mallocn_intern.h index f8b16ff..a5783d1 100644 --- a/intern/guardedalloc/intern/mallocn_intern.h +++ b/intern/guardedalloc/intern/mallocn_intern.h @@ -17,8 +17,7 @@ #undef HAVE_MALLOC_STATS #define USE_MALLOC_USABLE_SIZE /* internal, when we have malloc_usable_size() */ -#if defined(__linux__) || (defined(__FreeBSD_kernel__) && !defined(__FreeBSD__)) || \ - defined(__GLIBC__) +#if (defined(__FreeBSD_kernel__) && !defined(__FreeBSD__)) || defined(__GLIBC__) # include <malloc.h> # define HAVE_MALLOC_STATS #elif defined(__FreeBSD__) ```
Created attachment 799577 [details, diff] The __linux__ check is causing the HAVE_MALLOC_STATS to be evaluated as true
Looks like blender need some other patches too, for musl. I'll make a PR once ready
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07f1954e0dd0fb941be3396f15257793f791b23a commit 07f1954e0dd0fb941be3396f15257793f791b23a Author: brahmajit das <listout@protonmail.com> AuthorDate: 2022-08-23 15:39:17 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-09-01 02:01:54 +0000 media-gfx/blender: Upstream musl libc fixes backport These are some of the patch that I submitted upstream and have been accepted. They will be a part of next blender release. However, this PR is a backport of those fixes for blender 3.2.2. Please refer: https://github.com/blender/blender/commit/f197b1a1f1bbc0334310fb1c911327246767a1a3, and https://github.com/blender/blender/commit/7be7280c5710f7831789cdde140d010722be9068 Closes: https://bugs.gentoo.org/739474 Signed-off-by: brahmajit das <listout@protonmail.com> Closes: https://github.com/gentoo/gentoo/pull/26860 Signed-off-by: Sam James <sam@gentoo.org> media-gfx/blender/blender-3.2.2.ebuild | 5 + .../files/blender-3.2.2-musl-glibc-prereq.patch | 27 ++++ ...der-3.2.2-support-building-with-musl-libc.patch | 177 +++++++++++++++++++++ 3 files changed, 209 insertions(+)