diff mbox series

[v3,09/12] um: use nolibc for the --showconfig implementation

Message ID 20250924142059.527768-10-benjamin@sipsolutions.net
State Changes Requested
Headers show
Series Start porting UML to nolibc | expand

Commit Message

Benjamin Berg Sept. 24, 2025, 2:20 p.m. UTC
From: Benjamin Berg <benjamin.berg@intel.com>

This is one of the simplest files and it can be switched over to use
nolibc without any modifications.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
---
 arch/um/kernel/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

kernel test robot Sept. 26, 2025, 12:57 p.m. UTC | #1
Hi Benjamin,

kernel test robot noticed the following build warnings:

[auto build test WARNING on uml/next]
[also build test WARNING on uml/fixes shuah-kselftest/next shuah-kselftest/fixes linus/master v6.17-rc7 next-20250925]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Benjamin-Berg/tools-compiler-h-fix-__used-definition/20250924-222547
base:   https://git.kernel.org/pub/scm/linux/kernel/git/uml/linux next
patch link:    https://lore.kernel.org/r/20250924142059.527768-10-benjamin%40sipsolutions.net
patch subject: [PATCH v3 09/12] um: use nolibc for the --showconfig implementation
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: um-randconfig-r111-20250926 (https://download.01.org/0day-ci/archive/20250926/202509261452.g5peaXCc-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250926/202509261452.g5peaXCc-lkp@intel.com/reproduce)

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/r/202509261452.g5peaXCc-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   command-line: note: in included file (through tools/include/nolibc/nolibc.h, tools/include/nolibc/stddef.h, arch/um/include/shared/user.h, builtin):
>> tools/include/nolibc/sys.h:109:29: sparse: sparse: Using plain integer as NULL pointer
   command-line: note: in included file (through tools/include/nolibc/nolibc.h, tools/include/nolibc/stddef.h, arch/um/include/shared/user.h, builtin):
>> tools/include/nolibc/sys/reboot.h:31:16: sparse: sparse: Using plain integer as NULL pointer
>> tools/include/nolibc/sys/reboot.h:31:16: sparse: sparse: Using plain integer as NULL pointer
   command-line: note: in included file (through tools/include/nolibc/nolibc.h, tools/include/nolibc/stddef.h, arch/um/include/shared/user.h, builtin):
>> tools/include/nolibc/unistd.h:57:27: sparse: sparse: Using plain integer as NULL pointer
   tools/include/nolibc/unistd.h:57:30: sparse: sparse: Using plain integer as NULL pointer
   tools/include/nolibc/unistd.h:57:33: sparse: sparse: Using plain integer as NULL pointer
   tools/include/nolibc/unistd.h:70:27: sparse: sparse: Using plain integer as NULL pointer
   tools/include/nolibc/unistd.h:70:30: sparse: sparse: Using plain integer as NULL pointer
   tools/include/nolibc/unistd.h:70:33: sparse: sparse: Using plain integer as NULL pointer
   tools/include/nolibc/unistd.h:81:30: sparse: sparse: Using plain integer as NULL pointer
   tools/include/nolibc/unistd.h:81:33: sparse: sparse: Using plain integer as NULL pointer
   tools/include/nolibc/unistd.h:81:36: sparse: sparse: Using plain integer as NULL pointer
   command-line: note: in included file (through tools/include/nolibc/stdio.h, tools/include/nolibc/nolibc.h, tools/include/nolibc/stddef.h, ...):
   tools/include/nolibc/stdlib.h:56:6: sparse: sparse: symbol 'abort' redeclared with different type (different modifiers):
   tools/include/nolibc/stdlib.h:56:6: sparse:    void extern [addressable] [noreturn] [toplevel] [unused] abort( ... )
   tools/include/nolibc/stdlib.h:54:6: sparse: note: previously declared as:
   tools/include/nolibc/stdlib.h:54:6: sparse:    void extern [addressable] [toplevel] abort( ... )
   command-line: note: in included file (through tools/include/nolibc/nolibc.h, tools/include/nolibc/stddef.h, arch/um/include/shared/user.h, builtin):
   tools/include/nolibc/getopt.h:19:6: sparse: sparse: symbol 'optarg' was not declared. Should it be static?
   tools/include/nolibc/getopt.h:22:5: sparse: sparse: symbol 'optind' was not declared. Should it be static?
   tools/include/nolibc/getopt.h:22:17: sparse: sparse: symbol 'opterr' was not declared. Should it be static?
   tools/include/nolibc/getopt.h:22:29: sparse: sparse: symbol 'optopt' was not declared. Should it be static?
>> tools/include/nolibc/getopt.h:81:26: sparse: sparse: Using plain integer as NULL pointer

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

bd8c8fbb866fe5 Willy Tarreau 2022-02-07  104  
bd8c8fbb866fe5 Willy Tarreau 2022-02-07  105  static __attribute__((unused))
bd8c8fbb866fe5 Willy Tarreau 2022-02-07  106  void *sbrk(intptr_t inc)
bd8c8fbb866fe5 Willy Tarreau 2022-02-07  107  {
bd8c8fbb866fe5 Willy Tarreau 2022-02-07  108  	/* first call to find current end */
4201cfce15fe35 Zhangjin Wu   2023-07-07 @109  	void *ret = sys_brk(0);
4201cfce15fe35 Zhangjin Wu   2023-07-07  110  
4201cfce15fe35 Zhangjin Wu   2023-07-07  111  	if (ret && sys_brk(ret + inc) == ret + inc)
bd8c8fbb866fe5 Willy Tarreau 2022-02-07  112  		return ret + inc;
bd8c8fbb866fe5 Willy Tarreau 2022-02-07  113  
fb01ff635efd0a Willy Tarreau 2023-08-15  114  	SET_ERRNO(ENOMEM);
fb01ff635efd0a Willy Tarreau 2023-08-15  115  	return (void *)-1;
bd8c8fbb866fe5 Willy Tarreau 2022-02-07  116  }
bd8c8fbb866fe5 Willy Tarreau 2022-02-07  117
Thomas Weißschuh Oct. 20, 2025, 2:21 p.m. UTC | #2
Hi Benjamin,

Sep 26, 2025 15:57:43 kernel test robot <lkp@intel.com>:

> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on uml/next]
> [also build test WARNING on uml/fixes shuah-kselftest/next shuah-kselftest/fixes linus/master v6.17-rc7 next-20250925]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Benjamin-Berg/tools-compiler-h-fix-__used-definition/20250924-222547
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/uml/linux next
> patch link:    https://lore.kernel.org/r/20250924142059.527768-10-benjamin%40sipsolutions.net
> patch subject: [PATCH v3 09/12] um: use nolibc for the --showconfig implementation
> :::::: branch date: 2 days ago
> :::::: commit date: 2 days ago
> config: um-randconfig-r111-20250926 (https://download.01.org/0day-ci/archive/20250926/202509261452.g5peaXCc-lkp@intel.com/config)
> compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250926/202509261452.g5peaXCc-lkp@intel.com/reproduce)
>
> 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/r/202509261452.g5peaXCc-lkp@intel.com/
>
> sparse warnings: (new ones prefixed by >>)
>    command-line: note: in included file (through tools/include/nolibc/nolibc.h, tools/include/nolibc/stddef.h, arch/um/include/shared/user.h, builtin):
>>> tools/include/nolibc/sys.h:109:29: sparse: sparse: Using plain integer as NULL pointer
>   unistd.h:70:30: sparse: sparse: Using plain integer as NULL pointer
>    tools/include/nolibc/unistd.h:70:33: sparse: sparse: Using plain integer as NULL pointer

