https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116203
Bug ID: 116203 Summary: libsanitizer fails to build for aarch64 (14.2) with __NR_newfstatat was not declared in this scope Product: gcc Version: 14.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: rudi at heitbaum dot com CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org Target Milestone: --- Building libsanitizer with 14.2 fails on aarch64 (it worked with 14.1) builds on arm and x86_64 build correctly. The error being error: '__NR_newfstatat' was not declared in this scope libtool: compile: /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/.x86_64-linux-gnu/./gcc/xgcc -shared-libgcc -B/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/.x86_64-linux-gnu/./gcc -nostdinc++ -L/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/.x86_64-linux-gnu/aarch64-libreelec-linux-gnu/libstdc++-v3/src -L/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/.x86_64-linux-gnu/aarch64-libreelec-linux-gnu/libstdc++-v3/src/.libs -L/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/.x86_64-linux-gnu/aarch64-libreelec-linux-gnu/libstdc++-v3/libsupc++/.libs -B/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/toolchain/aarch64-libreelec-linux-gnu/bin/ -B/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/toolchain/aarch64-libreelec-linux-gnu/lib/ -isystem /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/toolchain/aarch64-libreelec-linux-gnu/include -isystem /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/toolchain/aarch64-libreelec-linux-gnu/sys-include -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DHAVE_RPC_XDR_H=0 -DHAVE_TIRPC_RPC_XDR_H=0 -DHAVE_AS_SYM_ASSIGN=1 -I. -I/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common -I.. -I /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/include -I /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer -isystem /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/include/system -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -I../../libstdc++-v3/include -I../../libstdc++-v3/include/aarch64-libreelec-linux-gnu -I/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/../libstdc++-v3/libsupc++ -std=gnu++14 -DSANITIZER_LIBBACKTRACE -DSANITIZER_CP_DEMANGLE -I /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/../libbacktrace -I ../libbacktrace -I /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/../include -include /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/libbacktrace/backtrace-rename.h -g -O2 -D_GNU_SOURCE -MT sanitizer_platform_limits_linux.lo -MD -MP -MF .deps/sanitizer_platform_limits_linux.Tpo -c /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cpp -fPIC -DPIC -o .libs/sanitizer_platform_limits_linux.o In file included from /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common/sanitizer_linux.cpp:194: /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common/sanitizer_linux.cpp: In function '__sanitizer::uptr __sanitizer::internal_stat(const char*, void*)': /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common/sanitizer_syscall_linux_aarch64.inc:13:23: error: '__NR_newfstatat' was not declared in this scope 13 | #define SYSCALL(name) __NR_ ## name | ^~~~~ /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common/sanitizer_syscall_linux_aarch64.inc:80:24: note: in definition of macro '__internal_syscall4' 80 | (__internal_syscall)(n, (u64)(a1), (long)(a2), (long)(a3), (long)(a4)) | ^ /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common/sanitizer_syscall_linux_aarch64.inc:127:31: note: in expansion of macro '__SYSCALL_DISP' 127 | #define internal_syscall(...) __SYSCALL_DISP(__internal_syscall, __VA_ARGS__) | ^~~~~~~~~~~~~~ /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common/sanitizer_linux.cpp:388:10: note: in expansion of macro 'internal_syscall' 388 | return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, | ^~~~~~~~~~~~~~~~ /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common/sanitizer_linux.cpp:388:27: note: in expansion of macro 'SYSCALL' 388 | return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, | ^~~~~~~ mv -f .deps/sanitizer_netbsd.Tpo .deps/sanitizer_netbsd.Plo /bin/dash ../libtool --tag=CXX --mode=compile /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/.x86_64-linux-gnu/./gcc/xgcc -shared-libgcc -B/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/.x86_64-linux-gnu/./gcc -nostdinc++ -L/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/.x86_64-linux-gnu/aarch64-libreelec-linux-gnu/libstdc++-v3/src -L/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/.x86_64-linux-gnu/aarch64-libreelec-linux-gnu/libstdc++-v3/src/.libs -L/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/.x86_64-linux-gnu/aarch64-libreelec-linux-gnu/libstdc++-v3/libsupc++/.libs -B/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/toolchain/aarch64-libreelec-linux-gnu/bin/ -B/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/toolchain/aarch64-libreelec-linux-gnu/lib/ -isystem /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/toolchain/aarch64-libreelec-linux-gnu/include -isystem /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/toolchain/aarch64-libreelec-linux-gnu/sys-include -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DHAVE_RPC_XDR_H=0 -DHAVE_TIRPC_RPC_XDR_H=0 -DHAVE_AS_SYM_ASSIGN=1 -I. -I/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common -I.. -I /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/include -I /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer -isystem /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/include/system -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -I../../libstdc++-v3/include -I../../libstdc++-v3/include/aarch64-libreelec-linux-gnu -I/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/../libstdc++-v3/libsupc++ -std=gnu++14 -DSANITIZER_LIBBACKTRACE -DSANITIZER_CP_DEMANGLE -I /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/../libbacktrace -I ../libbacktrace -I /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/../include -include /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/libbacktrace/backtrace-rename.h -g -O2 -D_GNU_SOURCE -MT sanitizer_platform_limits_openbsd.lo -MD -MP -MF .deps/sanitizer_platform_limits_openbsd.Tpo -c -o sanitizer_platform_limits_openbsd.lo /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_openbsd.cpp /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common/sanitizer_linux.cpp: In function '__sanitizer::uptr __sanitizer::internal_lstat(const char*, void*)': /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common/sanitizer_syscall_linux_aarch64.inc:13:23: error: '__NR_newfstatat' was not declared in this scope 13 | #define SYSCALL(name) __NR_ ## name | ^~~~~ /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common/sanitizer_syscall_linux_aarch64.inc:80:24: note: in definition of macro '__internal_syscall4' 80 | (__internal_syscall)(n, (u64)(a1), (long)(a2), (long)(a3), (long)(a4)) | ^ /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common/sanitizer_syscall_linux_aarch64.inc:127:31: note: in expansion of macro '__SYSCALL_DISP' 127 | #define internal_syscall(...) __SYSCALL_DISP(__internal_syscall, __VA_ARGS__) | ^~~~~~~~~~~~~~ /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common/sanitizer_linux.cpp:420:10: note: in expansion of macro 'internal_syscall' 420 | return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, | ^~~~~~~~~~~~~~~~ /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-A64.aarch64-13.0-devel/build/gcc-14.2.0/libsanitizer/sanitizer_common/sanitizer_linux.cpp:420:27: note: in expansion of macro 'SYSCALL' 420 | return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, | ^~~~~~~