Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Oct 2018 04:58:58 +0300
From:      Yuri Pankov <yuripv@yuripv.net>
To:        freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: embed endian info in locale data files magic (PR231965)
Message-ID:  <abaa1192-defc-973e-8d0f-b8e5a2437c0d@yuripv.net>
In-Reply-To: <f081ab81-56d0-49cc-92b0-fadc09618d31@yuripv.net>
References:  <f081ab81-56d0-49cc-92b0-fadc09618d31@yuripv.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--1PLmTiomysntfNknvXhyS0R0pJqI4h7pF
Content-Type: multipart/mixed; boundary="V7dAMGwHWZv6qJlfJX3KibuOQEFFSHKLP";
 protected-headers="v1"
From: Yuri Pankov <yuripv@yuripv.net>
To: freebsd-hackers <freebsd-hackers@freebsd.org>
Message-ID: <abaa1192-defc-973e-8d0f-b8e5a2437c0d@yuripv.net>
Subject: Re: embed endian info in locale data files magic (PR231965)
References: <f081ab81-56d0-49cc-92b0-fadc09618d31@yuripv.net>
In-Reply-To: <f081ab81-56d0-49cc-92b0-fadc09618d31@yuripv.net>

--V7dAMGwHWZv6qJlfJX3KibuOQEFFSHKLP
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

Yuri Pankov wrote:
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231965 ([PowerPC64]=

> Cross compiling powerpc64 from amd64 results in nonfunctional locale
> installations), describes the issue with locale data built on LE system=

> (amd64) when used on BE system (powerpc).
>=20
> Fix introduced in rS308170 depends on the fact that locale data is buil=
t
> on LE system, and will likely fail when it's built natively on mips
> (please correct me if I'm wrong).  More so, we shouldn't be hardcoding
> the conversion in libc, and I see 2 options here:
>=20
> 1. fix localedef to output data in target's system endian
> 2. embed the endian info in locale data files (updating magic signature=
)
>    and ehhance the previous fix with runtime selection of needed
>    conversion

Thinking more about this, or:

3. Always store the data in LE (or BE, doesn't matter), and
appropriately convert while reading.  This will likely require least chan=
ge.

> I have put the change for #2 together at
> https://reviews.freebsd.org/D17603 (more a PoC at the moment than a rea=
l
> review), and wondering if it looks sane enough or if there's anything
> obvious I'm missing.
>=20
> I have briefly tested the libc and locale files (LC_CTYPE and
> LC_COLLATE) built on amd64 on a powerpc system, and it seems to work.
>=20
> TIA
>=20



--V7dAMGwHWZv6qJlfJX3KibuOQEFFSHKLP--

--1PLmTiomysntfNknvXhyS0R0pJqI4h7pF
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEE+Gq3PsPeLT4tL/9wk4vgf7Eq4WwFAlvH6OIACgkQk4vgf7Eq
4WxjrggAhY+fwpVV+PI7cSvxAJayX5bf4qtXjploX2GsLcA/OK3ZpVFPtlPmgrHK
P8tENd7U34pufS5lTrnov7Uv7OEWsiOtK890NyNQFYMeqWDdVsNIctzfteu2sR8c
wUOvnEcZ6+uANDWH2owlB7K+caM1nhhkT184tlpKGM+RGoeg13OGEib9lcJvDvqQ
8e771orSth2wMNqFmamYlxGj/llx5OjCkj+nyjhN8c2eaAlxw2YbJoAEt7MF6axk
+ZSrlbrxwEjeh9r4ifz2FowviHjw+4/kR0WGkLmIPvnVT7Sg+6pDbG76lHYQ/CuU
5eqOWDSqYajbi7Kb3qWEZuj+xCoEkw==
=rtsl
-----END PGP SIGNATURE-----

--1PLmTiomysntfNknvXhyS0R0pJqI4h7pF--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?abaa1192-defc-973e-8d0f-b8e5a2437c0d>