From: Garrett C. <yan...@gm...> - 2009-08-21 21:17:15
|
On Fri, Aug 21, 2009 at 9:00 AM, Mike Frysinger<va...@ge...> wrote: > On Friday 21 August 2009 07:57:39 CAI Qian wrote: >> Test cases unshare failed to compile on systems without such a >> syscall. I am unsure what the best way to handle it. The old ways are, >> >> * add a kernel version check in the unshare tests code. >> >> or >> >> * add a m4 rule. >> * modify the unshare tests code to check if the macro, and add stub >> functions if the macro is false. >> >> The first approach is unable to handle non-vanilla kernels. The second >> approach needs to add stub functions which are unclean. What I would >> like to do is, >> >> * add a m4 rule. >> * modify unshare Makefile like this, >> >> ifdef HAVE_UNSHARE <-- if the syscall is present, compile the tests. > > the configure test should always be there if the code needs new headers (like > sys/signalfd.h). if it's only a new syscall, then the configure test should > only be for the new symbol (assuming one is provided). in all cases, the > tests should be compiled. your proposal doesnt handle the case where the C > library is in place, but the kernel is older so returns ENOSYS. check_for_unshare was a poorly hacked app, IMO and Mike is correct. The issue needs to be a combination of buildtime and runtime tests as it needs to pass through the build and the issue with the syscall needs to be detected and marked TBROK if the syscall isn't implemented. I'll already removed that app from the build in makefile-infra-rework, but I agree that more autoconf testcases can be added at buildtime. Thanks, -Garrett |