Issue
I'm trying to compile dahdi-linux on Centos 7. I've installed gcc-9 and latest kernel (i need dahdi-echocan-oslec and standard kernel is too old) This is the error
c/x86_64-redhat-linux/9/include/'/bin/gcc LDFLAGS='-I/opt/rh/devtoolset-9/root/usr/lib/gcc
make -C drivers/dahdi/firmware firmware-loaders
make[1]: Entering directory `/home/user/rpmbuild/BUILD/dahdi-linux-20221203git/drivers/dahdi/firmware'
make[1]: Leaving directory `/home/user/rpmbuild/BUILD/dahdi-linux-20221203git/drivers/dahdi/firmware'
make -C /lib/modules/6.0.11-1.el7.elrepo.x86_64/build M=/home/user/rpmbuild/BUILD/dahdi-linux-20221203git/drivers/dahdi DAHDI_INCLUDE=/home/user/rpmbuild/BUILD/dahdi-linux-20221203git/include DAHDI_MODULES_EXTRA=" " HOTPLUG_FIRMWARE=yes modules DAHDI_BUILD_ALL=m
make[1]: Entering directory `/usr/src/kernels/6.0.11-1.el7.elrepo.x86_64'
CC [M] /home/user/rpmbuild/BUILD/dahdi-linux-20221203git/drivers/dahdi/wct4xxp/base.o
/home/user/rpmbuild/BUILD/dahdi-linux-20221203git/drivers/dahdi/wct4xxp/base.c:45:10: fatal error: stdbool.h: File o directory non esistente
45 | #include <stdbool.h>
| ^~~~~~~~~~~
compilation terminated.
make[4]: *** [/home/user/rpmbuild/BUILD/dahdi-linux-20221203git/drivers/dahdi/wct4xxp/base.o] Errore 1
make[3]: *** [/home/user/rpmbuild/BUILD/dahdi-linux-20221203git/drivers/dahdi/wct4xxp] Errore 2
make[2]: *** [/home/user/rpmbuild/BUILD/dahdi-linux-20221203git/drivers/dahdi] Errore 2
make[1]: *** [__sub-make] Errore 2
make[1]: Leaving directory `/usr/src/kernels/6.0.11-1.el7.elrepo.x86_64'
make: *** [modules] Errore 2
the header requested is here
ls /opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/include/stdbool.h
/opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/include/stdbool.h
I have tried..
make CC=/opt/rh/devtoolset-9/root/bin/gcc LDFLAGS'-I/opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/include/'
make CC=/opt/rh/devtoolset-9/root/bin/gcc CFLAGS'-I/opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/include/'
make CC=/opt/rh/devtoolset-9/root/bin/gcc CFLAGS="-Wall -O2 -pipe -fPIE" LDFLAGS="-z now -pie -I/opt/rh/devtoolset-9/root/usr/include/c++/9/tr" CPPFLAGS="-I/opt/rh/devtoolset-9/root/usr/include/c++/9/tr"
and also
export CFLAGS="-I/opt/rh/devtoolset-9/root/usr/include/c++/9/tr"
export CPPLAGS="-I/opt/rh/devtoolset-9/root/usr/include/c++/9/tr"
export LDFLAGS="-I/opt/rh/devtoolset-9/root/usr/include/c++/9/tr"
then
make CC...
and also
export EXTRA_CFLAGS="-I/opt/rh/devtoolset-9/root/usr/include/c++/9/tr"
make CC=/opt/rh/devtoolset-9/root/bin/gcc EXTRA_CFLAGS="-I/opt/rh/devtoolset-9/root/usr/include/c++/9/tr"
but fail
Solution
Solution found. On new kernels to compile dahdi we need some patches, one is that for latest dahdi "14-dahdi-do-not-use-stdbool.h-in-kernel-modules.patch" you can found on Debian dahdi package sources.
Answered By - elbarna Answer Checked By - Candace Johnson (WPSolving Volunteer)