From owner-svn-src-all@freebsd.org Fri Oct 14 02:06:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22534C10F3F; Fri, 14 Oct 2016 02:06:30 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E05D53D3; Fri, 14 Oct 2016 02:06:29 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x243.google.com with SMTP id p26so6004657ioo.2; Thu, 13 Oct 2016 19:06:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=eZ3B0uTAEe3iwyjQ/gV8PiYyQ4D2rOOPw0ZgO5y98jY=; b=uVESCNk/s3O8XVjngI4v8j7w6ilCrqpeUT2W2soMPoCPh/j7cLYecT/l8TgVuDW2yn wg3yZuqoiySzg7NR3yIkLF4iMxbD5Bglu0CCmL8Q81Ph/2ghlrYL5OzVWPAZIrmCDq5M WAxg/XIlGReh6GcXVqQmxBo2jEYx8HLlZLYZ7BwugI+zfX2HloVqHUjAYdbBrC7Y7Ebl +FwrR93ePXDd0x7c+DtnmHt48MMccU8llZIFNn/A5eAxUnMJ97RIu142B+tdLS83TXZI 4uN5Zsp7QpPRoKtM9JZ3OUgF6o+wbkGg8dC8RZHNNmOoTRhCcSieLHIX+3psx5Fri+rg IecA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=eZ3B0uTAEe3iwyjQ/gV8PiYyQ4D2rOOPw0ZgO5y98jY=; b=dYp7dqvjcN5l0N8O5q3lxIpeukF8AQura0cxZ2zbUArsJDxkfSGBTkzAT/UF02a8sy Jf50Cg/eaVfwLV3xn7QMm2jXFgQGt24ob9wfcFLi+t9J6xn3WNhGV0lSFvO5BXHcnHRd M3d6Y6EDLZe/g+nOONZIz1gvy0Lgu4QMeMa9zoiw4Z+40v471fC++eEYUkkGWgjqwJJc YNO0hbzpU9AHPHqhFOzEV5q/ZxoAA/1U09J3GEmSKAoAgIOavdfQ2d0ZYhB2u+Z/+pqQ d6IOArmz15xkEXMtqMyXXzz6qlP9z8sBv4dREm0gbkbYGkMNSf86Vi0o8NSIKEO3BWHD Rozw== X-Gm-Message-State: AA6/9RkZEsD4ytCTBwM6iLCHWBfcVI+jITpxEic8z3C1Fw5yD2s1f//sKYbPSQrqCigwjY+gnnKkWOhGFUByjQ== X-Received: by 10.107.23.197 with SMTP id 188mr8912338iox.162.1476410789183; Thu, 13 Oct 2016 19:06:29 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.180.211 with HTTP; Thu, 13 Oct 2016 19:06:08 -0700 (PDT) In-Reply-To: <20161014113603.F1039@besplex.bde.org> References: <201610131918.u9DJI0bX085695@repo.freebsd.org> <20161014113603.F1039@besplex.bde.org> From: Ed Maste Date: Fri, 14 Oct 2016 02:06:08 +0000 X-Google-Sender-Auth: cyw6T_vxGvrmzv8bpfzAI9dhUpw Message-ID: Subject: Re: svn commit: r307231 - head/lib/libgcc_s To: Bruce Evans Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 02:06:30 -0000 Hi Bruce, thank you for the detailed response. On 14 October 2016 at 01:53, Bruce Evans wrote: >> compiler-rt's complex division support routines contain calls to >> compiler builtins such as `__builtin_scalbnl`. Unfortunately Clang >> turns these back into a call to `scalbnl`. > > gcc-4.2 has the same bug. Oh, interesting. Do you know off hand if it's resolved in later GCC? It seems particularly unfortunate for the compiler to report (by whatever mechanism) that a builtin exists, and then just turn that builtin into a library call. >> For now link libm's C version of the required support routines. > > Even libm doesn't use these in some cases. i386 mostly uses asm > versions. Hopefully the rt division routines don't need to be efficient > because they are rarely called. Most likely I'll switch to the asm versions across suitable architectures in a subsequent change, mirroring the choices made in libm. I just wanted to get a version in, to enable further testing (ports exp-runs, etc.) of this libunwind / compiler-rt combination. [Details about specific groups of functions omitted -- I'll try to take a look at these later.] > libcompiler_rt.a now on amd64 now has the following namespace bugs: > > U compilerrt_abort_impl > U fflush > U fprintf > U mprotect > U sysconf > U fmaxl > U logbl > U scalbnl > U logbf > U scalbnf > U logb > U scalbn > U abort > > These are bugs since division must be available with -ffreestanding and > the freestanding library shouldn't have to reimplement it. Yes, these libcompiler_rt.a issues seem rather surprising to me, but presumably they aren't causing much of an issue in practice in the static lib. In any case, my hope is that once I try disentangling these libraries I can take a look at these issues across the set of libraries (libcompiler_rt.a aka libgcc.a, libgcc_eh.a, libgcc_s.so).