소스 검색

package/uclibc: fix ARC build with 4.x kernel headers

Provide correct grouping for preprocessor conditions to avoid building
ld.so with undefined macroses which are in use. This is a fix for
package/uclibc/0002-Fix-compilation-with-4.x-kernel-headers.patch.

Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Dmitry Chestnykh 1 년 전
부모
커밋
07033ffa86
1개의 변경된 파일35개의 추가작업 그리고 0개의 파일을 삭제
  1. 35 0
      package/uclibc/0004-Fix-arc-build-with-4.x-kernel-headers.patch

+ 35 - 0
package/uclibc/0004-Fix-arc-build-with-4.x-kernel-headers.patch

@@ -0,0 +1,35 @@
+From 1afc19eb6a7948afbcf3dd19091ce127a355ebcb Mon Sep 17 00:00:00 2001
+From: Dmitry Chestnykh <dm.chestnykh@gmail.com>
+Date: Sun, 28 Jul 2024 14:12:39 +0300
+Subject: [PATCH] [ldso] Group conditions after `&&`
+
+If the conditions are not grouped we can reach
+this block even if `__NR_stat` is not defined.
+
+`defined __NR_stat && ((!defined(__UCLIBC_USE_TIME64__) || defined(__sparc__))`
+gives us false but `LINUX_VERSION_CODE <= KERNEL_VERSION(5,1,0))`
+may give us true. So if linux headers version is below 5.1.0 and
+__NR_stat is not defined we can have compilation error
+
+Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
+Upstream: https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=841d0729883ee0de606de161c1d6a5c37cedf575
+---
+ ldso/include/dl-syscall.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h
+index 9ec0eac60..180d03012 100644
+--- a/ldso/include/dl-syscall.h
++++ b/ldso/include/dl-syscall.h
+@@ -141,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__)) || (LINUX_VERSION_CODE <= KERNEL_VERSION(5,1,0))
++#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)
+-- 
+2.45.2
+