[PATCH] tools/nolibc: don't use asm/ UAPI headers

Thomas Weißschuh posted 1 patch 11 months, 1 week ago
There is a newer version of this series
tools/include/nolibc/arch-s390.h | 4 ++--
tools/include/nolibc/errno.h     | 2 +-
tools/include/nolibc/sys.h       | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-)
[PATCH] tools/nolibc: don't use asm/ UAPI headers
Posted by Thomas Weißschuh 11 months, 1 week ago
The asm/ and asm-generic/ namespaces are implementation details of the UAPI
headers and not meant for direct usage.

Use the equivalent headers from the linux/ namespace instead.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 tools/include/nolibc/arch-s390.h | 4 ++--
 tools/include/nolibc/errno.h     | 2 +-
 tools/include/nolibc/sys.h       | 8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/include/nolibc/arch-s390.h b/tools/include/nolibc/arch-s390.h
index acfee7e9d5e2bb65718cb947110d2c5e1cdeba9b..df4c3cc713accd45551e07e1f02d3638e49e300e 100644
--- a/tools/include/nolibc/arch-s390.h
+++ b/tools/include/nolibc/arch-s390.h
@@ -5,8 +5,8 @@
 
 #ifndef _NOLIBC_ARCH_S390_H
 #define _NOLIBC_ARCH_S390_H
-#include <asm/signal.h>
-#include <asm/unistd.h>
+#include <linux/signal.h>
+#include <linux/unistd.h>
 
 #include "compiler.h"
 #include "crt.h"
diff --git a/tools/include/nolibc/errno.h b/tools/include/nolibc/errno.h
index a44486ff047745bc9bcf9748c3e5074213430f80..1d8d8033e8ff766ee4b3cf7efdb741d4208db04e 100644
--- a/tools/include/nolibc/errno.h
+++ b/tools/include/nolibc/errno.h
@@ -7,7 +7,7 @@
 #ifndef _NOLIBC_ERRNO_H
 #define _NOLIBC_ERRNO_H
 
-#include <asm/errno.h>
+#include <linux/errno.h>
 
 #ifndef NOLIBC_IGNORE_ERRNO
 #define SET_ERRNO(v) do { errno = (v); } while (0)
diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h
index 8f44c33b121300e80b41c971019484007d050b17..cbf7345c4b8dcda8cc0832c487383606672366eb 100644
--- a/tools/include/nolibc/sys.h
+++ b/tools/include/nolibc/sys.h
@@ -10,10 +10,10 @@
 #include "std.h"
 
 /* system includes */
-#include <asm/unistd.h>
-#include <asm/signal.h>  /* for SIGCHLD */
-#include <asm/ioctls.h>
-#include <asm/mman.h>
+#include <linux/unistd.h>
+#include <linux/signal.h>  /* for SIGCHLD */
+#include <linux/termios.h>
+#include <linux/mman.h>
 #include <linux/fs.h>
 #include <linux/loop.h>
 #include <linux/time.h>

---
base-commit: cb839e0cc881b4abd4a2e64cd06c2e313987a189
change-id: 20250305-nolibc-asm-headers-372826fa8f3f

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh@linutronix.de>

Re: [PATCH] tools/nolibc: don't use asm/ UAPI headers
Posted by kernel test robot 11 months, 1 week ago
Hi Thomas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on cb839e0cc881b4abd4a2e64cd06c2e313987a189]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Wei-schuh/tools-nolibc-don-t-use-asm-UAPI-headers/20250305-155035
base:   cb839e0cc881b4abd4a2e64cd06c2e313987a189
patch link:    https://lore.kernel.org/r/20250305-nolibc-asm-headers-v1-1-f2053def2ee7%40linutronix.de
patch subject: [PATCH] tools/nolibc: don't use asm/ UAPI headers
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503072041.LhDGl9Vn-lkp@intel.com/

includecheck warnings: (new ones prefixed by >>)
>> tools/include/nolibc/sys.h: linux/signal.h is included more than once.

vim +14 tools/include/nolibc/sys.h

    11	
    12	/* system includes */
    13	#include <linux/unistd.h>
  > 14	#include <linux/signal.h>  /* for SIGCHLD */
    15	#include <linux/termios.h>
    16	#include <linux/mman.h>
    17	#include <linux/fs.h>
    18	#include <linux/loop.h>
    19	#include <linux/time.h>
    20	#include <linux/auxvec.h>
    21	#include <linux/fcntl.h> /* for O_* and AT_* */
    22	#include <linux/stat.h>  /* for statx() */
    23	#include <linux/prctl.h>
    24	#include <linux/resource.h>
    25	#include <linux/utsname.h>
  > 26	#include <linux/signal.h>
    27	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki