https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82718
--- Comment #6 from Mark Wielaard <mark at gcc dot gnu.org> --- Building elfutils with -g -O2 -gdwarf-5 still fails without this patch with current gcc trunk (just in a different file libdwfl/realloc.c instead of elf_begin.c as reported originally). Using the proposed patch https://gcc.gnu.org/ml/gcc-patches/2017-10/msg01895.html makes it build fine. BTW. Building with -gdwarf-5 didn't fail with GCC 7.2.