From owner-freebsd-hackers@freebsd.org Thu May 10 17:38:19 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14EF4FD17F6 for ; Thu, 10 May 2018 17:38:19 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 88C2171397 for ; Thu, 10 May 2018 17:38:18 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id w4AHcG5Q046902 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 10 May 2018 10:38:16 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id w4AHcGMC046901; Thu, 10 May 2018 10:38:16 -0700 (PDT) (envelope-from sgk) Date: Thu, 10 May 2018 10:38:16 -0700 From: Steve Kargl To: Kurt Lidl Cc: freebsd-hackers@freebsd.org Subject: Re: Runtime loader issue Message-ID: <20180510173816.GB46553@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: <20180509234551.GA39526@troutmask.apl.washington.edu> <20180510142452.GA69005@night.db.net> <20180510151522.GA43677@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 May 2018 17:38:19 -0000 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