Do you intend to work on your UML with nolibc patches this cycle?
If not I would fix these sparse warnings in the nolibc tree and also apply your nolibc patches.


Thomas
Benjamin Berg Oct. 29, 2025, 2:07 p.m. UTC | #3
Hi Thomas,

On Mon, 2025-10-20 at 17:21 +0300, Thomas Weißschuh wrote:
> Hi Benjamin,
> 
> Sep 26, 2025 15:57:43 kernel test robot <lkp@intel.com>:
> 
> > kernel test robot noticed the following build warnings:
> > 
> > [auto build test WARNING on uml/next]
> > [also build test WARNING on uml/fixes shuah-kselftest/next shuah-
> > kselftest/fixes linus/master v6.17-rc7 next-20250925]
> > [If your patch is applied to the wrong git tree, kindly drop us a
> > note.
> > And when submitting patch, we suggest to use '--base' as documented
> > in
> > https://git-scm.com/docs/git-format-patch#_base_tree_information]
> > 
> > url:   
> > https://github.com/intel-lab-lkp/linux/commits/Benjamin-Berg/tools-compiler-h-fix-__used-definition/20250924-222547
> > base:  
> > https://git.kernel.org/pub/scm/linux/kernel/git/uml/linux next
> > patch link:   
> > https://lore.kernel.org/r/20250924142059.527768-10-benjamin%40sipsolutions.net
> > patch subject: [PATCH v3 09/12] um: use nolibc for the --showconfig
> > implementation
> > :::::: branch date: 2 days ago
> > :::::: commit date: 2 days ago
> > config: um-randconfig-r111-20250926
> > (https://download.01.org/0day-ci/archive/20250926/202509261452.g5pe
> > aXCc-lkp@intel.com/config)
> > compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
> > reproduce (this is a W=1 build):
> > (https://download.01.org/0day-ci/archive/20250926/202509261452.g5pe
> > aXCc-lkp@intel.com/reproduce)
> > 
> > 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/r/202509261452.g5peaXCc-lkp@intel.com/
> > 
> > sparse warnings: (new ones prefixed by >>)
> >    command-line: note: in included file (through
> > tools/include/nolibc/nolibc.h, tools/include/nolibc/stddef.h,
> > arch/um/include/shared/user.h, builtin):
> > > > tools/include/nolibc/sys.h:109:29: sparse: sparse: Using plain
> > > > integer as NULL pointer
> >   unistd.h:70:30: sparse: sparse: Using plain integer as NULL
> > pointer
> >    tools/include/nolibc/unistd.h:70:33: sparse: sparse: Using plain
> > integer as NULL pointer
> 
> Do you intend to work on your UML with nolibc patches this cycle?
> If not I would fix these sparse warnings in the nolibc tree and also
> apply your nolibc patches.

We are not in a hurry for the UML part and while it shouldn't be too
much work, I obviously didn't get around to it in the last week.

So, feel free to pull the patches in via your tree. Then I'll submit
the UML part again in the next cycle.

Benjamin
diff mbox series

Patch

diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile
index b8f4e9281599..4b206a40b611 100644
--- a/arch/um/kernel/Makefile
+++ b/arch/um/kernel/Makefile
@@ -26,7 +26,7 @@  obj-$(CONFIG_OF) += dtb.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-$(CONFIG_STACKTRACE) += stacktrace.o
 
-USER_OBJS := config.o
+NOLIBC_OBJS := config.o
 
 include $(srctree)/arch/um/scripts/Makefile.rules