Date: Sun, 14 Aug 2016 17:20:32 -0700 From: Steve Kargl <sgk@troutmask.apl.washington.edu> To: Diane Bruce <db@db.net> Cc: freebsd-ports@freebsd.org, freebsd-toolchain@freebsd.org Subject: Re: Problems with out libgcc_s.so in base Message-ID: <20160815002032.GA10882@troutmask.apl.washington.edu> In-Reply-To: <20160814233430.GA35872@night.db.net> References: <20160814230351.GA10587@troutmask.apl.washington.edu> <20160814233430.GA35872@night.db.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Aug 14, 2016 at 07:34:30PM -0400, Diane Bruce wrote: > On Sun, Aug 14, 2016 at 04:03:51PM -0700, Steve Kargl wrote: > > > > FreeBSD-ports could avoid libquadmath issues by building gcc > > without it. See --without-libquadmath or --without-quadmath (I > > don't remember the config option because it would be questionable > > to neuter one of gfortran's strength). > > Correct. This blog entry I read some months ago outlines this > exact problem we are having and suggests the identical solution. > > http://glennklockwood.blogspot.ca/2014/02/linux-perf-libquadmath-and-gfortrans.html > > quadmath does have an impact on performance. > I read that blog a long time ago. It is quite humorous, because the author does not understand the storage requirements of Fortran. If one uses only the -fdefault-real-8 option to promote REAL to DOUBLE PRECISION, then storage requirements mandate that DP should be promoted to QP (if available). That's why there is the -fdefault-double-8. In additions, these options were never meant to be used in a situation where performance matters. These options are a crutch for lazy programmers, who don't want to properly port code to a wider precision. As the person who actually implemented these options in gfortran for backwards compatibility with g77, I can assure that very few people know what these options do. The problem lies in Fortran's COMMON and EQUIVALENCE statements, where storage alignment can be messed up by the -fdefault-* options. Other than properly porting code to a wider type, people should use the -freal-* (eg, -freal-4-real-8). I submitted a patch to fortran@gcc to deprecate the -fdefault-* option in January. The deprecation who have occurred over 2 major releases. But, too many people objected under POLA. > > Freebsd-ports could also use a wrapper: > > % cat ~/bin/gfc7 > > #! /bin/sh > > Yes. I have also suggested we use a wrapper to the ports guys. > There always the option to link apps that need libgfortran with the -static option. -- Steve
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160815002032.GA10882>