public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/51646] New: Make libgfortran compile on Android - without S_IREAD
@ 2011-12-21  8:33 burnus at gcc dot gnu.org
  2011-12-21 10:21 ` [Bug libfortran/51646] " jb at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-12-21  8:33 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51646

             Bug #: 51646
           Summary: Make libgfortran compile on Android - without S_IREAD
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: jb@gcc.gnu.org


Created attachment 26156
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26156
Draft patch

Janne: What do you think of the attached patch?

http://specificimpulses.blogspot.com/2011/01/my-android-speaks-fortran-yours-can-too.html
shows that gfortran can be build for on Android (= host + target).

However, Android's NDK does not support S_IREAD and S_IWRITE but only S_IRUSR
and S_IWUSR.

In the Linux man page I find:
       UNIX  V7 (and later systems) had S_IREAD, S_IWRITE, S_IEXEC, where POSIX
       prescribes the synonyms S_IRUSR, S_IWUSR, S_IXUSR.

While POSIX (IEEE Std 1003.1, 2003) just lists the latter:
       S_IRUSR
              Read permission, owner.
       S_IWUSR
              Write permission, owner.

Expected: If no S_IREAD/S_IWRITE is available, use S_IRUSR/S_IWUSR. (Or rather
the other way round, given that only the latter is standard.)

S_IREAD/S_IWRITE is
- checked for in LIBGFOR_CHECK_UNLINK_OPEN_FILE  (libgfortran/acinclude.m4)
- used in io/unix.c's id_from_fd

 * * *

In the blog, the existence of other issues is mentioned and it links to a hack:
http://aeromonkey.homeip.net/public/ugly_gfortran_hacks.patch
(Google cache:
http://webcache.googleusercontent.com/search?q=cache:khmjfgpFiAIJ:aeromonkey.homeip.net/public/ugly_gfortran_hacks.patch+aeromonkey.homeip.net/public/ugly_gfortran_hacks.patch
)

However, the patch/hack does not tell me much: It disable configure checking
(as_fn_exit returns 0 ("echo $1") instead of "exit $1") and in
intrinsics/date_and_time.c the "#ifndef" has been changed into an "#ifdef" for
HAVE_LOCALTIME_R and for HAVE_GMTIME_R.

Without config.log, one can probably not deduce what went wrong.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-04-18 13:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-21  8:33 [Bug libfortran/51646] New: Make libgfortran compile on Android - without S_IREAD burnus at gcc dot gnu.org
2011-12-21 10:21 ` [Bug libfortran/51646] " jb at gcc dot gnu.org
2011-12-21 10:26 ` jb at gcc dot gnu.org
2011-12-22 20:50 ` jb at gcc dot gnu.org
2011-12-22 21:18 ` [Bug libfortran/51646] Make libgfortran compile on Android jb at gcc dot gnu.org
2012-04-18  8:33 ` jb at gcc dot gnu.org
2012-04-18 12:39 ` burnus at gcc dot gnu.org
2012-04-18 13:10 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).