scripts/mod/file2alias.c cross compile problem

From: Adrian Bunk
Date: Fri Jul 27 2007 - 21:40:30 EST


On Fri, Jul 27, 2007 at 04:21:47PM -0700, Luck, Tony wrote:
> > So it seems on ia64 with gcc 3.3.6 there's some 8 byte alignment of the
> > array members?
> >
> > Sam and the ia64 maintainers Cc'ed - they might know better what's going
> > on here.
>
> This ia64 maintainer is baffled ... but I don't see the problem here (perhaps
> because my build machine has gcc 3.4.6).


I found what causes this problem, and it only occurs during cross
compilation.


The struct is:

#define ACPI_ID_LEN 9

struct acpi_device_id {
__u8 id[ACPI_ID_LEN];
kernel_ulong_t driver_data;
};


When compiling for ia64, this results in:

struct acpi_device_id {
__u8 id[9];
uint64_t driver_data;
};


sizeof(struct acpi_device_id) for ia64 is due to different padding
after id[] 20 bytes on i386 but 24 bytes on ia64.

scripts/mod/file2alias.c is compiled with HOSTCC and ensures that
kernel_ulong_t is correct (in this case uint64_t for ia64), but it can't
cope with different padding on different architectures.


> -Tony

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/