On Wed, Sep 17, 2025 at 3:18 AM Andrew Pinski
<[email protected]> wrote:
>
> While running uninclude on PR99912's preprocessed source uninclude
> didn't uninclude some of the x86_64 target headers. This was because
> `lib/gcc/<anything>/include` was not noticed as an possible system
> include dir. It supported `gcc-lib/<anything>/include` though.
OK, but I'll note that sometimes this can break things given new
intrinsics can be added in later compilers only.
> contrib/ChangeLog:
>
> * uninclude: Add `lib/gcc/<anything>/include`.
> ---
> contrib/uninclude | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/uninclude b/contrib/uninclude
> index 5612e655a98..f445bfeeb05 100755
> --- a/contrib/uninclude
> +++ b/contrib/uninclude
> @@ -27,13 +27,14 @@
>
> # Header files whose pathnames contain any of the following patterns
> # are considered as standard headers: usr/include, g++-include,
> -# include/g++, include/c++/<version>, gcc-lib/<anything>/include.
> +# include/g++, include/c++/<version>, gcc-lib/<anything>/include,
> +# lib/gcc/<anything>/include.
>
> gawk ${EXCLUDEPATT+-vexclude="$EXCLUDEPATT"} \
> ${INCLUDEPATT+-vinclude="$INCLUDEPATT"} '
> BEGIN {
> skipping = 0;
> - cppline = "^# [0-9]+
> \"[^\"]*/(usr/include|g\\+\\+-include|include/g\\+\\+|include/c\\+\\+/[^/]+|gcc-lib/[^\"]+/include|gcc/include)/([^\"]+)\"(
> [1-4])*$"
> + cppline = "^# [0-9]+
> \"[^\"]*/(usr/include|g\\+\\+-include|include/g\\+\\+|include/c\\+\\+/[^/]+|gcc-lib/[^\"]+/include|lib/gcc/[^\"]+/include|gcc/include)/([^\"]+)\"(
> [1-4])*$"
> }
> !skipping && $0 ~ cppline &&
> (exclude == "" || $3 !~ exclude) && (include == "" || $3 ~ include) {
> --
> 2.43.0
>