md4/md5: disable optimization causing unaligned access
authorChristian Göttsche <cgzones@googlemail.com>
Tue, 7 Dec 2021 12:01:10 +0000 (13:01 +0100)
committerPeter Michael Green <plugwash@raspbian.org>
Thu, 20 Jun 2024 17:16:27 +0000 (17:16 +0000)
commitfd9950f272b093e3f5dca66eb7f613a18a2f4e06
treeb122a07a9b2ba3d284984bd0f7f35fd123a7ebf1
parent5d35d7fd7da198c533ad5fa47b1339ec81b30002
md4/md5: disable optimization causing unaligned access

This restores unit tests with GCC 11 and LTO.

    md5.c:92:23: warning: cast from 'const unsigned char *' to 'const uint32_t *' (aka 'const unsigned int *') increases required alignment from 1 to 4 [-Wcast-align]
                    STEP(F, a, b, c, d, SET(0), 0xd76aa478, 7)
                    ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
    md5.c:51:4: note: expanded from macro 'SET'
            (*(const uint32_t *)&ptr[(n) * 4])
              ^
    md5.c:37:29: note: expanded from macro 'STEP'
            (a) += f((b), (c), (d)) + (x) + (t); \
                                       ^

    md5.c:92:3: runtime error: load of misaligned address 0x61900000008b for type 'const uint32_t' (aka 'const unsigned int'), which requires 4 byte alignment
    0x61900000008b: note: pointer points here
     41  41 41 41 41 41 41 41 41  41 41 41 41 41 41 41 41  41 41 41 41 41 41 41 41  41 41 41 41 41 41 41
                  ^

Gbp-Pq: Name md4-md5-disable-optimization-causing-unaligned-access.patch
src/lib/md4.c
src/lib/md5.c