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
This commit is contained in:
Ben Hutchings 2013-05-21 05:30:54 +00:00
parent ebd4d6c14a
commit fd6f735f0d
1 changed files with 18 additions and 2 deletions

View File

@ -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;}" $< >>$@