From owner-freebsd-current@freebsd.org Thu Oct 5 21:01:26 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 01F77E42AFE for ; Thu, 5 Oct 2017 21:01:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (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 C6723223A for ; Thu, 5 Oct 2017 21:01:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x236.google.com with SMTP id z187so14542351ioz.12 for ; Thu, 05 Oct 2017 14:01:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=88U4oWEzxDuq91RKoFq99a6jE/Sd9Qpwql5YxWAbU/8=; b=VxA2S8vYW0U8tQBra3W7fw0FtVVIrLfVxbGDFWn4oUT9hA3VigwqISaZgwpeKGbhIm MlXfQOTJWZZA4sUZbPjBXLVlq+q0840rHmppqxntAiogecVNbpAU3fjfeJ1wjvQhim96 6xSH+tIGQbb776j6hy2+6P5CDoEhSnc1d87/C/T4wKWEtZz//zpxoTF7M1rrKHhoFdlr 7zS72qWALy6544NQha7TZ2iLtQV/Tf9k2XhL2L8bHlQC8l8o+D/y6XL+588kpmPNF8hr hwiAVG3+0MBV9TmqJEyC9ytKBLQ7sBvqH6RFfx1GwFYuNfJVQ4rCbOF3aDxOhgHsvIe+ HfHg== 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=88U4oWEzxDuq91RKoFq99a6jE/Sd9Qpwql5YxWAbU/8=; b=rZSourn8x/XIFZ4kTLUeFF08lsToTcL+57JJFZPElZE2ZZj9/WJFXgc3sYndRGhdA4 Vt9QCG5VKraXHcfkwyLXy1ZNSt/dQb8qLJrGeBmhh73f9t03xn65l9Pv+spf7T1ekZJe YO9mEm/eHEESw53hXbAPYVPWgDJgxAqZH/7xTahJGqiOwtd5QZtcUEbMGGwkKTa8XpRN OFBxooTMktkUozm7nvgajJ6LkgdVnZEadPUor8RG3vwp36HoGUwhdc5+yYdjP5DRrIK6 ILOC0UjG02liv8QBR72cfc2asdq48YehJT6mn15g9Vk2bBjaZ4yvFlSM4EUc5qG287HJ 0ObQ== X-Gm-Message-State: AMCzsaU8YBMEls90IVXbgtgUNcV4RwVg4g4wS/uc3GKG7gJmnYDLfEjd nGACEGzraaoTBQN89Qz1irvsKqkOSTBH6HMpqsIJzg== X-Google-Smtp-Source: AOwi7QD63O4e/OJnNSQYiofJYHddMPTGSfHDr4hV5taA86vunYts7UfJ7V0j5H4Z+L83MeDQOyzk2fhZhGCfJysQ6Hs= X-Received: by 10.107.133.85 with SMTP id h82mr7735323iod.208.1507237284827; Thu, 05 Oct 2017 14:01:24 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Thu, 5 Oct 2017 14:01:24 -0700 (PDT) X-Originating-IP: [2607:fb10:7021:1::5304] In-Reply-To: References: From: Warner Losh Date: Thu, 5 Oct 2017 14:01:24 -0700 X-Google-Sender-Auth: _n0JbtinUuoPG27KjDfV_wKB910 Message-ID: Subject: Re: C++ in jemalloc To: David Goldblatt Cc: FreeBSD Current Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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: Thu, 05 Oct 2017 21:01:26 -0000 On Thu, Oct 5, 2017 at 11:59 AM, David Goldblatt wrote: > Hi all, > > The jemalloc developers have wanted to start using C++ for a while, to > enable some targeted refactorings of code we have trouble maintaining due > to brittleness or complexity (e.g. moving thousand line macro definitions > to templates, changing the build->extract symbols->rebuild mangling scheme > for internal symbols to one using C++ namespaces). We'd been holding off > because we thought that FreeBSD base all had to compile on GCC 4.2, in > order to support some esoteric architectures[1]. > > The other day though, I noticed that there is some C++ shipping with > FreeBSD; /usr/bin/dtc and /sbin/devd (the former claiming in the HACKING > document that C++11 is a minimum for FreeBSD 11). This, combined with the > fact that ports now points to a modern gcc, makes me think we were > incorrect, and can turn on C++ without breaking FreeBSD builds. > > Am I right? Will anything break if jemalloc needs a C++ compiler to build? > We will of course not use exceptions, RTTI, global constructors, the C++ > stdlib, or anything else that might affect C source or link compatibility. > > Thanks, > David (on behalf of the jemalloc developers > > [1] That being said, we don't compile or test on those architectures, and > so probably don't work there in the first place if I'm being honest. But > we'd also like to avoid making that a permanent state of affairs that can't > be changed. > For FreeBSD 10 and earlier, this would likely break all architectures that aren't x86. 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). So for the popular architectures, this arrangement might work. For building with external toolchains, it might also work. Some of the less popular architectures may be a problem. Does that help? It isn't completely cut and dried, but it should be helpful for you making a decision. Warner