lkml.org 
[lkml]   [2005]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
From
Subject[PATCH] fix file2alias for cross builds
(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 <jbeulich@novell.com>

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 <jbeulich@novell.com>

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>
\
 
 \ /
  Last update: 2005-05-12 11:10    [W:1.087 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site