The archiver class is used to obtain the sources used to build the distribution, it has different options; see http://www.yoctoproject.org/docs/1.8/mega-manual/mega-manual.html#maintaining-open-source-license-compliance-during-your-products-lifecycle for more info. When using: ARCHIVER_MODE[src] = "patched" to obtain the patched sources, we obtain an error like the following: ERROR: Command Error: exit status: 1 Output: Applying patch 0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch patching file configure Reversed (or previously applied) patch detected! Assume -R? [n] Apply anyway? [n] Skipping patch. 1 out of 1 hunk ignored -- saving rejects to file configure.rej Patch 0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch appears to be empty; applied ERROR: Function failed: patch_do_patch This simply states that bitbake tried to apply a patch, but that patch had already been applied so it skips it (which is good), but this still causes the task to fail, hence the build fails too. This is caused because gcc packages use a shared directory for performance and space efficiency (http://www.yoctoproject.org/docs/1.8/mega-manual/mega-manual.html#structure-build-work-shared), now, since several packages use the same source, the first task to patch the source will patch it correctly and succeed, but the second one will find an already patched source and produce the error mentioned above. I believe gcc packages were initially not supported by the archiver class for this same reason, it appears to me that using shared states to check whether or not the patches have already been applied is not an option (although I don't know much about SSTATES), since these refer to different tasks for different packages, another option would be to create a specific case to handle gcc packages, perhaps somehow check if the source is already patched and simply return, or do not support gcc packages on the archiver class at all.
Solved here: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=99fc78653a6933e24e57aed9df246b3fda529ca8
My mistake, this wasn't fixed completely, working on it
This started causing errors with the kernel too, a race condition was created when using patched sources between kernel_configme and unpack_and_patch, producing errors during kernel configuration. Also, as Richard Purdie noted, we don't need to have multiple identical gcc source tarballs. I sent a patch to the ML fixing both these new issues along with the original one.
Fixed: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=2f0ff3abb448dc23d9420986fcbab80c9da7cd25
Verified on master 2cd061a29a94fdcdfec86732e6bcbb71c12c4afc