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.
--
Thanks.
-- Max
Hi,
I'm looking at adding GCC14 to crosstool-ng. I've grabbed the latest uClibc-ng tarball and the commits from master that address some issues already but I'm currently hitting the following error on a 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'
looking at the code I'm wondering of arc should be defining __ARCH_HAS_DEPRECATED_SYSCALLS__ or maybe declaring kernel_stat64 differently. Any advice would be much appreciated.
Thanks,
Chris
There's a few tests whose do_test() is supposed to time out or terminate
with a signal. Tests communicate it to the test skeleton by defining
EXPECTED_SIGNAL or EXPECTED_STATUS and the skeleton completes with
success code when that happens. Running test suite in direct mode by
default changes that, as a result test running script reports failures
for the tests that actually pass or hangs.
Instead of switching to direct test running when building for noMMU use
vfork() and exec() the test in the child process in direct mode.
This makes the default test process behavior the same on MMU and noMMU
targets.
Signed-off-by: Max Filippov <jcmvbkbc(a)gmail.com>
---
test/test-skeleton.c | 65 ++++++++++++++++++++++++++++++++++----------
1 file changed, 50 insertions(+), 15 deletions(-)
diff --git a/test/test-skeleton.c b/test/test-skeleton.c
index 557996d714cd..323a9c645df3 100644
--- a/test/test-skeleton.c
+++ b/test/test-skeleton.c
@@ -222,18 +222,15 @@ handler_killpid(int sig)
/* We provide the entry point here. */
int
-main (int argc, char *argv[])
+main (int argc, char *argv[], char *envp[])
{
-#ifdef __ARCH_USE_MMU__
int direct = 0; /* Directly call the test function? */
-#else
- int direct = 1;
-#endif
int status;
int opt;
unsigned int timeoutfactor = 1;
pid_t termpid;
char *envstr_timeoutfactor;
+ char **argv1;
/* Make uses of freed and uninitialized memory known. */
#ifdef __MALLOC_STANDARD__
@@ -303,19 +300,21 @@ main (int argc, char *argv[])
/* make sure temporary files are deleted. */
atexit (delete_temp_files);
- /* Correct for the possible parameters. */
- argv[optind - 1] = argv[0];
- argv += optind - 1;
- argc -= optind - 1;
+ /* If we are not expected to fork run the function immediately. */
+ if (direct)
+ {
+ /* Correct for the possible parameters. */
+ argv[optind - 1] = argv[0];
+ argv += optind - 1;
+ argc -= optind - 1;
- /* Call the initializing function, if one is available. */
+ /* Call the initializing function, if one is available. */
#ifdef PREPARE
- PREPARE (argc, argv);
+ PREPARE (argc, argv);
#endif
- /* If we are not expected to fork run the function immediately. */
- if (direct)
- return TEST_FUNCTION;
+ return TEST_FUNCTION;
+ }
/* Set up the test environment:
- prevent core dumps
@@ -340,15 +339,51 @@ main (int argc, char *argv[])
if (setpgid (0, 0) != 0)
printf ("Failed to set the process group ID: %m\n");
+ /* Correct for the possible parameters. */
+ argv[optind - 1] = argv[0];
+ argv += optind - 1;
+ argc -= optind - 1;
+
+ /* Call the initializing function, if one is available. */
+#ifdef PREPARE
+ PREPARE (argc, argv);
+#endif
+
/* Execute the test function and exit with the return value. */
exit (TEST_FUNCTION);
}
else if (pid < 0)
-#endif
{
perror ("Cannot fork test program");
exit (1);
}
+#else
+ argv1 = malloc ((argc + 2) * sizeof(void *));
+ argv1[0] = argv[0];
+ argv1[1] = "-d";
+ memcpy(argv1 + 2, argv + 1, argc * sizeof(void *));
+
+ pid = vfork ();
+ if (pid == 0)
+ {
+ /* This is the child. */
+ /* We put the test process in its own pgrp so that if it bogusly
+ generates any job control signals, they won't hit the whole build. */
+ if (setpgid (0, 0) != 0)
+ printf ("Failed to set the process group ID: %m\n");
+
+ if (execve (argv1[0], argv1, envp) < 0)
+ {
+ perror ("Cannot exec test program");
+ _exit (1);
+ }
+ }
+ else if (pid < 0)
+ {
+ perror ("Cannot vfork test program");
+ exit (1);
+ }
+#endif
#ifdef __XXX_HANDLE_CTRL_C
signal (SIGTERM, handler_killpid);
--
2.39.2
Hello,
this series fixes a few type mismatches that have become errors when
building with gcc-14.
Max Filippov (3):
iconv: fix type mismatches
ldso: FDPIC: fix type mismatches
ldso: arm: fix build with gcc-14
ldso/ldso/arm/elfinterp.c | 6 +++---
ldso/ldso/fdpic/dl-inlines.h | 4 ++--
ldso/ldso/fdpic/dl-sysdep.h | 2 +-
libiconv/iconv.c | 8 ++++++--
4 files changed, 12 insertions(+), 8 deletions(-)
--
2.39.2