[kernel] r20135 - dists/trunk/linux-tools/debian/build/scripts/mod
Ben Hutchings
benh at alioth.debian.org
Tue May 21 05:30:55 UTC 2013
Author: benh
Date: Tue May 21 05:30:54 2013
New Revision: 20135
Log:
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.
Modified:
dists/trunk/linux-tools/debian/build/scripts/mod/Makefile.real
Modified: dists/trunk/linux-tools/debian/build/scripts/mod/Makefile.real
==============================================================================
--- dists/trunk/linux-tools/debian/build/scripts/mod/Makefile.real Tue May 21 03:56:32 2013 (r20134)
+++ dists/trunk/linux-tools/debian/build/scripts/mod/Makefile.real Tue May 21 05:30:54 2013 (r20135)
@@ -9,6 +9,22 @@
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;}" $< >>$@
More information about the Kernel-svn-changes
mailing list