From owner-freebsd-standards@freebsd.org Thu Jan 31 16:50:28 2019 Return-Path: Delivered-To: freebsd-standards@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 4A74B14AFCA8; Thu, 31 Jan 2019 16:50:28 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C706096A5E; Thu, 31 Jan 2019 16:50:26 +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 x0VGoO12024300 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 31 Jan 2019 08:50:24 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id x0VGoODZ024299; Thu, 31 Jan 2019 08:50:24 -0800 (PST) (envelope-from sgk) Date: Thu, 31 Jan 2019 08:50:24 -0800 From: Steve Kargl To: Warner Losh Cc: FreeBSD Standards , "freebsd-toolchain@FreeBSD.org" Subject: Re: Is libc C99 compliant? Message-ID: <20190131165024.GC23821@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: <20190130212904.GA66299@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.11.2 (2019-01-07) X-Rspamd-Queue-Id: C706096A5E X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [4.59 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; HAS_REPLYTO(0.00)[sgk@troutmask.apl.washington.edu]; TO_DN_SOME(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; RCVD_IN_DNSWL_MED(-0.20)[21.76.95.128.list.dnswl.org : 127.0.11.2]; MX_GOOD(-0.01)[cached: troutmask.apl.washington.edu]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.16)[ip: (0.39), ipnet: 128.95.0.0/16(0.40), asn: 73(0.10), country: US(-0.07)]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:73, ipnet:128.95.0.0/16, country:US]; SUBJECT_ENDS_QUESTION(1.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_SPAM_SHORT(0.81)[0.812,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[washington.edu]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.97)[0.970,0]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.95)[0.950,0]; R_SPF_NA(0.00)[] X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 16:50:28 -0000 On Thu, Jan 31, 2019 at 09:32:11AM -0700, Warner Losh wrote: > On Wed, Jan 30, 2019 at 11:33 PM Steve Kargl < > sgk@troutmask.apl.washington.edu> wrote: > > > Should/can TARGET_LIBC_HAS_FUNCTION be updated to at least > > default_libc_has_function? More importantly now that libm > > contains sincos[fl], should FreeBSD gcc config file be updated > > to use > > > > bool > > bsd_libc_has_function (enum function_class fn_class) > > { > > if (fn_class == function_c94 > > || fn_class == function_c99_misc > > || fn_class == function_c99_math_complex > > || fn_class == function_sincos) > > return true; > > > > return false; > > } > > On its surface, this seems sane to me. what does this control? And is this > for our ancient 4.2 or current gcc... > AFAICT, it controls the use of C99 compliant functions as builtins. Unfortunately and I should have remembered, FreeBSD's C runtime libraries (ie libc+libm) are not C99 compliant. The problem (for me) is that function_c99_math_complex indicates that libm includes a complete set of C99 complex math function, which of course it doesn't. Testing with GCC trunk gives 1 default_libc_has_function (C99 compliant libc+libm) 2 no_c99_libc_has_function (FreeBSD current setting) 1 2 === gcc Summary === # of expected passes 134923 134887 # of unexpected failures 171 207 <-- This is good. # of unexpected successes 27 27 # of expected failures 550 550 # of unresolved testcases 14 14 # of unsupported tests 2222 2222 === g++ Summary === # of expected passes 124009 124009 # of unexpected failures 41 41 # of expected failures 548 548 # of unsupported tests 5585 5585 === gfortran Summary === # of expected passes 48992 48993 # of unexpected failures 2 1 <-- This is bad. # of expected failures 130 130 # of unsupported tests 88 88 To fix the "This is bad" requires improvements to libm. The one individual, who spent 15+ years trying to improve libm, was forced to hand in his commit bit due to the fiasco of jenkins spamming the -current and -stable mailing lists. Mysteriously, a month or so after that individual stopped contributed to libm, jenkins stopped spamming the mailing list. -- Steve