[Bug,Report] build error on tools/testing/radix-tree/idr-test.c

Matthew Wilcox willy at infradead.org
Mon Mar 29 13:58:43 BST 2021


On Mon, Mar 29, 2021 at 11:58:03AM +0900, JaeJoon Jung wrote:
> Hello, Matthew.
> I run the make in tools/testing/radix-tree with Makefile.
> I found that build error messages on tools/testing/radix-tree/idr-test.c
> in kernel v5.11 and v5.12-rc. But It is OK in v5.10
> The error messages is as below:
> 
> In file included from ./linux/kernel.h:5:0,
>                  from ../../include/linux/bitmap.h:8,
>                  from idr-test.c:6:
> idr-test.c: In function ‘ida_thread_tests’:
> ./../../include/linux/kernel.h:105:59: warning: implicit declaration
> of function ‘__must_be_array’; did you mean ‘__list_del_entry’?
> [-Wimplicit-function-declaration]
>  #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
>                                                            ^
> idr-test.c:550:18: note: in expansion of macro ‘ARRAY_SIZE’
>   for (i = 0; i < ARRAY_SIZE(threads); i++)
>                   ^~~~~~~~~~
> cc -I. -I../../include -g -Og -Wall -D_LGPL_SOURCE -fsanitize=address
> -fsanitize=undefined   -c -o iteration_check.o iteration_check.c
> cc -I. -I../../include -g -Og -Wall -D_LGPL_SOURCE -fsanitize=address
> -fsanitize=undefined   -c -o iteration_check_2.o iteration_check_2.c
> cc -I. -I../../include -g -Og -Wall -D_LGPL_SOURCE -fsanitize=address
> -fsanitize=undefined   -c -o benchmark.o benchmark.c
> cc -fsanitize=address -fsanitize=undefined  main.o xarray.o
> radix-tree.o idr.o linux.o test.o find_bit.o bitmap.o regression1.o
> regression2.o regression3.o regression4.o tag_check.o multiorder.o
> idr-test.o iteration_check.o iteration_check_2.o benchmark.o
> -lpthread -lurcu -o main
> idr-test.o: In function `ida_thread_tests':
> /mnt/sda3/projects/kernel/linux-torvalds/tools/testing/radix-tree/idr-test.c:550:
> undefined reference to `__must_be_array'
> /mnt/sda3/projects/kernel/linux-torvalds/tools/testing/radix-tree/idr-test.c:559:
> undefined reference to `__must_be_array'
> collect2: error: ld returned 1 exit status
> <builtin>: recipe for target 'main' failed
> make: *** [main] Error 1
> 
> 
> I solved the above phenomenon as follows:
> Please review and reflect that.

There's an easier solution:

$ git rm tools/testing/radix-tree/linux/compiler_types.h 

I'll be sending that to Linus soon.



More information about the maple-tree mailing list