Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/uclibc: fix compile error
@ 2024-07-22  8:24 Waldemar Brodkorb
  2024-07-22 12:09 ` Thomas Petazzoni via buildroot
  2024-08-31  9:43 ` Peter Korsgaard
  0 siblings, 2 replies; 4+ messages in thread
From: Waldemar Brodkorb @ 2024-07-22  8:24 UTC (permalink / raw)
  To: buildroot

Fix compile error with older Linux kernel headers.

Fixes:
 http://autobuild.buildroot.net/results/dfa46b243aa6e289333cbd98e3162d62ee6fa865

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
 ...-compilation-with-4.x-kernel-headers.patch | 80 +++++++++++++++++++
 1 file changed, 80 insertions(+)
 create mode 100644 package/uclibc/0002-Fix-compilation-with-4.x-kernel-headers.patch

diff --git a/package/uclibc/0002-Fix-compilation-with-4.x-kernel-headers.patch b/package/uclibc/0002-Fix-compilation-with-4.x-kernel-headers.patch
new file mode 100644
index 0000000000..ad3efa9638
--- /dev/null
+++ b/package/uclibc/0002-Fix-compilation-with-4.x-kernel-headers.patch
@@ -0,0 +1,80 @@
+From 839bae66a376631ee7d5b1f5b2f5b4094c519ea8 Mon Sep 17 00:00:00 2001
+From: Dmitry Chestnykh <dm.chestnykh@gmail.com>
+Date: Sat, 20 Jul 2024 17:23:45 +0300
+Subject: [PATCH] Fix compilation with 4.x kernel headers
+
+- Fallback to __NR_stat syscall in ld.so if we use 4.x kernel headers.
+4.x kernel doesn't support 64-bit time so we can use old syscall
+- Add preprocessor conditions to have fstat64 and fstatat64 in libc
+with old kernel headers
+
+Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+Upstream: https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=839bae66a376631ee7d5b1f5b2f5b4094c519ea8
+---
+ ldso/include/dl-syscall.h             | 4 +++-
+ libc/sysdeps/linux/common/fstat64.c   | 3 ++-
+ libc/sysdeps/linux/common/fstatat64.c | 3 ++-
+ 3 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h
+index 4f41034ad..9ec0eac60 100644
+--- a/ldso/include/dl-syscall.h
++++ b/ldso/include/dl-syscall.h
+@@ -17,6 +17,8 @@ extern int _dl_errno;
+ #define __set_errno(X) {(_dl_errno) = (X);}
+ #endif
+ 
++#include <linux/version.h>
++
+ /* Pull in the arch specific syscall implementation */
+ #include <dl-syscalls.h>
+ /*  For MAP_ANONYMOUS -- differs between platforms */
+@@ -139,7 +141,7 @@ static __always_inline int _dl_stat(const char *file_name,
+ {
+ 	return _dl_newfstatat(AT_FDCWD, file_name, buf, 0);
+ }
+-#elif defined __NR_stat && (!defined(__UCLIBC_USE_TIME64__) || defined(__sparc__))
++#elif defined __NR_stat && (!defined(__UCLIBC_USE_TIME64__) || defined(__sparc__)) || (LINUX_VERSION_CODE <= KERNEL_VERSION(5,1,0))
+ # define __NR__dl_stat __NR_stat
+ static __always_inline _syscall2(int, _dl_stat, const char *, file_name,
+                         struct stat *, buf)
+diff --git a/libc/sysdeps/linux/common/fstat64.c b/libc/sysdeps/linux/common/fstat64.c
+index 359c22af6..121b21fc8 100644
+--- a/libc/sysdeps/linux/common/fstat64.c
++++ b/libc/sysdeps/linux/common/fstat64.c
+@@ -8,8 +8,9 @@
+ 
+ #include <_lfs_64.h>
+ #include <sys/syscall.h>
++#include <linux/version.h>
+ 
+-#if defined(__NR_fstat64) && !defined(__UCLIBC_USE_TIME64__)
++#if defined(__NR_fstat64) && (!defined(__UCLIBC_USE_TIME64__) || LINUX_VERSION_CODE <= KERNEL_VERSION(5,1,0))
+ # include <unistd.h>
+ # include <sys/stat.h>
+ # include "xstatconv.h"
+diff --git a/libc/sysdeps/linux/common/fstatat64.c b/libc/sysdeps/linux/common/fstatat64.c
+index 16dbf9215..739e84081 100644
+--- a/libc/sysdeps/linux/common/fstatat64.c
++++ b/libc/sysdeps/linux/common/fstatat64.c
+@@ -9,6 +9,7 @@
+ #include <_lfs_64.h>
+ #include <bits/wordsize.h>
+ #include <sys/syscall.h>
++#include <linux/version.h>
+ 
+ #if defined __mips__
+ # include <sgidefs.h>
+@@ -23,7 +24,7 @@
+ # define __NR_fstatat64 __NR_newfstatat
+ #endif
+ 
+-#if defined(__NR_fstatat64) && !defined(__UCLIBC_USE_TIME64__)
++#if defined(__NR_fstatat64) && (!defined(__UCLIBC_USE_TIME64__)  || LINUX_VERSION_CODE <= KERNEL_VERSION(5,1,0))
+ # include <sys/stat.h>
+ # include "xstatconv.h"
+ int fstatat64(int fd, const char *file, struct stat64 *buf, int flag)
+-- 
+2.30.2
+
-- 
2.39.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH] package/uclibc: fix compile error
  2024-07-22  8:24 [Buildroot] [PATCH] package/uclibc: fix compile error Waldemar Brodkorb
