New comment by pullmoll on void-packages repository https://github.com/void-linux/void-packages/issues/26811#issuecomment-735856513 Comment: One observation which I think it is already known: trying to cross compile `mesa` from `glibc` to `musl` fails because host flags are leaking into the target w/ `ninja`: ``` Found ninja-1.10.1 at /usr/bin/ninja => mesa-20.2.3_1: running post_configure ... => mesa-20.2.3_1: running pre-build hook: 02-script-wrapper ... => mesa-20.2.3_1: running do_build ... ninja: Entering directory `build' ninja: error: '/usr/armv7l-linux-musleabihf/usr/lib/libm-2.30.so', needed by 'src/amd/vulkan/libvulkan_radeon.so', missing and no known rule to make it ``` Trying to build it in an `i686-musl` environment I get this: ``` [319/2314] Compiling C object src/freedreno/common/libfreedreno_common.a.p/freedreno_uuid.c.o FAILED: src/freedreno/common/libfreedreno_common.a.p/freedreno_uuid.c.o armv7l-linux-musleabihf-gcc -Isrc/freedreno/common/libfreedreno_common.a.p -Isrc/freedreno/common -I../src/freedreno/common -Isrc/freedreno -I../src/freedreno -Isrc/freedreno/registers -I../src/freedreno/registers -Isrc/freedreno/registers/adreno -I../src/freedreno/registers/adreno -Iinclude -I../include -Isrc -I../src -I../src/gallium/include -Isrc/util -I../src/util -I/usr/armv7l-linux-musleabihf/usr/include -fvisibility=hidden -fdiagnostics-color=always -DNDEBUG -pipe -D_FILE_OFFSET_BITS=64 -std=c99 -Wl,--gc-sections -ffunction-sections -fdata-sections -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="20.2.3"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"' -DHAVE_ST_VDPAU -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DHAVE_X11_PLATFORM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DHAVE_DRM_PLATFORM -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -D_GNU_SOURCE -DUSE_GCC_ATOMIC_BUILTINS -DUSE_ARM_ASM -DMAJOR_IN_SYSMACROS -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_SYS_SHM_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_GETRANDOM -DHAVE_PROGRAM_INVOCATION_NAME -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_ZSTD -DHAVE_PTHREAD -DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DLLVM_AVAILABLE '-DMESA_LLVM_VERSION_STRING="11.0.0"' -DLLVM_IS_SHARED=1 -DUSE_LIBGLVND=1 -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -DHAVE_LIBSENSORS=1 -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=empty-body -Werror=incompatible-pointer-types -Werror=int-conversion -Wimplicit-fallthrough -Wno-missing-field-initializers -Wno-format-truncation -fno-math-errno -fno-trapping-math -fno-common -Werror=format -Wformat-security -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard -g -fPIC -pthread -Wno-override-init -MD -MQ src/freedreno/common/libfreedreno_common.a.p/freedreno_uuid.c.o -MF src/freedreno/common/libfreedreno_common.a.p/freedreno_uuid.c.o.d -o src/freedreno/common/libfreedreno_common.a.p/freedreno_uuid.c.o -c ../src/freedreno/common/freedreno_uuid.c ../src/freedreno/common/freedreno_uuid.c:30:10: fatal error: git_sha1.h: No such file or directory 30 | #include "git_sha1.h" | ^~~~~~~~~~~~ compilation terminated. ``` So it looks like I need to resort to using `x86_64-musl` to build `mesa` for `armv7l-musl`.