[Pkg-oss4-maintainers] [PATCH 3/3] Get rid of limits.h copy hack, leverage include-fixed

Benda Xu heroxbd at gentoo.org
Thu Oct 23 08:42:32 UTC 2014


Use limits.h from include-fixed from gcc. (closes: #713841)
Avoid assuming on limits.h location in kernel headers.

---
 debian/changelog         | 4 ++--
 debian/create-ma-tree.sh | 8 +++++---
 debian/m-a/rules         | 8 --------
 debian/oss4-dkms.dkms.in | 7 +------
 4 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 7042300..9989cd3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,8 +4,6 @@ oss4 (4.2-build2010-1) unstable; urgency=low
   * New upstream release.
     - fix build with recent kernel. (Closes: #696751)
   * Add build dependency on libtool-bin. (Closes: #761783)
-  * Fix build problems due to the move of limits.h. Thanks to Michal Suchanek
-    for the patch. (Closes: #713841)
 
   [ Benda Xu ]
   * Use debhelper 9.
@@ -13,6 +11,8 @@ oss4 (4.2-build2010-1) unstable; urgency=low
   * Add Benda Xu to uploaders.
   * Run wrap-and-sort.
   * Canonicalize Vcs-Svn field and add Vcs-Browser field.
+  * Get rid of limits.h copy hack, leverage include-fixed from gcc.
+    (closes: #713841)
 
  -- Sebastien NOEL <sebastien at twolife.org>  Mon, 06 Oct 2014 17:11:18 +0200
 
diff --git a/debian/create-ma-tree.sh b/debian/create-ma-tree.sh
index ac9ff56..34ae919 100644
--- a/debian/create-ma-tree.sh
+++ b/debian/create-ma-tree.sh
@@ -56,7 +56,8 @@ done
 OBJS="os_linux.o `echo $SOURCES |sed -e 's,\.c,.o,g'`"
 cat >"$NEWDIR"/core/Makefile <<EOF
 MULTIARCH_PATH = /usr/include/\$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
-EXTRA_CFLAGS = -I\$(KBUILD_EXTMOD) -mhard-float -isystem /usr/include -isystem \$(MULTIARCH_PATH)
+EXTRA_CFLAGS = -I\$(KBUILD_EXTMOD) -mhard-float -isystem /usr/include -isystem \$(MULTIARCH_PATH) \
+	-isystem \$(shell \$(CC) --print-file-name=include-fixed)
 obj-m += osscore.o
 osscore-objs := oss_core.o $OBJS
 EOF
@@ -64,7 +65,7 @@ EOF
 # This is somewhat ugly, but unavoidable -- parts of OSS need those defines and
 # access to system includes while osscore.c can't be compiled with them...
 for i in $OBJS; do
-	echo "CFLAGS_$i = -isystem /usr/include -isystem \$(MULTIARCH_PATH) -D_KERNEL" >>"$NEWDIR"/core/Makefile
+	echo "CFLAGS_$i = -D_KERNEL" >>"$NEWDIR"/core/Makefile
 done
 
 
@@ -77,7 +78,8 @@ osscore_symbols.inc:
 	echo "};" >> osscore_symbols.inc
 
 MULTIARCH_PATH = /usr/include/\$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
-EXTRA_CFLAGS=-D_KERNEL -I\$(KBUILD_EXTMOD)/../core -I\$(KBUILD_EXTMOD) -isystem /usr/include -isystem \$(MULTIARCH_PATH) -mhard-float
+EXTRA_CFLAGS=-D_KERNEL -I\$(KBUILD_EXTMOD)/../core -I\$(KBUILD_EXTMOD) -isystem /usr/include -isystem \$(MULTIARCH_PATH) -mhard-float \
+	-isystem \$(shell \$(CC) --print-file-name=include-fixed)
 EOF
 
 # Merge the drivers...
diff --git a/debian/m-a/rules b/debian/m-a/rules
index e68c455..21013c7 100644
--- a/debian/m-a/rules
+++ b/debian/m-a/rules
@@ -43,14 +43,6 @@ binary-modules:
 	dh_clean -k
 	dh_installdirs lib/modules/$(KVERS)/kernel/oss4
 
-	# This is Bad(tm) but necessary since linux-headers >= 2.6.29
-	for i in /lib/modules/$(KVERS)/build/include/linux/limits.h \
-	         /lib/modules/$(KVERS)/source/include/linux/limits.h \
-	         /lib/modules/$(KVERS)/build/include/uapi/linux/limits.h \
-	         /lib/modules/$(KVERS)/source/include/uapi/linux/limits.h ; do \
-	    test -e $$i && cp -v $$i $(PWD)/core && break ; done ||:
-	test -e $(PWD)/core/limits.h
-
 	# Build the modules
 	$(MAKE) -C $(KSRC) M=$(PWD)/core modules
 	$(MAKE) -C $(PWD)/drivers osscore_symbols.inc
diff --git a/debian/oss4-dkms.dkms.in b/debian/oss4-dkms.dkms.in
index a8ad75e..bab8818 100644
--- a/debian/oss4-dkms.dkms.in
+++ b/debian/oss4-dkms.dkms.in
@@ -97,12 +97,7 @@ DEST_MODULE_LOCATION[29]="/updates/dkms/"
 DEST_MODULE_LOCATION[30]="/updates/dkms/"
 DEST_MODULE_LOCATION[31]="/updates/dkms/"
 AUTOINSTALL=yes
-MAKE[0]="test -e /lib/modules/${kernelver}/build/include/linux/limits.h && cp -v /lib/modules/${kernelver}/build/include/linux/limits.h ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/core ; \
-         test -e /lib/modules/${kernelver}/build/include/uapi/linux/limits.h && cp -v /lib/modules/${kernelver}/build/include/uapi/linux/limits.h ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/core ; \
-         test -e /lib/modules/${kernelver}/source/include/linux/limits.h && cp -v /lib/modules/${kernelver}/source/include/linux/limits.h ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/core ; \
-         test -e /lib/modules/${kernelver}/source/include/uapi/linux/limits.h && cp -v /lib/modules/${kernelver}/source/include/uapi/linux/limits.h ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/core ; \
-         test -e ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/core/limits.h && \
-         make -C ${kernel_source_dir} SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/core modules && \
+MAKE[0]="make -C ${kernel_source_dir} SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/core modules && \
          make -C ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/drivers osscore_symbols.inc && \
          make -C ${kernel_source_dir} SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/drivers modules"
 CLEAN="cd core && rm -f *.o *.ko *.mod.c *.mod.o .*.cmd modules.order Module.symvers limits.h && rm -rf .tmp_versions && cd .. && \
-- 
2.1.1




More information about the Pkg-oss4-maintainers mailing list