@ 2024-07-22 12:09 ` Thomas Petazzoni via buildroot
  2024-08-31  9:43 ` Peter Korsgaard
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-07-22 12:09 UTC (permalink / raw)
  To: Waldemar Brodkorb; +Cc: buildroot

On Mon, 22 Jul 2024 10:24:11 +0200
Waldemar Brodkorb <wbx@openadk.org> wrote:

> Fix compile error with older Linux kernel headers.
> 
> Fixes:
>  http://autobuild.buildroot.net/results/dfa46b243aa6e289333cbd98e3162d62ee6fa865
> 
> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> ---
>  ...-compilation-with-4.x-kernel-headers.patch | 80 +++++++++++++++++++
>  1 file changed, 80 insertions(+)
>  create mode 100644 package/uclibc/0002-Fix-compilation-with-4.x-kernel-headers.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH] package/uclibc: fix compile error
  2024-07-22  8:24 [Buildroot] [PATCH] package/uclibc: fix compile error Waldemar Brodkorb
  2024-07-22 12:09 ` Thomas Petazzoni via buildroot
@ 2024-08-31  9:43 ` Peter Korsgaard
  2024-09-04 12:01   ` Waldemar Brodkorb
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Korsgaard @ 2024-08-31  9:43 UTC (permalink / raw)
  To: Waldemar Brodkorb; +Cc: buildroot

>>>>> "Waldemar" == Waldemar Brodkorb <wbx@openadk.org> writes:

 > Fix compile error with older Linux kernel headers.
 > Fixes:
 >  http://autobuild.buildroot.net/results/dfa46b243aa6e289333cbd98e3162d62ee6fa865

 > Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>

I take it that this is related to time64, so an issue that started with
the bump to uclibc-ng 1.0.49 and hence not applicable to 2024.02.x /
2024.05.x?

It would be great if you could add such info to the commit messages to
make the LTS work easier, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH] package/uclibc: fix compile error
  2024-08-31  9:43 ` Peter Korsgaard
@ 2024-09-04 12:01   ` Waldemar Brodkorb
  0 siblings, 0 replies; 4+ messages in thread
From: Waldemar Brodkorb @ 2024-09-04 12:01 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: buildroot

Hi Peter,
Peter Korsgaard wrote,

> >>>>> "Waldemar" == Waldemar Brodkorb <wbx@openadk.org> writes:
> 
>  > Fix compile error with older Linux kernel headers.
>  > Fixes:
>  >  http://autobuild.buildroot.net/results/dfa46b243aa6e289333cbd98e3162d62ee6fa865
> 
>  > Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> 
> I take it that this is related to time64, so an issue that started with
> the bump to uclibc-ng 1.0.49 and hence not applicable to 2024.02.x /
> 2024.05.x?

Right, I think so, too.
 
> It would be great if you could add such info to the commit messages to
> make the LTS work easier, thanks.

Okay.

best regards
 Waldemar
 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-09-04 12:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-22  8:24 [Buildroot] [PATCH] package/uclibc: fix compile error Waldemar Brodkorb
2024-07-22 12:09 ` Thomas Petazzoni via buildroot
2024-08-31  9:43 ` Peter Korsgaard
2024-09-04 12:01   ` Waldemar Brodkorb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox