I tried to build chipsec's kernel module( https://github.com/chipsec/chipsec) on a system with PaX/Grsecurity and I got the some errors:
- Code: Select all
chipsec/build/lib.linux-x86_64-2.7/drivers/linux $ sudo make
[sudo] password for johndoe:
make -C /lib/modules/`uname -r`/build SUBDIRS=/johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux clean
make[1]: Entering directory '/usr/src/linux-headers-4.7.10-grsec'
CLEAN /johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux/.tmp_versions
make[1]: Leaving directory '/usr/src/linux-headers-4.7.10-grsec'
rm -f amd64/cpu.o
nasm -f elf64 -o amd64/cpu.o amd64/cpu.asm
make -C /lib/modules/`uname -r`/build SUBDIRS=/johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux modules
make[1]: Entering directory '/usr/src/linux-headers-4.7.10-grsec'
CC [M] /johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux/chipsec_km.o
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/size_overflow_plugin/size_overflow_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/stackleak_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/colorize_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/kernexec_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/latent_entropy_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/structleak_plugin.so
scripts/Makefile.build:289: recipe for target '/johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux/chipsec_km.o' failed
make[2]: *** [/johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux/chipsec_km.o] Error 1
Makefile:1465: recipe for target '_module_/johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux' failed
make[1]: *** [_module_/johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.7.10-grsec'
Makefile:24: recipe for target 'chipsec' failed
make: *** [chipsec] Error 2
johndoe@johndoe-fortress /johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux $ sudo make
make -C /lib/modules/`uname -r`/build SUBDIRS=/johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux clean
make[1]: Entering directory '/usr/src/linux-headers-4.7.10-grsec'
CLEAN /johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux/.tmp_versions
make[1]: Leaving directory '/usr/src/linux-headers-4.7.10-grsec'
rm -f amd64/cpu.o
nasm -f elf64 -o amd64/cpu.o amd64/cpu.asm
make -C /lib/modules/`uname -r`/build SUBDIRS=/johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux modules
make[1]: Entering directory '/usr/src/linux-headers-4.7.10-grsec'
CC [M] /johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux/chipsec_km.o
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/size_overflow_plugin/size_overflow_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/stackleak_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/colorize_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/kernexec_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/latent_entropy_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/structleak_plugin.so
scripts/Makefile.build:289: recipe for target '/johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux/chipsec_km.o' failed
make[2]: *** [/johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux/chipsec_km.o] Error 1
Makefile:1465: recipe for target '_module_/johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux' failed
make[1]: *** [_module_/johndoe/chipsec/build/lib.linux-x86_64-2.7/drivers/linux] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.7.10-grsec'
Makefile:24: recipe for target 'chipsec' failed
make: *** [chipsec] Error 2
Any idea how to fix it? Thanks.