From owner-freebsd-current@freebsd.org Fri Oct 6 14:15:25 2017 Return-Path: Delivered-To: freebsd-current@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 65935E384D0 for ; Fri, 6 Oct 2017 14:15:25 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf0-x22b.google.com (mail-lf0-x22b.google.com [IPv6:2a00:1450:4010:c07::22b]) (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 E8E961450 for ; Fri, 6 Oct 2017 14:15:24 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf0-x22b.google.com with SMTP id l23so13695798lfk.10 for ; Fri, 06 Oct 2017 07:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=AgrrtHiY+RXBqUTB12UwCxHJwQ1HZ2PZwnwkTxIDquQ=; b=s1Pjzivnp+m9GLhaxyUqHQGA2Tl7BzJuEsAI0cu3/oymBFEdAlodQrbWzp9h904ZRh bor4z8stAD9ckmSWS5Z3OJw5zZ9U8VcUAwdHVrXo6gsr/jUmom1EBRAgMxN4lbUkMMav 1AlXXpQ3o9f5gKcHwY/BluWCQi/L+o+wmUR1hyVHrweT1ha84HF41I3F4w8zFRgQBTBJ umhFQQNP0aKtNtY/ScQ0JI2vac81ti+g95dNL7o8qlYIE3EuVduMpFNuBpEyehlOU3Lx HW3B1vW+C7N1u8X+QGM0CmUvYCPxZQP9sJ2OXtDO4CLO3sPhY+2jNtuK9QTDMXLTkE4p /CXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=AgrrtHiY+RXBqUTB12UwCxHJwQ1HZ2PZwnwkTxIDquQ=; b=LR8HZHOGiSVU2WwRZ/4blgrxH40U7Qt/RfSrFPIt7igdYXcxKiWebmamAKlTFzeJgs Wi74URLfpHCHsrgZ5+0J1nmnfqBoQxdPmEBy6fp2LGxCqRVO74AJb6J5D95Yax+86Kmz fD+rmyRiI7NyCw4zZDxCrvCnGybeTet3I3N46YLHjRRLG35SHBMfrpc6bQ0Bdx2NiWDq 13fsHGg9lKsn7Mb+UWqRCcMTYNiRHAMKn23we7EJMSKVdjUcAX+Q8sNtX6gtfl1QPtQ5 NjjdMqoBUtPI72kDdyh3KLf6aTQcyqB/co2WRJn5a9iLZrs7DUlz4fkrAKnDzkyPAzPQ Wugg== X-Gm-Message-State: AMCzsaUru1ntiSTRmaVOEhgkKEgtstVaFNi6esIL8AONs2rGeqqZmHMB dKLEf1dBDZM5pMauxLFWbqNeodbOzg+swSOtkhc= X-Google-Smtp-Source: AOwi7QBeWeSUfZYJvSzVnGjnoMLj82YnFjGXqtsiB5sKYUaVLa2TdB9lPGQ31dN5QQQJCVjZalhwsFc29T2joEwjZeI= X-Received: by 10.25.59.210 with SMTP id d79mr879088lfl.207.1507299322852; Fri, 06 Oct 2017 07:15:22 -0700 (PDT) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.46.86.77 with HTTP; Fri, 6 Oct 2017 07:15:22 -0700 (PDT) In-Reply-To: References: From: Justin Hibbits Date: Fri, 6 Oct 2017 09:15:22 -0500 X-Google-Sender-Auth: Rl76-jl-ipUwHxndVpiTRsqOQjk Message-ID: Subject: Re: C++ in jemalloc To: Mark Millard Cc: Warner Losh , FreeBSD Current Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 14:15:25 -0000 Hi Mark, On Thu, Oct 5, 2017 at 11:58 PM, Mark Millard wrote: > Warner Losh imp at bsdimp.com wrote on > Thu Oct 5 21:01:26 UTC 2017 : > >> Starting in FreeBSD 11, arm and powerpc are supported by clang, >> but not super well. For FreeBSD 12, we're getting close for everything >> except sparc64 (whose fate has not yet been finally decided). > > My understanding of the powerpc and powerpc64 status > follows. This is based on my use of head via clang > as much as I can for them. > > For TARGET_ARCH=powerpc64 and TARGET_ARCH=powerpc : > > lld is far from working last I knew. (I've focused > more on the compilers for testing, using other > linkers and such.) [lldb may be in a similar state > for powerpc64. It does not build for powerpc.] > > clang 5 (and 4) generated code crashes on any thrown > C++ exception. For example: > > #include > > int main(void) > { > try { throw std::exception(); } > catch (std::exception& e) {} > return 0; > } > > crashes. > > Luckily most kernel and world code that I actively use > does not throw C++ exceptions in my use. Do you see this problem using libstdc++, et al, from base gcc 4.2.1? Or using libc++? I don't have the time right now to look into it, but if no one else is able to in the next couple months I'll try to make the time when higher priorities are done. > > But devel/kyua is majorly broken by the C++ exception > issue: It makes extensive use of C++ exceptions. In my > view that disqualifies clang as being "close": I view > my activity as a hack until devel/kyua is generally > operable and so available for use in testing. > > clang 5 currently can not build the TARGET_ARCH=powerpc > kernel. (I was able to back in clang 4 days --but the > resultant build failed to execute init fully after > finishing the prior boot activity.) For the 32-bit > context I use gcc 4.2.1 for building the kernel and > clang 5 for building the world, system binutils > in use in both cases. What problem(s) do you see with this? If they're just compile time failures they can be fixed pretty readily. > > I do build the kernel and world for > TARGET_ARCH=powerpc64 via system clang 5. But I > use ports binutils as well in order for this to > finish and work overall. > > > As for more modern devel/powerpc64-xtoolchain-gcc > (so devel/powerpc64-gcc) versions being used to > build the world and kernel for powerpc64 I've never > been able to get lib32 on powerpc64 to work via > such a build: it builds but fails to execute from > dereferencing via an R30 that has an inappropriate > value for the attempt ( lib32/crtbeginS.o code in > _init in /usr/lib32/libc.so.* ). (The clang-based > builds do not have this problem.) It has been a > while since I've done devel/powerpc64-gcc > experiments. > > I'm not aware of a devel/powerpc-xtoolchain-gcc > as an alternative for 32-bit powerpc targeting. There's documentation floating around (on the wiki maybe?) for doing this. I won't check now, but it's not difficult (not trivial, but not difficult). With the proposal to eliminate gcc 4.2.1 from our tree by the end of the year, we need to get everything in place to make a seamless transition, whether it be to external toolchain or to finish up clang for powerpc. I really hope we can finish up clang. Please continue to file bugs with as much detail as necessary to track down and fix the problems--both in FreeBSD and upstream LLVM. - Justin