From owner-freebsd-hackers@freebsd.org Thu Oct 18 04:21:18 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5C1910C895D for ; Thu, 18 Oct 2018 04:21:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua1-x930.google.com (mail-ua1-x930.google.com [IPv6:2607:f8b0:4864:20::930]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DCEC791B8 for ; Thu, 18 Oct 2018 04:21:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua1-x930.google.com with SMTP id y5so5651133uap.4 for ; Wed, 17 Oct 2018 21:21:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=m6lIHcCVwLEcHhQYpSqKGNLp7+AYA1ODnWO8qmVRyYc=; b=NiJPTATEqq21MIyO5qRlzPl6jnDp5Rk/SPHUtIniv4bZQrs2Ccz5SZxX2sb/ewqHN/ UnDqa4fWhMQl5IBv4+yg2KNXjF8zs4lglRQZcc9P+rgrJBGy9XBWpiWym+jylSU3WJ6W Q9bDNWIIxUpe7ENqgwpgGtkcIS9zW8+fTK1YOYRUnCmzoZ73E9V2vfHCsHQkj9/0LrLD LTvhrExYeNgaA4NKnExSmN5d/4JOYTiBvYS41x/uA0Lc+cNJ9TV2j5+r+RteBh2Ad8Oq HAwFioWHZ11LvFnUMF1vwHQCxXx1cmYHDgDD9uFG1VmPfOWEfSC15SyYgQZiq6oftPJu z9PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=m6lIHcCVwLEcHhQYpSqKGNLp7+AYA1ODnWO8qmVRyYc=; b=GgGxZ46tXrOmD7RYThLMk2kZ3/wZ+ALJd4Iei1imW/YdfVIjbfWcYcoQ4h1QgKtjR9 KQSufSC1Dw+2BzYr5SLQlNWkdPbXGJrxqw90T1ILJ90Uqja2+s4+3o3kdr2s3BiVch9y 0qZTGh1wj0o209ERrGQfTWgtTUJdo7zTxAI0iSG3FUIYp1FdKWH8X0vHy7PSqzrftgXX V0pGEOYOF9ZxXlO63wrhlU8JtLN/l2T2noUgXD9zg4IIEHfofFTthW1tM58oNxnJEoks DDHzEDMMlHepgSuK2P9dF4rt1AP/uYFEs1lsNaXevDoEQnAiK0IDdfIRtZx15WHG5OuO ucaw== X-Gm-Message-State: ABuFfogVkyI2GA2Ak0jWwVqEYQETk6WuJNLnTnuk4ctlMa33bJYsbpqf 92F03ZY2SJbx4ENF5jpmHxXFxhCicQt8JS1x8FGVqA== X-Google-Smtp-Source: ACcGV62HEYROLEeN4DuZOqzz3ExSiZoAmcWYlCT/AwLxsMz8TZ/rt0ojyb0WlDIXkoVHkLwYscTYClDgOoBeyoyBU7o= X-Received: by 2002:ab0:a97:: with SMTP id d23mr12588302uak.39.1539836476526; Wed, 17 Oct 2018 21:21:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Wed, 17 Oct 2018 22:21:05 -0600 Message-ID: Subject: Re: embed endian info in locale data files magic (PR231965) To: Yuri Pankov Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2018 04:21:18 -0000 On Wed, Oct 17, 2018 at 10:18 PM Yuri Pankov wrote: > Yuri Pankov wrote: > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231965 ([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). > > > > Fix introduced in rS308170 depends on the fact that locale data is built > > 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: > > > > 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 > change. > I like this. Warner