If elfutils rebuilds from an existing work directory, do_patch fails: ERROR: Command Error: exit status: 1 Output: Applying patch redhat-portability.diff patching file backends/ChangeLog patching file backends/Makefile.am patching file backends/Makefile.in patching file ChangeLog patching file config/ChangeLog patching file config/eu.am patching file config/Makefile.in Hunk #1 succeeded at 147 (offset 1 line). Hunk #2 succeeded at 179 (offset 1 line). patching file config.h.in patching file configure Hunk #1 FAILED at 661. Hunk #2 FAILED at 678. Hunk #3 FAILED at 802. Hunk #4 FAILED at 1461. Hunk #5 succeeded at 4943 with fuzz 1 (offset 234 lines). Hunk #6 FAILED at 4869. Hunk #7 succeeded at 5535 (offset 256 lines). Hunk #8 FAILED at 6015. Hunk #9 succeeded at 7010 with fuzz 1 (offset 257 lines). 6 out of 9 hunks FAILED -- rejects in file configure patching file configure.ac patching file lib/ChangeLog patching file lib/eu-config.h patching file lib/Makefile.in patching file libasm/ChangeLog patching file libasm/Makefile.in patching file libcpu/ChangeLog patching file libcpu/i386_disasm.c patching file libcpu/Makefile.in patching file libdw/ChangeLog patching file libdw/dwarf_begin_elf.c patching file libdw/libdw.h patching file libdw/Makefile.in patching file libdwfl/ChangeLog patching file libdwfl/linux-core-attach.c patching file libdwfl/linux-pid-attach.c patching file libdwfl/Makefile.in patching file libebl/ChangeLog patching file libebl/Makefile.in patching file libelf/ChangeLog patching file libelf/common.h patching file libelf/gnuhash_xlate.h patching file libelf/Makefile.in patching file m4/Makefile.in patching file Makefile.in patching file src/addr2line.c patching file src/ChangeLog patching file src/findtextrel.c patching file src/ld.h patching file src/Makefile.am patching file src/Makefile.in patching file src/readelf.c patching file src/strings.c patching file src/strip.c patching file tests/backtrace.c patching file tests/ChangeLog patching file tests/line2addr.c patching file tests/Makefile.in Patch redhat-portability.diff does not apply (enforce with -f) ERROR: Function failed: patch_do_patch ERROR: Logfile of failure stored in: /data/poky-master/tmp/work/x86_64-linux/elfutils-native/0.158-r0/temp/log.do_patch.4404 ERROR: Task 204 (virtual:native:/home/ross/Yocto/poky/meta/recipes-devtools/elfutils/elfutils_0.158.bb, do_patch) failed with exit code '1' It's patching generated files, every Makefile.in and configure should be removed from that patch.
A reproducer should be bitbake elfutils; bitbake elfutils -C patch.