[OpenAFS] Re: libafs: Unknown symbol init_pid_ns

Marc Dionne marc.c.dionne@gmail.com
Sun, 02 Nov 2008 10:24:59 -0500

Axel Thimm wrote:
>>> I think the check looks under /usr/include instead of the kernel
>>> sources/headers. OTOH /usr/include should include the proper headers
>>> as well, I checked that kernel-headers- was installed
>>> at the time of the builds.

No, the checks use the includes under the kernel source tree.  Note the 
"-nostdinc" option in the gcc command below.

>> configure:6856: result: yes
>> configure:6859: checking if find_task_by_pid is usable
>> make -C /srv/atrpms.net/atrpms/kernelsrc/f9-x86_64/ M=/builddir/openafs-1.4.7/conftest.dir modules KBUILD_VERBOSE=1
>> make: Entering directory `/srv/atrpms.net/atrpms/kernelsrc/f9-x86_64/'
>> test -e include/linux/autoconf.h -a -e include/config/auto.conf || (            \
>>         echo;                                                           \
>>         echo "  ERROR: Kernel configuration is invalid.";               \
>>         echo "         include/linux/autoconf.h or include/config/auto.conf are missing.";      \
>>         echo "         Run 'make oldconfig && make prepare' on kernel src to fix it.";  \
>>         echo;                                                           \
>>         /bin/false)
>> mkdir -p /builddir/openafs-1.4.7/conftest.dir/.tmp_versions ; rm -f /builddir/openafs-1.4.7/conftest.dir/.tmp_versions/*
>>   WARNING: Symbol version dump /srv/atrpms.net/atrpms/kernelsrc/f9-x86_64/
>>            is missing; modules will have no dependencies and modversions.
>> make -f scripts/Makefile.build obj=/builddir/openafs-1.4.7/conftest.dir
>>   gcc -Wp,-MD,/builddir/openafs-1.4.7/conftest.dir/.conftest.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.3.0/include -D__KERNEL__ -Iinclude  -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Os   -fno-stack-protector -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args  -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Iinclude/asm-x86/mach-default -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -Wdeclaration-after-statement -Wno-pointer-sign     -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(conftest)"  -D"KBUILD_MODNAME=KBUILD_STR(conftest)" -c -o /builddir/openafs-1.4.7/conftest.dir/conftest.o /builddir/openafs-1.4.7/conftest.dir/conftest.c
>> (cat /dev/null;   echo kernel//builddir/openafs-1.4.7/conftest.dir/conftest.ko;) > /builddir/openafs-1.4.7/conftest.dir/modules.order
>>   Building modules, stage 2.
>> make -f /srv/atrpms.net/atrpms/kernelsrc/f9-x86_64/  scripts/mod/modpost  -a -i /srv/atrpms.net/atrpms/kernelsrc/f9-x86_64/ -I /builddir/openafs-1.4.7/conftest.dir/Module.symvers  -o /builddir/openafs-1.4.7/conftest.dir/Module.symvers -S -K /srv/atrpms.net/atrpms/kernelsrc/f9-x86_64/ -M /builddir/openafs-1.4.7/conftest.dir/Module.markers -w  -s
>>   gcc -Wp,-MD,/builddir/openafs-1.4.7/conftest.dir/.conftest.mod.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.3.0/include -D__KERNEL__ -Iinclude  -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Os   -fno-stack-protector -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args  -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Iinclude/asm-x86/mach-default -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -Wdeclaration-after-statement -Wno-pointer-sign    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(conftest.mod)"  -D"KBUILD_MODNAME=KBUILD_STR(conftest)" -DMODULE -c -o /builddir/openafs-1.4.7/conftest.dir/conftest.mod.o /builddir/openafs-1.4.7/conftest.dir/conftest.mod.c
>>   ld -r -m elf_x86_64  --build-id -o /builddir/openafs-1.4.7/conftest.dir/conftest.ko /builddir/openafs-1.4.7/conftest.dir/conftest.dir/conftest.mod.o
>> make: Leaving directory `/srv/atrpms.net/atrpms/kernelsrc/f9-x86_64/'
>> configure:6958: result: yes

Can you show us the source of that configure test in 
src/cf/linux-test4.m4, just to make sure it's what we expect?

There are several things that don't make sense here:
a) If init_pid_ns is not defined in your kernel, you would get an error 
in the modpost above.
b) If it is defined, it is GPL only, and you would also get an error in 
the modpost above.
c) init_pid_ns should be in your kernel anyway - I don't think it can be 
configured away by any kernel config option.  It is certainly there with 
the default Fedora .config.

Out of curiosity I built locally and the configure test 
(from current 1.4x CVS) gives me:

/s/openafs/1_4_x/conftest.dir/conftest.c: In function 'conftest':
/s/openafs/1_4_x/conftest.dir/conftest.c:30: warning: 'p' is used 
uninitialized in this function
FATAL: modpost: GPL-incompatible module conftest.ko uses GPL-only symbol 
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

.. which is what I expected, and the test for find_task_pid fails.