Unable to compile with ARM( or Linaro) aarch64 toolchain version 11
I can't build mesa for aarch64 using ARM-toolchain 11 (gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu) or similar Linaro toolchain (gcc-linaro-11.2.1-2022.02-x86_64_aarch64-linux-gnu). The is the same in both cases, see below.
The Meson build system
Version: 0.61.4
Source dir: /home/sergey/Projects/orpaltech/mesa
Build dir: /home/sergey/Projects/orpaltech/mesa/build/aarch64-linux-gnu-lima
Build type: cross build
Program python3 found: YES (/usr/bin/python3)
Project name: mesa
Project version: 22.0.1
C compiler for the host machine: /home/sergey/Projects/armlinux/toolchains/linaro/11/aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc (gcc 11.2.1 "aarch64-linux-gnu-gcc (GCC) 11.2.1 20220205 [releases/gcc-11 revision 202be9f69a5887c7263598daf5c68a16aec06148]")
C linker for the host machine: /home/sergey/Projects/armlinux/toolchains/linaro/11/aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc ld.bfd 2.37.20220122
C++ compiler for the host machine: /home/sergey/Projects/armlinux/toolchains/linaro/11/aarch64-linux-gnu/bin/aarch64-linux-gnu-g++ (gcc 11.2.1 "aarch64-linux-gnu-g++ (GCC) 11.2.1 20220205 [releases/gcc-11 revision 202be9f69a5887c7263598daf5c68a16aec06148]")
C++ linker for the host machine: /home/sergey/Projects/armlinux/toolchains/linaro/11/aarch64-linux-gnu/bin/aarch64-linux-gnu-g++ ld.bfd 2.37.20220122
C compiler for the build machine: cc (gcc 11.1.0 "cc (Ubuntu 11.1.0-1ubuntu1~20.04) 11.1.0")
C linker for the build machine: cc ld.bfd 2.36.1
C++ compiler for the build machine: c++ (gcc 11.1.0 "c++ (Ubuntu 11.1.0-1ubuntu1~20.04) 11.1.0")
C++ linker for the build machine: c++ ld.bfd 2.36.1
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: aarch64
Host machine cpu: armv8-a
Target machine cpu family: aarch64
Target machine cpu: armv8-a
Checking if "-mtls-dialect=gnu2" runs: DID NOT COMPILE
Program python3 found: YES (/usr/bin/python3)
Fetching value of define "ETIME" : 62
Checking for function "bswap32" : YES
Checking for function "bswap64" : YES
Checking for function "clz" : YES
Checking for function "clzll" : YES
Checking for function "ctz" : YES
Checking for function "expect" : YES
Checking for function "ffs" : YES
Checking for function "ffsll" : YES
Checking for function "popcount" : YES
Checking for function "popcountll" : YES
Checking for function "unreachable" : YES
Checking for function "types_compatible_p" : YES
Compiler for C supports function attribute const: YES
Compiler for C supports function attribute flatten: YES
Compiler for C supports function attribute malloc: YES
Compiler for C supports function attribute pure: YES
Compiler for C supports function attribute unused: YES
Compiler for C supports function attribute warn_unused_result: YES
Compiler for C supports function attribute weak: YES
Compiler for C supports function attribute format: YES
Compiler for C supports function attribute packed: YES
Compiler for C supports function attribute returns_nonnull: YES
Compiler for C supports function attribute alias: YES
Compiler for C supports function attribute noreturn: YES
Compiler for C supports function attribute visibility:hidden: YES
Checking if "__uint128_t" compiles: YES
Compiler for C supports link arguments -Wl,--gc-sections: YES
Compiler for C supports arguments -Werror=implicit-function-declaration: YES
Compiler for C supports arguments -Werror=missing-prototypes: YES
Compiler for C supports arguments -Werror=return-type: YES
Compiler for C supports arguments -Werror=empty-body: YES
Compiler for C supports arguments -Werror=incompatible-pointer-types: YES
Compiler for C supports arguments -Werror=int-conversion: YES
Compiler for C supports arguments -Wimplicit-fallthrough: YES
Compiler for C supports arguments -Wno-missing-field-initializers: YES
Compiler for C supports arguments -Wno-format-truncation: YES
Compiler for C supports arguments -fno-math-errno: YES
Compiler for C supports arguments -fno-trapping-math: YES
Compiler for C supports arguments -Qunused-arguments: NO
Compiler for C supports arguments -fno-common: YES
Compiler for C supports arguments -Wno-microsoft-enum-value: NO
Compiler for C supports arguments -Werror=format: YES
Compiler for C supports arguments -Wformat-security: YES
Compiler for C supports arguments -Werror=thread-safety: NO
Compiler for C supports arguments -ffunction-sections: YES
Compiler for C supports arguments -fdata-sections: YES
Compiler for C++ supports arguments -Werror=return-type: YES
Compiler for C++ supports arguments -Werror=empty-body: YES
Compiler for C++ supports arguments -Wno-non-virtual-dtor: YES
Compiler for C++ supports arguments -Wno-missing-field-initializers: YES
Compiler for C++ supports arguments -Wno-format-truncation: YES
Compiler for C++ supports arguments -fno-math-errno: YES
Compiler for C++ supports arguments -fno-trap``ping-math: YES
Compiler for C++ supports arguments -Qunused-arguments: NO
Compiler for C++ supports arguments -flifetime-dse=1: YES
Compiler for C++ supports arguments -Wno-microsoft-enum-value: NO
Compiler for C++ supports arguments -Werror=format: YES
Compiler for C++ supports arguments -Wformat-security: YES
Compiler for C++ supports arguments -ffunction-sections: YES
Compiler for C++ supports arguments -fdata-sections: YES
Compiler for C supports arguments -Wno-override-init: YES
Compiler for C supports arguments -Wno-initializer-overrides: NO
Compiler for C supports arguments -Werror=pointer-arith: YES
Compiler for C supports arguments -Werror=gnu-empty-initializer: NO
Compiler for C++ supports arguments -Werror=pointer-arith: YES
Compiler for C++ supports arguments -Werror=gnu-empty-initializer: NO
Checking if "GCC atomic builtins" compiles: YES
Checking if "GCC atomic builtins required -latomic" : links: YES
Checking if "GCC 64bit atomics" with dependency : links: YES
Library ws2_32 found: NO
Header <sys/sysmacros.h> has symbol "major" : YES
Header <sys/sysmacros.h> has symbol "minor" : YES
Header <sys/sysmacros.h> has symbol "makedev" : YES
Header <sys/mkdev.h> has symbol "major" : NO
Check usable header "sched.h" : YES
Checking for function "sched_getaffinity" : YES
Check usable header "xlocale.h" : NO
Check usable header "linux/futex.h" : YES ``
Check usable header "endian.h" : YES
Check usable header "dlfcn.h" : YES
Check usable header "sys/shm.h" : YES
Check usable header "cet.h" : NO
Check usable header "pthread_np.h" : NO
Checking for function "strtof" : YES
Checking for function "mkostemp" : YES
Checking for function "timespec_get" : YES
Checking for function "memfd_create" : YES
Checking for function "random_r" : YES
Checking for function "flock" : YES
Checking for function "strtok_r" : YES
Checking for function "getrandom" : YES
Checking for function "qsort_r" : YES
Checking for function "qsort_s" : NO
Header <errno.h> has symbol "program_invocation_name" : YES
Checking for function "posix_memalign" : YES
Checking whether type "struct dirent" has member "d_type" : YES
Checking if "strtod has locale support" : links: YES
Checking if "Bsymbolic" : links: YES
Checking if "gc-sections" : links: YES
Checking if "version-script" : links: YES
Checking if "dynamic-list" : links: YES
Compiler for C supports link arguments -Wl,--build-id=sha1: YES
Checking for function "dlopen" : YES
Checking for function "dladdr" with dependency : YES
Checking for function "dl_iterate_phdr" : YES
Checking for function "clock_gettime" : YES
Found pkg-config: /home/sergey/Projects/orpaltech/mesa/build/aarch64-linux-gnu-lima/cross-pkg-config.sh (0.29.1)
Run-time dependency zlib found: YES 1.2.11
Run-time dependency libzstd found: YES 1.5.2
Run-time dependency threads found: YES
Checking for function "pthread_setaffinity_np" with dependency threads: YES
Run-time dependency expat found: YES 2.4.8
Library m found: YES
Run-time dependency libdrm found: YES 2.4.110
Run-time dependency libudev found: YES 250
Run-time dependency valgrind found: NO (tried pkgconfig)
Program bison found: YES (/usr/bin/bison)
Program bison found: YES 3.5.1 (/usr/bin/bison)
Program flex found: YES (/usr/bin/flex)
Library sensors found: NO
Program nm found: YES
Program symbols-check.py found: YES (/usr/bin/python3 /home/sergey/Projects/orpaltech/mesa/bin/symbols-check.py)
Program install_megadrivers.py found: YES (/usr/bin/python3 /home/sergey/Projects/orpaltech/mesa/bin/install_megadrivers.py)
WARNING: Library target 'GLESv1_CM' has 'name_prefix' set. Compilers may not find it from its '-lGLESv1_CM' linker flag in the 'glesv1_cm.pc' pkg-config file.
WARNING: Library target 'GLESv1_CM' has 'name_prefix' set. Compilers may not find it from its '-lGLESv1_CM' linker flag in the 'glesv1_cm-uninstalled.pc' pkg-config file.
WARNING: Library target 'GLESv2' has 'name_prefix' set. Compilers may not find it from its '-lGLESv2' linker flag in the 'glesv2.pc' pkg-config file.
WARNING: Library target 'GLESv2' has 'name_prefix' set. Compilers may not find it from its '-lGLESv2' linker flag in the 'glesv2-uninstalled.pc' pkg-config file.
Program decode.py found: YES (/home/sergey/Projects/orpaltech/mesa/src/compiler/isaspec/decode.py)
Program encode.py found: YES (/home/sergey/Projects/orpaltech/mesa/src/compiler/isaspec/encode.py)
Checking for function "mincore" : YES
WARNING: Library target 'EGL' has 'name_prefix' set. Compilers may not find it from its '-lEGL' linker flag in the 'egl.pc' pkg-config file.
WARNING: Library target 'EGL' has 'name_prefix' set. Compilers may not find it from its '-lEGL' linker flag in the 'egl-uninstalled.pc' pkg-config file.
Message: Configuration summary:
prefix: /usr
libdir: lib
includedir: include
OpenGL: yes (ES1: yes ES2: yes)
OSMesa: no
DRI platform: drm
DRI drivers: no
DRI driver dir: /usr/lib/dri
EGL: yes
EGL drivers: builtin:egl_dri2 builtin:egl_dri3
EGL/Vulkan/VL platforms: surfaceless drm
GBM: yes
GBM backends path: /usr/lib/gbm
Vulkan drivers: no
llvm: no
Gallium drivers: lima kmsro
Gallium st: mesa
HUD lmsensors: no
Shared-glapi: yes
Perfetto: no
Perfetto ds: auto
Build targets in project: 127
NOTICE: Future-deprecated features used:
* 0.55.0: {'ExternalProgram.path', 'meson.has_exe_wrapper'}
* 0.56.0: {'meson.source_root'}
mesa 22.0.1
User defined options
Cross files : meson-cross-file.ini
backend : ninja
errorlogs : True
prefix : /usr
dri-drivers :
egl : enabled
gallium-drivers: lima,kmsro
gallium-vdpau : disabled
gbm : enabled
gles2 : enabled
glx : disabled
libunwind : disabled
llvm : disabled
platforms :
vulkan-drivers :
Found ninja-1.10.0 at /usr/bin/ninja Making Mesa...
FAILED: src/util/libmesa_util.a.p/u_printf.cpp.o
/home/sergey/Projects/armlinux/toolchains/linaro/11/aarch64-linux-gnu/bin/aarch64-linux-gnu-g++ -Isrc/util/libmesa_util.a.p -Isrc/util -I../../src/util -Iinclude -I../../include -Isrc -I../../src -Isrc/mapi -I../../src/mapi -Isrc/mesa -I../../src/mesa -I../../src/gallium/include -Isrc/gallium/auxiliary -I../../src/gallium/auxiliary -I/home/sergey/Projects/orpaltech/mesa/include/c11 -I/home/sergey/Projects/orpaltech/boards/nanopi-a64/sysroot/usr/include -I/home/sergey/Projects/orpaltech/boards/nanopi-a64/sysroot/usr/include/aarch64-linux-gnu -fvisibility=hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++14 -O2 -g -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="22.0.1"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"' -DHAVE_SURFACELESS_PLATFORM -DHAVE_DRM_PLATFORM -DUSE_ELF_TLS -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DEGL_NO_X11 -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___BUILTIN_TYPES_COMPATIBLE_P -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 -DHAVE_UINT128 -D_GNU_SOURCE -DUSE_GCC_ATOMIC_BUILTINS -DUSE_AARCH64_ASM -DMAJOR_IN_SYSMACROS -DHAS_SCHED_H -DHAS_SCHED_GETAFFINITY -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_RANDOM_R -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_GETRANDOM -DHAVE_QSORT_R -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_COMPRESSION -DHAVE_PTHREAD -DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DHAVE_LIBUDEV -DMESA_EXECMEM -DVK_USE_PLATFORM_DISPLAY_KHR -Werror=return-type -Werror=empty-body -Wno-non-virtual-dtor -Wno-missing-field-initializers -Wno-format-truncation -fno-math-errno -fno-trapping-math -flifetime-dse=1 -Werror=format -Wformat-security -ffunction-sections -fdata-sections -std=c++17 -fPIC -pthread -MD -MQ src/util/libmesa_util.a.p/u_printf.cpp.o -MF src/util/libmesa_util.a.p/u_printf.cpp.o.d -o src/util/libmesa_util.a.p/u_printf.cpp.o -c ../../src/util/u_printf.cpp
In file included from /home/sergey/Projects/armlinux/toolchains/linaro/11/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/11.2.1/cstdlib:75,
from /home/sergey/Projects/armlinux/toolchains/linaro/11/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/11.2.1/ext/string_conversions.h:41,
from /home/sergey/Projects/armlinux/toolchains/linaro/11/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/11.2.1/bits/basic_string.h:6608,
from /home/sergey/Projects/armlinux/toolchains/linaro/11/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/11.2.1/string:55,
from ../../src/util/u_printf.h:27,
from ../../src/util/u_printf.cpp:24:
/home/sergey/Projects/armlinux/toolchains/linaro/11/aarch64-linux-gnu/aarch64-linux-gnu/libc/usr/include/stdlib.h:565:5: error: expected initializer before ‘__attr_dealloc_free’
565 | __attr_dealloc_free;
| ^~~~~~~~~~~~~~~~~~~
/home/sergey/Projects/armlinux/toolchains/linaro/11/aarch64-linux-gnu/aarch64-linux-gnu/libc/usr/include/stdlib.h:569:14: error: expected initializer before ‘__attr_dealloc’
569 | __THROW __attr_dealloc (reallocarray, 1);
| ^~~~~~~~~~~~~~
In file included from /home/sergey/Projects/armlinux/toolchains/linaro/11/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/11.2.1/cstdlib:75,
from /home/sergey/Projects/armlinux/toolchains/linaro/11/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/11.2.1/ext/string_conversions.h:41,
from /home/sergey/Projects/armlinux/toolchains/linaro/11/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/11.2.1/bits/basic_string.h:6608,
from /home/sergey/Projects/armlinux/toolchains/linaro/11/aarch64-linux-gnu/aarch64-linux-gnu/include/c++/11.2.1/string:55,
from ../../src/util/u_printf.h:27,
from ../../src/util/u_printf.cpp:24:
/home/sergey/Projects/armlinux/toolchains/linaro/11/aarch64-linux-gnu/aarch64-linux-gnu/libc/usr/include/stdlib.h:797:6: error: expected initializer before ‘__attr_dealloc_free’
797 | __attr_dealloc_free __wur;
| ^~~~~~~~~~~~~~~~~~~