Date: Sun, 2 Aug 2020 21:50:15 +0100 From: Jessica Clarke <jrtc27@freebsd.org> To: Dimitry Andric <dim@FreeBSD.org> Cc: src-committers <src-committers@freebsd.org>, svn-src-projects@freebsd.org Subject: Re: svn commit: r363773 - projects/clang1100-import/contrib/llvm-project/compiler-rt/lib/builtins Message-ID: <5D6813EB-F270-412D-8C15-8A05CB6353DE@freebsd.org> In-Reply-To: <202008021807.072I7GM9059504@repo.freebsd.org> References: <202008021807.072I7GM9059504@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2 Aug 2020, at 19:07, Dimitry Andric <dim@FreeBSD.org> wrote: > > Author: dim > Date: Sun Aug 2 18:07:16 2020 > New Revision: 363773 > URL: https://svnweb.freebsd.org/changeset/base/363773 > > Log: > Reapply r230021, r276851 and a few other commits to compiler-rt > > Reapply r230021 (by ed): > > Add a workaround to prevent endless recursion in compiler-rt. > > SPARC and MIPS CPUs don't have special instructions to count > leading/trailing zeroes. The compiler-rt library provides fallback > rountines for these. The 64-bit routines, __clzdi2 and __ctzdi2, are > implemented as simple wrappers around the compiler built-in > __builtin_clz(), assuming these will expand to either 32-bit > CPU instructions or calls to __clzsi2 and __ctzsi2. > > Unfortunately, our GCC 4.2 probably thinks that because the operand is > stored in a 64-bit register, it might just be a better idea to invoke > its 64-bit equivalent, simply resulting into endless recursion. Fix this > by defining __builtin_clz and __builtin_ctz to __clzsi2 and __ctzsi2 > explicitly. > > Reapply r276851: > > Update compiler-rt to trunk r224034. This brings a number of new > builtins, and also the various sanitizers. Support for these will be > added in a later commit. Are you sure this is still necessary? https://reviews.llvm.org/D42902 (which landed in in 2018 for 7.0.0, way after the original r230021 in 2012) followed by a follow-up commit for the correct SPARC macro, fixed this in an OS-independent way upstream, but inside c?zdi2.c themselves so you won't notice a merge conflict. Jess
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5D6813EB-F270-412D-8C15-8A05CB6353DE>