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

2021-09-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58939

--- Comment #2 from Andrew Pinski  ---
Interesting POSIX requires st_size to be off_t.  I see it is long long on some
platforms of bionic.

https://android.googlesource.com/platform/bionic/+/refs/heads/master/libc/include/sys/stat.h

I don't know if there is a way to support this correctly.
because using off_t will cause a truncatation.

Likewise for st_mtime too.

I don't know the right away to fix this without major changes to the sources.

So the question becomes do we want to support non-POSIX targets for these
structs here?

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

2013-11-03 Thread chaselton at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58939

--- Comment #1 from chaselton chaselton at gmail dot com ---
UPDATE: 
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,
 file-buffer_start,
++ ot
 /*file-st.st_size*/);
++  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
successfully

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


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

2013-11-02 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58939

Jonathan Wakely redi at gcc dot gnu.org changed:

   What|Removed |Added

   Severity|blocker |normal