I had emerged in gradm, and also tried to compile it directly from source. However, your question got me to look closer as to which kernel includes were being used.
Sadly, I found that gradm2 was being compiled against:
linux-2.4.21
headers that were installed during the Gentoo (2004.1) install. Somehow I missed this when it was building from Stage 2.
So I unmerged those headers, and did a:
emerge /usr/portage/sys-kernel/linux-headers/linux-headers-2.6.5.ebuild
Now I went and removed the gradm2 source tree and created a new one from scratch. Upon doing a 'make', the following error occurred:
/usr/bin/gcc -O2 -DGRSEC_DIR=\"/etc/grsec\" -DKERNVER=`uname -r | cut -d"." -f 2` -c -o gradm.tab.o gradm.tab.c
In file included from /usr/include/asm/elf.h:10,
from /usr/include/linux/elf.h:5,
from gradm.h:28,
from ./gradm.y:2:
/usr/include/asm/processor.h: In function `prefetch':
/usr/include/asm/processor.h:635: error: `__KERNEL_TEXT_OFFSET' undeclared (first use in this function)
/usr/include/asm/processor.h:635: error: (Each undeclared identifier is reported only once
/usr/include/asm/processor.h:635: error: for each function it appears in.)
/usr/include/asm/processor.h: In function `prefetchw':
/usr/include/asm/processor.h:649: error: `__KERNEL_TEXT_OFFSET' undeclared (first use in this function)
make: *** [gradm.tab.o] Error 1
At this point, I thought that maybe that there was some special grsecurity alterations to the linux headers that were not present from installing the ebuild. From here, I went and did the following:
# for i in asm asm-generic linux
do
mv /usr/include/$i{,-orig}
cp -a /usr/src/linux/include/$i /usr/include/$i
done
**/usr/src/linux is a symlink to the stock vanilla kernel 2.6.5 + grsecurity tree, no other patches have been applied.
to ensure that I was using the properly patched kernel headers.
Unfortunately, the error shown above is still occurring even using the correct headers.
I searched the gentoo mailing list and forums and could not find anyone else having this problem, nor do I see any other Gentoo users here having a problem. What could we have done wrong, coming from a straight build from scratch not more than 4 days ago using Gentoo 2004.1 install.
Any insight into this issue would be graciously appreciated.
~
TTgrsec
~