gcc 4.7.0 bash install script updated to support binutils-2.22

This week I updated the gcc-4.7.0 bash install script to include binutils-2.22 with gold support enabled. See this blog entry to download it. I found a number of type-casting problems in the code so to get it to work I had to set the –disable-werror option in the configuration. There was one serious coding problem in the parse_uint function at line 196 in the gold/options.cc file. The logic is testing
retval<0
instead of
*retval<0
. Fortunately, this code does not seem to be used.
void
parse_uint(const char* option_name, const char* arg, int* retval)
{
  char* endptr;
  *retval = strtol(arg, &endptr, 0);
  if (*endptr != '\0' || retval < 0) // should be *retval<0
    gold_fatal(_("%s: invalid option value (expected an integer): %s"),
               option_name, arg);
}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.