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, 30 Jul 2022 02:58:28 +0000 (19:58 -0700)
commit1ba6ada251d3922ae0d6e40db3cd5f05cce68157
tree9c6d77a53b8ca194acc4651c4efd90ccd48bb74d
parentdf27079d9ee37a66700ed9949a726883b20f09ac
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