From 592377f237bd6e2c8e7ce12bcd64a8c9fd12f50b Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Tue, 9 Sep 2014 12:23:39 +0000 Subject: [PATCH] linux-kbuild: Change the type headers used for devicetable-offsets.c (Closes: #754213) Avoid depending on UAPI headers or . This really closes: #754213. It also fixes modpost handling of input device IDs when host and target have differing word size. svn path=/dists/sid/linux-tools/; revision=21798 --- debian/build/scripts/mod/Makefile.real | 4 +--- debian/build/scripts/mod/real-lsb-32/types.h | 3 ++- debian/build/scripts/mod/real-lsb-64/types.h | 3 ++- debian/build/scripts/mod/real-msb-32/types.h | 3 ++- debian/build/scripts/mod/real-msb-64/types.h | 3 ++- debian/build/scripts/mod/types.h | 6 ++++++ debian/changelog | 9 +++++++++ 7 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 debian/build/scripts/mod/types.h diff --git a/debian/build/scripts/mod/Makefile.real b/debian/build/scripts/mod/Makefile.real index 5cb84f684..790dbf284 100644 --- a/debian/build/scripts/mod/Makefile.real +++ b/debian/build/scripts/mod/Makefile.real @@ -2,8 +2,6 @@ PROGS = modpost.real-$(TYPE) top_srcdir = ../.. -CFLAGS += -I$(top_srcdir)/include - include $(top_srcdir)/debian/build/Makefile.inc modpost.real-$(TYPE): file2alias.real-$(TYPE).o modpost.real-$(TYPE).o sumversion.real-$(TYPE).o @@ -13,7 +11,7 @@ modpost.real-$(TYPE): file2alias.real-$(TYPE).o modpost.real-$(TYPE).o sumversio $(CC) -I real-$(TYPE) $(CFLAGS) -c -o $@ $< real-$(TYPE)/devicetable-offsets.s: $(SOURCEDIR)/devicetable-offsets.c - $(CC) -include real-$(TYPE)/types.h $(CFLAGS) -S -o $@ $< + $(CC) -include real-$(TYPE)/types.h $(CFLAGS) -nostdinc -I$(top_srcdir)/include -S -o $@ $< real-$(TYPE)/devicetable-offsets.h: real-$(TYPE)/devicetable-offsets.s echo >$@ "#define __DEVICEVTABLE_OFFSETS_H__" diff --git a/debian/build/scripts/mod/real-lsb-32/types.h b/debian/build/scripts/mod/real-lsb-32/types.h index 75e8b22d3..bad6dcccd 100644 --- a/debian/build/scripts/mod/real-lsb-32/types.h +++ b/debian/build/scripts/mod/real-lsb-32/types.h @@ -1,2 +1,3 @@ -#include +#include "../types.h" typedef __u32 kernel_ulong_t; +#define BITS_PER_LONG 32 diff --git a/debian/build/scripts/mod/real-lsb-64/types.h b/debian/build/scripts/mod/real-lsb-64/types.h index 79f540ebe..8d7b87591 100644 --- a/debian/build/scripts/mod/real-lsb-64/types.h +++ b/debian/build/scripts/mod/real-lsb-64/types.h @@ -1,2 +1,3 @@ -#include +#include "../types.h" typedef __u64 __attribute__((aligned(8))) kernel_ulong_t; +#define BITS_PER_LONG 64 diff --git a/debian/build/scripts/mod/real-msb-32/types.h b/debian/build/scripts/mod/real-msb-32/types.h index 75e8b22d3..bad6dcccd 100644 --- a/debian/build/scripts/mod/real-msb-32/types.h +++ b/debian/build/scripts/mod/real-msb-32/types.h @@ -1,2 +1,3 @@ -#include +#include "../types.h" typedef __u32 kernel_ulong_t; +#define BITS_PER_LONG 32 diff --git a/debian/build/scripts/mod/real-msb-64/types.h b/debian/build/scripts/mod/real-msb-64/types.h index 79f540ebe..8d7b87591 100644 --- a/debian/build/scripts/mod/real-msb-64/types.h +++ b/debian/build/scripts/mod/real-msb-64/types.h @@ -1,2 +1,3 @@ -#include +#include "../types.h" typedef __u64 __attribute__((aligned(8))) kernel_ulong_t; +#define BITS_PER_LONG 64 diff --git a/debian/build/scripts/mod/types.h b/debian/build/scripts/mod/types.h new file mode 100644 index 000000000..f61caf5d0 --- /dev/null +++ b/debian/build/scripts/mod/types.h @@ -0,0 +1,6 @@ +/* Minimal definitions for mod_devicetable.h and devicetable-offsets.c */ +typedef unsigned char __u8; +typedef unsigned short __u16; +typedef unsigned int __u32; +typedef unsigned long long __u64; +#define offsetof(a,b) __builtin_offsetof(a,b) diff --git a/debian/changelog b/debian/changelog index 82f909569..14025d861 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +linux-tools (3.16-2) unstable; urgency=medium + + * linux-kbuild: Change the type headers used for devicetable-offsets.c + to avoid depending on UAPI headers or . This really + closes: #754213. It also fixes modpost handling of input device IDs + when host and target have differing word size. + + -- Ben Hutchings Tue, 09 Sep 2014 13:21:05 +0100 + linux-tools (3.16-1) unstable; urgency=medium * New upstream release