atm, we enable the poisoned system flags only for cross-compilers. we should make these flags always available (even native toolchains), and by default only enable the warning when the active sysroot is not /.
I guess it's specifically about the https://gitweb.gentoo.org/repo/gentoo.git/tree/eclass/toolchain.eclass#n1018: ### Cross-compiler options if is_crosscompile ; then # Enable build warnings by default with cross-compilers when system # paths are included (e.g. via -I flags). confgcc+=( --enable-poison-system-directories )
Gentoo stopped applying gcc-poison-system-directories.patch after gcc-5.5.0. openembedded has a refreshed version of the patch: http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-devtools/gcc/gcc-9.2/0002-gcc-poison-system-directories.patch Does not looks like the patch ever meant to be applied upstream. I suggest upstreaming some form of this patch instead and make enhancements there.