This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc 3.2's cpp breaks configure scripts


On Sun, 11 Aug 2002, John David Anglin mused:
> Jeff,
> 
>> cpp is spitting out a warning about changing the search order of include
>> directories, and this is breaking a _ton_ of configure scripts. I found
>> this when I started rebuilding Mandrake with gcc-3.2 branch.
> 
> You might try the patch below and see if it fixes your problem.  It is a
> variant for gcc-3.2 branch of the patch proposed in this message for the
> main: <http://gcc.gnu.org/ml/gcc-patches/2002-08/msg00708.html>.

Nice :)

> +   This algorithm is quadratic in the number of -I switches, which is
> +   acceptable since there aren't usually that many of them.  */

You could invert it to yield something that was quadratic in the number
of system directories, which might be preferable since the number of
system directories is fixed and may be quite low compared to the silly
number of -I flags used by some programs (look at Evolution build one of
these days); something like

static struct search_path *
remove_dup_nonsys_dirs (pfile, head_ptr, end)
     cpp_reader *pfile;
     struct search_path **head_ptr;
     struct search_path *end;
{
  struct search_path *cur;

  for (cur = *head_ptr; cur != end; cur = cur ? cur->next : *head_ptr)
    if (cur->sysp)
      {
	struct search_path *prev, *other;
        for (other = *head_ptr, prev = NULL; other && other != cur;
             other = other->next)
          {
            if (INO_T_EQ (cur->ino, other->ino)
                && cur->dev == other->dev
                && !(other->sysp))
              {
                other = remove_dup_dir (pfile, prev, head_ptr);
                break;
	      }
            prev = other;
          }
      }

  return prev;
}

(I'm not sure whether the head_ptr manipulation in the outer loop is
needed anymore, and this is utterly untested).

> +system include directories, GCC will ignore the option so that system
> +directories are continued to be processed in the correct order.  This

s/are continued to be/continue to be/

> +Sites that need to install multiple versions of GCC may not want to
> +use the above simple configuration.  It is possible to use the
> +@option{--program-prefix}, @option{--program-suffix} and
> +@option{--program-transform-name} options to install multiple versions
> +into a single directory,

Even though I've done this myself forever, it *is* quite tricky to keep
libstdc++ working for multiple GCC versions in that situation.

(--enable-version-specific-runtime-libs or waiting for GCC 3.3 is the
solution to that, of course.)

-- 
`There's something satisfying about killing JWZ over and over again.'
                                        -- 1i, personal communication


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]