Hi Max,
On Wed, May 15, 2024 at 6:38 PM Max Filippov <jcmvbkbc(a)gmail.com> wrote:
Hi Chris,
On Wed, May 15, 2024 at 09:02:27AM +1200, Chris Packham wrote:
(Max, Waldemar sorry for the duplicate. My
subscription to the list
seems to have been stuck in pending for ages so I grabbed your
addresses from the git repo)
I'm in the process of adding GCC14 to crosstool-ng. I've grabbed the
latest uClibc-ng tarball and the commits from master since the
release. I'm hitting the following build failure with an
arc-multilib-linux-uclibc configuration.
[ALL ] libc/sysdeps/linux/common/fstat64.c: In function 'fstat64':
[ERROR] libc/sysdeps/linux/common/fstat64.c:33:38: error: passing
argument 2 of '__syscall_fstat64' from incompatible pointer type
[-Wincompatible-pointer-types]
[ALL ] 33 | return __syscall_fstat64(fd, buf);
[ALL ] | ^~~
[ALL ] | |
[ALL ] | struct stat64 *
[ALL ] In file included from ./include/sys/syscall.h:34,
[ALL ] from libc/sysdeps/linux/common/fstat64.c:10:
[ALL ] libc/sysdeps/linux/common/fstat64.c:18:72: note: expected
'struct stat *' but argument is of type 'struct stat64 *'
[ALL ] 18 | int, filedes,
struct kernel_stat64 *, buf)
[ALL ] |
~~~~~~~~~~~~~~~~~~~~~~~~^~~
[ALL ] ./include/bits/syscalls-common.h:82:43: note: in
definition of macro 'C_DECL_ARGS_1'
[ALL ] 82 | #define C_DECL_ARGS_1(t, v) t v
[ALL ] | ^
[ALL ] ./include/bits/syscalls-common.h:98:11: note: in
expansion of macro 'C_DECL_ARGS_2'
[ALL ] 98 | type name(C_DECL_ARGS_##nargs(args)) {
| ^~~~~~~~~~~~
[ALL ] ./include/bits/syscalls-common.h:141:41: note: in
expansion of macro 'SYSCALL_FUNC'
[ALL ] 141 | #define _syscall2(args...)
SYSCALL_FUNC(2, args)
[ALL ] | ^~~~~~~~~~~~
[ALL ] libc/sysdeps/linux/common/fstat64.c:17:24: note: in
expansion of macro '_syscall2'
[ALL ] 17 | static __always_inline _syscall2(int, __syscall_fstat64,
[ALL ] | ^~~~~~~~~
[ERROR] make[1]: *** [Makerules:373:
libc/sysdeps/linux/common/fstat64.os] Error 1
[ALL ] make[1]: Leaving directory
'/home/ctng/crosstool-ng/.build/arc-multilib-linux-uclibc/build/build-libc/multilib'
It looks like maybe arc should be defining
__ARCH_HAS_DEPRECATED_SYSCALLS__ or perhaps declaring kernel_stat64
differently. Any advice would be much appreciated.
Looking at how the code is written in the failing #if condition block of the
fstat64.c I'd think that struct kernel_stat64 should be the same as the struct
stat64. The history of libc/sysdeps/linux/common-generic/bits/kernel_stat.h
suggests that that was so until the commit
74ca8d6f5d2e ("remove UCLIBC_HAS_LFS")
removed that definition. It seems to me that that commit removed the wrong
leg of the condition, and that the attached change (completely untested)
should fix it.
Yes, that seems to do the trick.
Tested-by: Chris Packham <judge.packham(a)gmail.com>