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

Re: [patches] [PATCH] localedef cross endianess problem



Marc Kleine-Budde wrote:
> Marc Kleine-Budde wrote:
>>>>> Joseph, does the analysis and patch look OK to you?
>>>> It seems sound to me.  The key test would be creating locales, with a
>>>> locale archive, both natively with one endianness and cross from
>>>> another endianness, and verifying that the resulting archive is
>>>> identical in both cases.
>> I've got a powerpc linux box here, I'll try to test it.
>>
>>> Can you, please, run the test Joseph proposed?  Let me know if you are
>>> unable to do so, we'll try to figure out something else then.
>> Hopefully I'll find some time to do it today.
> 
> creating the same environment for the test on the powerpc takes some
> time....it's still compiling.

puh, compiling is finished.

I applied your patch to eglibc, but only the first hunk
(libc/locale/programs/locarchive.c) is actually compiled into the
localedef binary. "libc/locale/programs/locale.c" seems not to be part
of this program.

I used this call to create the localedef archive:

I18NPATH=/opt/OSELAS.Toolchain-1.99.2/powerpc-603e-linux-gnu/gcc-4.3.2-glibc-2.8-binutils-2.18-kernel-2.6.27-sanitized/sysroot-powerpc-603e-linux-gnu/usr/share/i18n /home/frogger/pengutronix/bsp/OSELAS.BSP-Pengutronix-AllYes-trunk/platform-phyCORE-MPC5200B-tiny/sysroot-host/bin/localedef --big-endian -i en_US -f ISO-8859-1 --prefix=/home/frogger/pengutronix/bsp/OSELAS.BSP-Pengutronix-AllYes-trunk/platform-phyCORE-MPC5200B-tiny/build-target/locales en_US

The toolchain and thus the locales are glibc-2.8 based.


On a 32 bit powerpc my original patch and your patch produced the same
locale archive.

On x64 with your patch the localedef program didn't sagfault anymore
(like my patch) but the locale archives are different compared to the
powerpc run.

here the diff off the "hexdump -C" output of the localedef archives.

--- ppc-to-ppc-2.9-theirpatch.txt	2009-01-21 16:06:23.000000000 +0100
+++ x86_64-to-ppc-2.9-thierpatch.txt	2009-01-21 16:06:44.000000000 +0100
@@ -1,41 +1,41 @@
-00000000  de 02 01 09 00 00 00 00  00 00 00 38 00 00 00 02  |Þ..........8....|
-00000010  00 00 03 8b 00 00 2a bc  00 00 00 15 00 00 1d 4c  |......*¼.......L|
-00000020  00 00 48 08 00 00 00 01  00 00 01 a4 00 00 f9 38  |..H........¤..ù8|
-00000030  00 00 00 03 00 00 07 d3  00 00 00 00 00 00 00 00  |.......Ó........|
+00000000  09 01 02 de 00 00 00 00  38 00 00 00 02 00 00 00  |...Þ....8.......|
+00000010  8b 03 00 00 bc 2a 00 00  15 00 00 00 4c 1d 00 00  |....¼*......L...|
+00000020  08 48 00 00 01 00 00 00  a4 01 00 00 38 f9 00 00  |.H......¤...8ù..|
+00000030  03 00 00 00 d3 07 00 00  00 00 00 00 00 00 00 00  |....Ó...........|
 00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
-00000230  3e ef 66 e4 00 00 2a c2  00 00 48 08 00 00 00 00  |>ïfä..*Â..H.....|
+00000230  e4 66 ef 3e c2 2a 00 00  08 48 00 00 00 00 00 00  |äfï>Â*...H......|
 00000240  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
-000007e0  00 00 00 00 00 00 00 00  71 7d 50 a6 00 00 2a bc  |........q}P¦..*¼|
-000007f0  00 00 48 08 00 00 00 00  00 00 00 00 00 00 00 00  |..H.............|
+000007e0  00 00 00 00 00 00 00 00  a6 50 7d 71 bc 2a 00 00  |........¦P}q¼*..|
+000007f0  08 48 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |.H..............|
 00000800  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
 00002ab0  00 00 00 00 00 00 00 00  00 00 00 00 65 6e 5f 55  |............en_U|
 00002ac0  53 00 65 6e 5f 55 53 2e  69 73 6f 38 38 35 39 31  |S.en_US.iso88591|
 00002ad0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
