Compilation Errors with musl libc

Hi, I’m using Alpine Linux, which doesn’t use the GNU C library. Instead it uses musl. These compilation errors appear:

  • /home/user/blender-2.83.1/intern/guardedalloc/intern/mallocn_guarded_impl.c:825:3: error: implicit declaration of function 'malloc_stats' [-Werror=implicit-function-declaration]
    Fixed by removing #define HAVE_MALLOC_STATS in line 46 in mallocn_intern.h
  • /home/user/blender-2.83.1/intern/libc_compat/libc_compat.c:28:48: error: missing binary operator befor token "("
    Fixed by removing #if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 31) and #endif at the end of the file
  • /home/user/blender-2.83.1/source/blender/blenlib/intern/system.c:41:12: fatal error: execinfo.h: No such file or directory
    Fixed by removing #include <execinfo.h> and emptying the void BLI_system_backtrace(FILE *fp) function
  • /home/user/blender-2.83.1/source/creator/creator_signals.c:336:3: error: implicit declaration of function 'feenableexcept'; did you mean 'feraiseexcept'? [-Werror=implicit-function-declaration]
    Fixed by following the advise from the compiler
  • /usr/bin/ld: ../../lib/libbf_intern_ghost.a(GHOST_SystemX11.cpp.o): undefined reference to symbol 'XConvertSelection'
    /usr/bin/ld: /usr/lib/libX11.so: error adding symbols: DSO missing from command line
    I haven’t figured this out yet. libX11.so is properly installed. I assume that something went wrong in the cmake configuration but I can’t tell what.
    One thing that stuck out to me, was that it diplayed -- Found X11: /usr/include, but I don’t know how to fix that

Should I create a Bug Report?

1 Like

Hi, @sergey fixed a lot of build errors on OSX today, may be he miss this one.
https://developer.blender.org/rBf2175e06a7455be6ec5affa42444cfae1d9c1726 for example.
Are you up to date with your source?
Build errors are not bugs and not welcome to the bug tracker.
May you wait for some time until a developer steps by.

Cheers, mib

We wouldn’t really consider these bugs, it’s just a platform we don’t officially support so far.

Patches to make it work are welcome though:
https://developer.blender.org/differential/diff/create/

I’ve just tried to build blender with the newest source. All the errors I described above are still there

Ah, I am sorry, overlook you are on Alpine Linux.

Cheers, mib