Bug#1005390: Fails to build with Linux 5.16 onward

Ben Hutchings ben at decadent.org.uk
Sat Feb 12 18:50:33 GMT 2022


Source: dahdi-linux
Version: 1:2.11.1.0.20170917~dfsg-7.4
Severity: grave
Tags: patch

The dahdi modules fail to build, with thqis error:

/var/lib/dkms/dahdi/2.11.1.0.20170917~dfsg-7.4/build/drivers/dahdi/wct4xxp/base.c:45:10: fatal error: stdbool.h: No such file or directory
   45 | #include <stdbool.h>
      |          ^~~~~~~~~~~

This is due to an intentional change in Linux 5.16 removing user-space
headers from the kernel include path:
<https://git.kernel.org/linus/04e85bbf71c9072dcf0ad9a7150495d72461105c>.

Kernel code must use <linux/types.h> instead of <stdbool.h>.

The attached patch fixes this and allows the build to complete, but
there are still a lot of compiler warnings.

Ben.

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'oldstable-updates'), (500, 'unstable'), (500, 'oldstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.15.0-3-amd64 (SMP w/2 CPU threads)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
-------------- next part --------------
From: Ben Hutchings <benh at debian.org>
Date: Sat, 12 Feb 2022 19:32:52 +0100
Subject: dahdi: Do not use <stdbool.h> in kernel modules

There was an intentional change in Linux 5.16 removing user-space
headers from the kernel include path:
<https://git.kernel.org/linus/04e85bbf71c9072dcf0ad9a7150495d72461105c>.

Kernel code must use <linux/types.h> instead of <stdbool.h>.

---
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -86,7 +86,7 @@
 
 #include "hpec/hpec_user.h"
 
-#include <stdbool.h>
+#include <linux/types.h>
 
 #if defined(EMPULSE) && defined(EMFLASH)
 #error "You cannot define both EMPULSE and EMFLASH"
--- a/drivers/dahdi/wcaxx-base.c
+++ b/drivers/dahdi/wcaxx-base.c
@@ -34,7 +34,7 @@
 #include <linux/firmware.h>
 #include <linux/crc32.h>
 
-#include <stdbool.h>
+#include <linux/types.h>
 
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
--- a/drivers/dahdi/wct4xxp/base.c
+++ b/drivers/dahdi/wct4xxp/base.c
@@ -42,7 +42,7 @@
 #include <linux/crc32.h>
 #include <linux/slab.h>
 
-#include <stdbool.h>
+#include <linux/types.h>
 #include <dahdi/kernel.h>
 
 #include "wct4xxp.h"
--- a/drivers/dahdi/wctc4xxp/base.c
+++ b/drivers/dahdi/wctc4xxp/base.c
@@ -39,7 +39,7 @@
 #include <linux/etherdevice.h>
 #include <linux/timer.h>
 
-#include <stdbool.h>
+#include <linux/types.h>
 
 #include <dahdi/kernel.h>
 
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -58,7 +58,7 @@ Tx Gain - W/Pre-Emphasis: -23.99 to 0.00
 #include <linux/crc32.h>
 #include <linux/slab.h>
 
-#include <stdbool.h>
+#include <linux/types.h>
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
 /* Define this if you would like to load the modules in parallel.  While this
--- a/drivers/dahdi/wcte12xp/base.c
+++ b/drivers/dahdi/wcte12xp/base.c
@@ -43,7 +43,7 @@
 
 #include <linux/slab.h>
 
-#include <stdbool.h>
+#include <linux/types.h>
 #include <dahdi/kernel.h>
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
--- a/drivers/dahdi/wcte13xp-base.c
+++ b/drivers/dahdi/wcte13xp-base.c
@@ -35,7 +35,7 @@
 #include <linux/sched.h>
 #include <linux/crc32.h>
 
-#include <stdbool.h>
+#include <linux/types.h>
 #include <dahdi/kernel.h>
 
 #include "wct4xxp/wct4xxp.h"	/* For certain definitions */
--- a/drivers/dahdi/wcte43x-base.c
+++ b/drivers/dahdi/wcte43x-base.c
@@ -43,7 +43,7 @@
 #include <linux/firmware.h>
 #include <oct612x.h>
 
-#include <stdbool.h>
+#include <linux/types.h>
 #include <dahdi/kernel.h>
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
--- a/drivers/dahdi/wcxb.c
+++ b/drivers/dahdi/wcxb.c
@@ -38,7 +38,7 @@
 
 #include <dahdi/kernel.h>
 
-#include <stdbool.h>
+#include <linux/types.h>
 
 #include "wcxb.h"
 #include "wcxb_spi.h"
--- a/drivers/dahdi/wct4xxp/vpm450m.c
+++ b/drivers/dahdi/wct4xxp/vpm450m.c
@@ -28,7 +28,7 @@
 #include <linux/version.h>
 
 #include <dahdi/kernel.h>
-#include <stdbool.h>
+#include <linux/types.h>
 
 #include "vpm450m.h"
 #include <oct612x.h>
--- a/drivers/dahdi/voicebus/vpmoct.h
+++ b/drivers/dahdi/voicebus/vpmoct.h
@@ -30,7 +30,7 @@
 #include <linux/timer.h>
 #include "dahdi/kernel.h"
 
-#include <stdbool.h>
+#include <linux/kernel.h>
 
 #define VPMOCT_FIRM_HEADER_LEN 32
 #define VPMOCT_BOOT_RAM_LEN 128
--- a/drivers/dahdi/wcxb_spi.h
+++ b/drivers/dahdi/wcxb_spi.h
@@ -24,7 +24,7 @@
 #define __WCXB_SPI_H
 
 #include <linux/spi/spi.h>
-#include <stdbool.h>
+#include <linux/types.h>
 
 struct wcxb_spi_transfer {
 	const void	*tx_buf;


More information about the Pkg-voip-maintainers mailing list