Bug 16319

Summary: Checksum validation is not working on big endian targets
Product: [Yocto Project Subprojects] opkg Reporter: Michal Sieron <michalwsieron>
Component: opkgAssignee: Alex Stewart <alex.stewart>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: Medium+    
Version: 0.9.0   
Target Milestone: next-patch   
Hardware: Other   
OS: mips64   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Regression (Used to work)
Verified: Documentation change: No (bug/feature does not impact docs)

Description Michal Sieron 2026-06-16 12:57:15 UTC
CMake based setup does not configure big-endian builds correctly.

Autoconf based setup used (https://git.yoctoproject.org/opkg/tree/configure.ac?h=v0.8.0#n260):
```
# Checks endianness
AC_C_BIGENDIAN(BIGENDIAN_CFLAGS="-DWORDS_BIGENDIAN=1",)
AC_SUBST(BIGENDIAN_CFLAGS)
```
to define `WORDS_BIGENDIAN`, which is used in md5.c and sha256.c to define `SWAP` macro.
With new CMake based setup this is no longer the case, and checksum validation doesn't work.

We hit this on a mips64 target, but I assume some powerpc targets are affected as well.
Comment 1 Alex Stewart 2026-06-16 16:16:09 UTC
Fixed by Michal's commit a56ca271876c8a6ff6540f8b68d7969357207b05.

https://git.yoctoproject.org/opkg/commit/?id=a56ca271876c8a6ff6540f8b68d7969357207b05