hardened_malloc icon indicating copy to clipboard operation
hardened_malloc copied to clipboard

Build broken with `-Wall -ffat-lto-objects`

Open rusty-snake opened this issue 3 years ago • 1 comments

I build an rpm package (source) for hardened_malloc to installed it via dnf so dependencies/uninstalling are less likely to make trouble.

However after I upgraded to Fedora 36 hardened_malloc fails to build with

chacha.c: In function 'chacha_keystream_bytes':
chacha.c:73:9: error: 'ctarget' may be used uninitialized [-Werror=maybe-uninitialized]
   73 |     u8 *ctarget;
      |

This happens because rpmbuild adds it's own compiler flags (=it does not happen with an plain make). I could narrow it down to CFLAGS="-ffat-lto-objects -Wall" make. However IDK if this is a bug in hardened_malloc or gcc or if this is cause by newer gcc or rpmbuild version.

OS: Fedora Linux 36 gcc: 12.1.1 20220507 (Red Hat 12.1.1-1) hardened_malloc: 0d6d63c / 11

rusty-snake avatar Jun 07 '22 18:06 rusty-snake

It's not a bug. It's a false positive warning. This code comes from the ChaCha reference implementation and we don't want to change it much to avoid introducing any bugs.

thestinger avatar Jun 07 '22 18:06 thestinger