md4/md5: disable optimization causing unaligned access
authorChristian Göttsche <cgzones@googlemail.com>
Tue, 7 Dec 2021 12:01:10 +0000 (13:01 +0100)
committerNoah Meyerhans <noahm@debian.org>
Sat, 17 Aug 2024 17:26:24 +0000 (13:26 -0400)
commitd2e2d6027228b1e3b2fefba3dcfcfda49c12af87
treeddd8630b94d041e767216b61e0457191480c10a8
parent2e0866d7f5400f5ff9653ea50e38b8c0f325d8d0
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