Bug#522673: [PATCH] Make h2ph look in "include-fixed", needed by at least gcc 4.3

Nicholas Clark nick at ccl4.org
Mon Apr 6 12:47:41 UTC 2009


On Sun, Apr 05, 2009 at 10:29:38PM +0300, Niko Tyni wrote:
> As seen in <http://bugs.debian.org/522673>, since 4.2.0 or so
> gcc's search path has a new "include-fixed" directory,
> which currently contains <syslimits.h> and a few other headers.
> 
> Converting <syslimits.h> therefore fails unless h2ph knows about the new
> directory too.
> 
> See http://gcc.gnu.org/ml/gcc-patches/2007-02/msg02038.html for some
> background to the gcc change.
> ---
>  utils/h2ph.PL |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/utils/h2ph.PL b/utils/h2ph.PL
> index a3ff285..6f40126 100644
> --- a/utils/h2ph.PL
> +++ b/utils/h2ph.PL
> @@ -743,7 +743,7 @@ sub queue_includes_from
>  
>  
>  # Determine include directories; $Config{usrinc} should be enough for (all
> -# non-GCC?) C compilers, but gcc uses an additional include directory.
> +# non-GCC?) C compilers, but gcc uses additional include directories.
>  sub inc_dirs
>  {
>      my $from_gcc    = `LC_ALL=C $Config{cc} -v 2>&1`;
> @@ -755,7 +755,7 @@ sub inc_dirs
>             $from_gcc = '';
>         };
>      };
> -    length($from_gcc) ? ($from_gcc, $Config{usrinc}) : ($Config{usrinc});
> +    length($from_gcc) ? ($from_gcc, $from_gcc . "-fixed", $Config{usrinc}) : ($Config{usrinc});
>  }

Does every version of gcc that ends up in the "gcc-4+" block know about the
'-fixed' command line flag? It's not clear to me from the thread you link to.
If not, then they're going to choke on it.

# Determine include directories; $Config{usrinc} should be enough for (all
# non-GCC?) C compilers, but gcc uses an additional include directory.
sub inc_dirs
{
    my $from_gcc    = `LC_ALL=C $Config{cc} -v 2>&1`;
    if( !( $from_gcc =~ s:^Reading specs from (.*?)/specs\b.*:$1/include:s ) )
    { # gcc-4+ :
       $from_gcc   = `LC_ALL=C $Config{cc} -print-search-dirs 2>&1`;
       if ( !($from_gcc =~ s/^install:\s*([^\s]+[^\s\/])([\s\/]*).*$/$1\/include/s) )
       {
           $from_gcc = '';
       };
    };
    length($from_gcc) ? ($from_gcc, $Config{usrinc}) : ($Config{usrinc});
}

Nicholas Clark






More information about the Perl-maintainers mailing list