Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 May 2018 10:38:16 -0700
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        Kurt Lidl <lidl@pix.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Runtime loader issue
Message-ID:  <20180510173816.GB46553@troutmask.apl.washington.edu>
In-Reply-To: <ea5d1b58-1b19-a283-bccd-2b6d466e6dcd@pix.net>
References:  <20180509234551.GA39526@troutmask.apl.washington.edu> <CALH631=DK=k2jfOqnQ0OeYCwZG0XQwqq1pjPYTH_=f8xmYDvjw@mail.gmail.com> <20180510142452.GA69005@night.db.net> <20180510151522.GA43677@troutmask.apl.washington.edu> <ea5d1b58-1b19-a283-bccd-2b6d466e6dcd@pix.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, May 10, 2018 at 11:23:39AM -0400, Kurt Lidl wrote:
> On 5/10/18 11:15 AM, Steve Kargl wrote:
> > On Thu, May 10, 2018 at 10:24:52AM -0400, Diane Bruce wrote:
> >>
> >> Agreed, however this has the side effect of meaning conflicts with libraries
> >> between clang and gcc libs. Notably gfortran and flang use different
> >> conventions for I/O :(
> >>
> >> See http://people.FreeeBSD.org/~db/fortran_libs.txt
> > 
> > Page doesn't appear to exist?  If I go to
> > 
> > https://people.freebsd.org/homepage.html
> > 
> > you're not listed.
> 
> There's one too many "e" characters in the given URI.
> 
> Correct URI: http://people.FreeBSD.org/~db/fortran_libs.txt
> 

Ah, thanks!  I simply copy-n-pasted the link, then went to
the homepage.html via a bookmark.

The incompatibility in IO runtimes between gfortran and
flang is a minor issue for anyone using actual modern
Fortran, and in particular, Fortran's MODULE feature.

% cat m.f90
module foo
   implicit none
   real :: pi = 3.14
   contains
     function real_pi() result(p)
         real p
         p = atan(1.)
     end function real_pi
end module foo
% gfortran6 -c m.f90
% nm m.o
0000000000000000 D __foo_MOD_pi
0000000000000000 T __foo_MOD_real_pi
% file foo.mod
foo.mod: gzip compressed data, from Unix
% flang -c m.f90
% nm m.o
0000000000000000 r .C288_foo_real_pi_
0000000000000000 r .LCPI1_0
0000000000000000 D _foo_8_
0000000000000000 T foo_
0000000000000010 T foo_real_pi_
% file foo.mod
foo.mod: ASCII text

foo.mod can be thought of as a pre-compile header.
It will encode the named constant pi and a signature
for the function real_pi.  The object files contain
name-mangled entry points for the function.  The
Fortran Standard(s) do not specify implementation detail,
so there is an incompatibility between not only
gfortran and flang, but all Fortran compiler vendors. 

-- 
Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180510173816.GB46553>