mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: <sam@ravnborg.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] fix file2alias for cross builds
Date: Thu, 12 May 2005 10:57:21 +0200	[thread overview]
Message-ID: <s283286f.070@emea1-mh.id2.novell.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]

(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>



[-- Attachment #2: linux-2.6.12-rc4-cross-file2alias.patch --]
[-- Type: text/plain, Size: 999 bytes --]

(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>

             reply	other threads:[~2005-05-12  9:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-12  8:57 Jan Beulich [this message]
2005-05-16  7:37 ` Andrew Morton
2005-05-17 12:47 Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s283286f.070@emea1-mh.id2.novell.com \
    --to=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®