[Bug 231965] [PowerPC64] Cross compiling powerpc64 from amd64 results in nonfunctional locale installations

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Oct 17 20:10:08 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231965

Yuri Pankov <yuripv at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yuripv at FreeBSD.org

--- Comment #2 from Yuri Pankov <yuripv at FreeBSD.org> ---
Looking at this, I wonder if powerpc ISOs (at least, 12-ALPHA10 snapshot)
cross-compiled on amd64 as the locale data files are matching the ones on my
amd64 system.

In any case, it looks like the check in lib/libc/locale/endian.h needs to
include __powerpc__ as well, or just check for big endian.  I've cross-compiled
libc with the following change on amd64, and was able to run simple test
program just doing setlocale(), and even run tmux preloading the resulting
libc.so.7:

diff --git a/lib/libc/locale/endian.h b/lib/libc/locale/endian.h
index d3b822788688..ade03bdc8997 100644
--- a/lib/libc/locale/endian.h
+++ b/lib/libc/locale/endian.h
@@ -45,7 +45,7 @@
  * correct macros here.
  */

-#if BYTE_ORDER == BIG_ENDIAN && defined(__mips__)
+#if BYTE_ORDER == BIG_ENDIAN
 #define        BSWAP(x)        le32toh(x)
 #else
 #define        BSWAP(x)        x

I'm NOT sure if this is correct for all cases, and if it will not break native
powerpc builds, need to investigate a bit more.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list