linux-kbuild: Change the type headers used for devicetable-offsets.c (Closes: #754213)

Avoid depending on UAPI headers or <linux/types.h>.  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
This commit is contained in:
Ben Hutchings 2014-09-09 12:23:39 +00:00
parent 1e01bb178d
commit 592377f237
7 changed files with 24 additions and 7 deletions

View File

@ -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__"

View File

@ -1,2 +1,3 @@
#include <linux/types.h>
#include "../types.h"
typedef __u32 kernel_ulong_t;
#define BITS_PER_LONG 32

View File

@ -1,2 +1,3 @@
#include <linux/types.h>
#include "../types.h"
typedef __u64 __attribute__((aligned(8))) kernel_ulong_t;
#define BITS_PER_LONG 64

View File

@ -1,2 +1,3 @@
#include <linux/types.h>
#include "../types.h"
typedef __u32 kernel_ulong_t;
#define BITS_PER_LONG 32

View File

@ -1,2 +1,3 @@
#include <linux/types.h>
#include "../types.h"
typedef __u64 __attribute__((aligned(8))) kernel_ulong_t;
#define BITS_PER_LONG 64

6
debian/build/scripts/mod/types.h vendored Normal file
View File

@ -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)

9
debian/changelog vendored
View File

@ -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 <linux/types.h>. This really
closes: #754213. It also fixes modpost handling of input device IDs
when host and target have differing word size.
-- Ben Hutchings <ben@decadent.org.uk> Tue, 09 Sep 2014 13:21:05 +0100
linux-tools (3.16-1) unstable; urgency=medium
* New upstream release