From fd6f735f0d57e8e8137c46b83781d5681fd33bfc Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Tue, 21 May 2013 05:30:54 +0000 Subject: [PATCH] Add more kluges to the cross-modpost makefile for 3.9 mod_devicetable.h is now converted into a series of offset definitions in devicetable-offsets.h which are included by file2alias.c. So we have to replicate that as well. Note that there are some architecture combinations for which some alias types won't be parsed correctly (and probably never were). The current cross-modpost build rules are really not sustainable. svn path=/dists/trunk/linux-tools/; revision=20135 --- debian/build/scripts/mod/Makefile.real | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/debian/build/scripts/mod/Makefile.real b/debian/build/scripts/mod/Makefile.real index d999c78de..e00c519bc 100644 --- a/debian/build/scripts/mod/Makefile.real +++ b/debian/build/scripts/mod/Makefile.real @@ -9,6 +9,22 @@ include $(top_srcdir)/debian/build/Makefile.inc modpost.real-$(TYPE): file2alias.real-$(TYPE).o modpost.real-$(TYPE).o sumversion.real-$(TYPE).o $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -%.real-$(TYPE).o: $(SOURCEDIR)/%.c - $(CC) -I real-$(TYPE) $(CFLAGS) -c -o $@ $^ +%.real-$(TYPE).o: $(SOURCEDIR)/%.c real-$(TYPE)/devicetable-offsets.h + $(CC) -I real-$(TYPE) $(CFLAGS) -c -o $@ $< +WORD_SIZE := $(subst lsb-,,$(subst msb-,,$(TYPE))) + +# XXX This doesn't quite work, because if we cross-build between 64-bit +# architectures they may have different alignment for pointers (aka +# kernel_ulong_t). This particularly affects i2c_device_id and +# platform_device_id. + +real-$(TYPE)/devicetable-offsets.s: $(SOURCEDIR)/devicetable-offsets.c + $(CC) $(CFLAGS) -include linux/types.h -Dkernel_ulong_t=__u$(WORD_SIZE) -S -o $@ $< + +real-$(TYPE)/devicetable-offsets.h: real-$(TYPE)/devicetable-offsets.s + echo >$@ "#define __DEVICEVTABLE_OFFSETS_H__" + sed -ne "/^->/{s:->#\(.*\):/* \1 */:; \ + s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \ + s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \ + s:->::; p;}" $< >>$@