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>
Sun, 10 Mar 2024 06:31:22 +0000 (22:31 -0800)
commit98b0e2be3fe3f07d5a030545e57effa9e3bb0efb
tree1ad0105834fb35a9f0dc247fa6f59a93ddd1651e
parent5a38ee73f89835f6b9f6a83a9ba65bc0e31b4934
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