Compilation error for target liblockdep
Hi, guys,
I got a compilation error while building target liblockdep and I think I'd better report it to you. The error info showed as bellow:
# cd SRC/tools
# make liblockdep
DESCEND lib/lockdep
CC lockdep.o
In file included from lockdep.c:33:0:
../../../kernel/locking/lockdep.c:53:28: fatal error: linux/rcupdate.h: No such file or directory
compilation terminated.
mv: cannot stat './.lockdep.o.tmp': No such file or directory
/home/lzy/kernel-upstream/linux-linus-ubuntu/tools/build/Makefile.build:96: recipe for target 'lockdep.o' failed
make[2]: *** [lockdep.o] Error 1
Makefile:121: recipe for target 'liblockdep-in.o' failed
make[1]: *** [liblockdep-in.o] Error 2
Makefile:68: recipe for target 'liblockdep' failed
make: *** [liblockdep] Error 2BTW, It was introduced by commit a0b0fd53e1e ("locking/lockdep: Free lock classes that are no longer in use").
Thanks.
Quoted 18 lines · Zhengyuan Liu
I got a compilation error while building target liblockdep and I think I'd better report it to you. The error info showed as bellow:
# cd SRC/tools # make liblockdep DESCEND lib/lockdep CC lockdep.o In file included from lockdep.c:33:0: ../../../kernel/locking/lockdep.c:53:28: fatal error: linux/rcupdate.h: No such file or directory compilation terminated. mv: cannot stat './.lockdep.o.tmp': No such file or directory /home/lzy/kernel-upstream/linux-linus-ubuntu/tools/build/Makefile.build:96: recipe for target 'lockdep.o' failed make[2]: *** [lockdep.o] Error 1 Makefile:121: recipe for target 'liblockdep-in.o' failed make[1]: *** [liblockdep-in.o] Error 2 Makefile:68: recipe for target 'liblockdep' failed make: *** [liblockdep] Error 2
Quoted 1 line
BTW, It was introduced by commit
a0b0fd53e1e("locking/lockdep: Free lock classes that are no longer in use").
(+Peter)
Hi Zhengyuan Liu,
The approach of liblockdep is fragile. Every time an additional kernel header is included from the lockdep code or a change is made in one of the kernel headers used by lockdep, that change has to be ported to the include files in the tools/lib/lockdep/include/liblockdep/ directory. I think there are two possible solutions:
- Making the changes necessary to make liblockdep build again.
- Removing the code under tools/lib/lockdep and porting this code to the
new KUnit framework. If I understood the KUnit framework correctly it
is based on UML and hence does not require kernel headers to be
duplicated.
I'm not sure what the best approach is.
Thanks,
Bart.
A message that is not in the archive (sent off-list or not yet received): SN4PR0401MB359876ED2A2D503638658A679B1A0@SN4PR0401MB3598.namprd04.prod.outlook.com
Quoted 21 lines · Johannes Thumshirn
Quoted 20 lines · Zhengyuan Liu
Hi, guys,
I got a compilation error while building target liblockdep and I think I'd better report it to you. The error info showed as bellow:
# cd SRC/tools # make liblockdep DESCEND lib/lockdep CC lockdep.o In file included from lockdep.c:33:0: ../../../kernel/locking/lockdep.c:53:28: fatal error: linux/rcupdate.h: No such file or directory compilation terminated. mv: cannot stat './.lockdep.o.tmp': No such file or directory /home/lzy/kernel-upstream/linux-linus-ubuntu/tools/build/Makefile.build:96: recipe for target 'lockdep.o' failed make[2]: *** [lockdep.o] Error 1 Makefile:121: recipe for target 'liblockdep-in.o' failed make[1]: *** [liblockdep-in.o] Error 2 Makefile:68: recipe for target 'liblockdep' failed make: *** [liblockdep] Error 2
Quoted 4 lines
Quoted 1 line
BTW, It was introduced by commit
a0b0fd53e1e("locking/lockdep: Free lock classes that are no longer in use").This error still pops up here on current master
HEAD:0bf999f9c5e74c7ecf9dafb527146601e5c848b9
I'm not sure it's worth fixing the tests under tools/lib/lockdep since keeping these tests working requires modifying the headers under tools/lib/lockdep/include/ every time the kernel headers under include/ are changed. How about removing tools/lib/lockdep entirely and converting these lockdep tests to the KUnit framework? KUnit is based on UML and I think that's a much more robust approach. For more information about KUnit, see also https://lwn.net/Articles/780985/.
Thanks,
Bart.
A message that is not in the archive (sent off-list or not yet received): SN4PR0401MB35983B3ACED57F66634CF90E9BDA0@SN4PR0401MB3598.namprd04.prod.outlook.com
Quoted 4 lines · Johannes Thumshirn
These files aren't unit tests for lockdep, so they can't be converted to KUnit. liblockdep is a stand alone library bringing lockdep's functionallity to pthread via LDPRELOAD, see also:
https://lwn.net/Articles/536363/
How big is the user base of liblockdep? How many alternatives exist for liblockdep? Are these alternatives better or worse than liblockdep? See also:
* https://clang.llvm.org/docs/ThreadSafetyAnalysis.html
* https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual
* http://valgrind.org/docs/manual/hg-manual.html
Bart.