gen_ldc writes offsets into the __locale_mmap_t structure. This
relies on the host system having the same struct offsets as the
target. On some architectures structs are aligned to 4 byte
boundaries and for these targets it is required for the struct to
be packed so that it is more likely to match the host system
(typically x86 which does not align structs).
---
extra/locale/gen_wc8bit.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/extra/locale/gen_wc8bit.c b/extra/locale/gen_wc8bit.c
index a861caa..1d42d3c 100644
--- a/extra/locale/gen_wc8bit.c
+++ b/extra/locale/gen_wc8bit.c
@@ -182,7 +182,7 @@ int main(int argc, char **argv)
printf("\tunsigned char idx8c2wc[%d];\n", C2WC_IDX_LEN);
printf("\tunsigned char idx8wc2c[%d];\n", II_LEN);
#endif
- printf("} __codeset_8_bit_t;\n\n");
+ printf("} __attribute__((__packed__)) __codeset_8_bit_t;\n\n");
printf("#ifdef WANT_DATA\n\n");
printf("static const __codeset_8_bit_t codeset_8_bit[%d] = {\n",
argc-1);
--
1.7.3.4
From 6d3d74cc70794fddf24793bc9ce809af591f7575 Mon Sep 17 00:00:00 2001
From: Will Newton <[email protected]>
Date: Thu, 24 Mar 2011 11:37:25 +0000
Subject: [PATCH] extra/locale: Mark __codeset_8_bit_t as packed.
gen_ldc writes offsets into the __locale_mmap_t structure. This
relies on the host system having the same struct offsets as the
target. On some architectures structs are aligned to 4 byte
boundaries and for these targets it is required for the struct to
be packed so that it is more likely to match the host system
(typically x86 which does not align structs).
---
extra/locale/gen_wc8bit.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/extra/locale/gen_wc8bit.c b/extra/locale/gen_wc8bit.c
index a861caa..1d42d3c 100644
--- a/extra/locale/gen_wc8bit.c
+++ b/extra/locale/gen_wc8bit.c
@@ -182,7 +182,7 @@ int main(int argc, char **argv)
printf("\tunsigned char idx8c2wc[%d];\n", C2WC_IDX_LEN);
printf("\tunsigned char idx8wc2c[%d];\n", II_LEN);
#endif
- printf("} __codeset_8_bit_t;\n\n");
+ printf("} __attribute__((__packed__)) __codeset_8_bit_t;\n\n");
printf("#ifdef WANT_DATA\n\n");
printf("static const __codeset_8_bit_t codeset_8_bit[%d] = {\n", argc-1);
--
1.7.3.4
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc