[Bug preprocessor/58939] Cannot Cross-Build Android Native GCC 4.8 libcpp build conversion errors

chaselton at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Nov 3 17:27:00 GMT 2013


--- Comment #1 from chaselton <chaselton at gmail dot com> ---
Thanks to Jonathan Wakely and Ian Taylor for providing the codefixes.
This bug is resolved by adding the following to files.c

in lines 715-726:
  if (regular && total != size && STAT_SIZE_RELIABLE (file->st))
    cpp_error (pfile, CPP_DL_WARNING,
           "%s is shorter than expected", file->path);
++  off_t ot = file->st.st_size;
  file->buffer = _cpp_convert_input (pfile,
                     CPP_OPTION (pfile, input_charset),
                     buf, size + 16, total,
++                     &ot
++  file->st.st_size = ot;
  file->buffer_valid = true;

NOTE:  The following also must be added to macro.c in order for libcpp to build

in lines 248-253:
        if (st)
++              time_t t = (time_t) st->st_mtime;
++              tb = localtime (&t);
              /* tb = localtime (&st->st_mtime); */

More information about the Gcc-bugs mailing list