[PATCH] fix file2alias for cross builds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(Note: Patch also attached because the inline version is certain to get
line wrapped.)

When doing cross builds for 64-bit targets on 32-bit platforms, 64-bit
types may not have the same alignment on build and target platforms,
causing problems when parsing the ieee1394_device_id structures. This
adds explicit alignment to the 64-bit type used in file2alias.

Signed-off-by: Jan Beulich <[email protected]>

diff -Npru linux-2.6.12-rc4.base/scripts/mod/file2alias.c linux-2.6.12-rc4/scripts/mod/file2alias.c
--- linux-2.6.12-rc4.base/scripts/mod/file2alias.c	2005-05-11 17:28:26.866988056 +0200
+++ linux-2.6.12-rc4/scripts/mod/file2alias.c	2005-05-11 17:50:36.316880952 +0200
@@ -17,7 +17,8 @@
 #if KERNEL_ELFCLASS == ELFCLASS32
 typedef Elf32_Addr	kernel_ulong_t;
 #else
-typedef Elf64_Addr	kernel_ulong_t;
+/* This can't be a typedef as otherwise the attribute gets ignored. */
+#define kernel_ulong_t __attribute__((__aligned__(8))) Elf64_Addr
 #endif
 #ifdef __sun__
 #include <inttypes.h>


(Note: Patch also attached because the inline version is certain to get
line wrapped.)

When doing cross builds for 64-bit targets on 32-bit platforms, 64-bit
types may not have the same alignment on build and target platforms,
causing problems when parsing the ieee1394_device_id structures. This
adds explicit alignment to the 64-bit type used in file2alias.

Signed-off-by: Jan Beulich <[email protected]>

diff -Npru linux-2.6.12-rc4.base/scripts/mod/file2alias.c linux-2.6.12-rc4/scripts/mod/file2alias.c
--- linux-2.6.12-rc4.base/scripts/mod/file2alias.c	2005-05-11 17:28:26.866988056 +0200
+++ linux-2.6.12-rc4/scripts/mod/file2alias.c	2005-05-11 17:50:36.316880952 +0200
@@ -17,7 +17,8 @@
 #if KERNEL_ELFCLASS == ELFCLASS32
 typedef Elf32_Addr	kernel_ulong_t;
 #else
-typedef Elf64_Addr	kernel_ulong_t;
+/* This can't be a typedef as otherwise the attribute gets ignored. */
+#define kernel_ulong_t __attribute__((__aligned__(8))) Elf64_Addr
 #endif
 #ifdef __sun__
 #include <inttypes.h>

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux