diff --git a/local/recipes/dev/gcc-native/recipe.toml b/local/recipes/dev/gcc-native/recipe.toml index b0f46cb8db..0a58d035ca 100644 --- a/local/recipes/dev/gcc-native/recipe.toml +++ b/local/recipes/dev/gcc-native/recipe.toml @@ -50,6 +50,14 @@ DYNAMIC_INIT # gcc/config/i386/i386.h:1722: error: unknown type name 'bool' # Drop the pin for this recipe so the compiler builds at the standard its own # sources are written in. +# GCC's own include/ must precede the sysroot. libiberty compiles getopt1.c +# against GCC's include/getopt.h, which declares the GNU-internal +# _getopt_internal; relibc ships a getopt.h that does not, and it otherwise +# shadows GCC's: +# getopt1.c:71: error: implicit declaration of function '_getopt_internal' +# Same shape as the cpuid.h shadowing in recipes/dev/gcc13. +export CPPFLAGS="-I${COOKBOOK_SOURCE}/include ${CPPFLAGS}" + export CFLAGS="${CFLAGS//-std=gnu17/}" export CXXFLAGS="${CXXFLAGS//-std=gnu17/}"