-00004800  00 00 00 00 00 00 00 00  00 00 00 01 00 01 95 c0  |...............À|
-00004810  00 03 5d 64 00 05 3f 40  00 00 00 3b 00 05 3f 80  |..]d..?@...;..?.|
-00004820  00 00 09 9b 00 04 f3 30  00 00 4c 03 00 05 49 20  |......ó0..L...I |
-00004830  00 00 01 23 00 05 4a 50  00 00 00 39 00 05 3f 40  |...#..JP...9..?@|
-00004840  00 00 0e 60 00 05 4a 90  00 00 00 27 00 05 4a c0  |...`..J....'..JÀ|
-00004850  00 00 00 52 00 05 4b 20  00 00 00 a0 00 05 4b c0  |...R..K ... ..KÀ|
-00004860  00 00 00 40 00 05 4c 00  00 00 00 1c 00 05 4c 20  |...@..L.......L |
-00004870  00 00 01 7a 00 00 00 00  00 00 00 00 00 00 00 00  |...z............|
+00004800  00 00 00 00 00 00 00 00  01 00 00 00 c0 95 01 00  |............À...|
+00004810  64 5d 03 00 40 3f 05 00  3b 00 00 00 80 3f 05 00  |d]..@?..;....?..|
+00004820  9b 09 00 00 30 f3 04 00  03 4c 00 00 20 49 05 00  |....0ó...L.. I..|
+00004830  23 01 00 00 50 4a 05 00  39 00 00 00 40 3f 05 00  |#...PJ..9...@?..|
+00004840  60 0e 00 00 90 4a 05 00  27 00 00 00 c0 4a 05 00  |`....J..'...ÀJ..|
+00004850  52 00 00 00 20 4b 05 00  a0 00 00 00 c0 4b 05 00  |R... K.. ...ÀK..|
+00004860  40 00 00 00 00 4c 05 00  1c 00 00 00 20 4c 05 00  |@....L...... L..|
+00004870  7a 01 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |z...............|
 00004880  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
-00017180  00 00 00 00 00 00 00 00  47 be 5c e6 e2 95 29 cd  |........G¾\æâ.)Í|
-00017190  eb 9c 6e 52 5c 15 e6 3c  00 04 f3 30 00 00 00 00  |ë.nR\.æ<..ó0....|
-000171a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
-*
-00018100  3b 84 73 d3 59 18 78 b0  5e bf ef 1f 88 92 b5 a0  |;.sÓY.x°^¿ï...µ |
-00018110  00 05 3f 40 00 00 00 00  00 00 00 00 00 00 00 00  |..?@............|
-00018120  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
-*
-00019420  00 00 00 00 82 ef 9d 32  c9 f0 a6 b4 e1 11 15 8c  |.....ï.2Éð¦´á...|
-00019430  f0 97 6b bc 00 01 95 c0  00 00 00 00 00 00 00 00  |ð.k¼...À........|
-00019440  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+000130e0  00 00 00 00 00 00 00 00  00 00 00 00 c7 5e 95 65  |............Ç^.e|
+000130f0  0e 79 b5 dc 9f 24 8b 53  ce a1 7d 91 c0 95 01 00  |.yµÜ.$.SΡ}.À...|
+00013100  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+*
+00013420  a8 0a 63 1c 6f a3 c6 ec  5c 62 c4 10 19 3a af c1  |¨.c.o£Æì\bÄ..:¯Á|
+00013430  40 3f 05 00 00 00 00 00  00 00 00 00 00 00 00 00  |@?..............|
+00013440  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+*
+000172c0  00 00 00 00 00 00 00 00  21 e9 a1 d8 27 9f 58 8c  |........!é¡Ø'.X.|
+000172d0  ef e6 9c 2a 28 35 d0 d5  30 f3 04 00 00 00 00 00  |ïæ.*(5ÐÕ0ó......|
+000172e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
 000195c0  20 03 11 15 00 00 00 58  00 00 01 68 00 00 04 68  | ......X...h...h|
 000195d0  00 00 0a 68 00 00 0a 68  00 00 10 68 00 00 10 68  |...h...h...h...h|

I can put the binary localedef archives online if you like

cheers, Marc

-- 
Pengutronix e.K.                         | Marc Kleine-Budde           |
Linux Solutions for Science and Industry | Phone: +49-231-2826-924     |
Vertretung West/Dortmund                 | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686         | http://www.pengutronix.de   |

Attachment: signature.asc
Description: OpenPGP digital signature