From owner-freebsd-arm@freebsd.org Wed Oct 7 06:57:24 2020 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28A993FDBC6 for ; Wed, 7 Oct 2020 06:57:24 +0000 (UTC) (envelope-from kamalpr@gmail.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C5lWl1zprz4R7w for ; Wed, 7 Oct 2020 06:57:22 +0000 (UTC) (envelope-from kamalpr@gmail.com) Received: by mail-qt1-x844.google.com with SMTP id g3so778077qtq.10 for ; Tue, 06 Oct 2020 23:57:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Sv9HN4vKWGD1ZfyRjsoBbbaBQL2xBTWbIjqYngT3SJw=; b=Lawj1Koggb8N9aSl0+yz/2QLJxMBiYj38cEzDYZV6OH9SRzn3h7cB1msAycELzxz0E o762HjL3nQVgggiq2/7v07KBnjDR8661zIF/CIP+idNZxH7hLOHn4KyTs4xtC3y/Vfbe XI2JQ0JWGNNUTVHd0tTRBja9uug/ZNcIoGww4SmtPmeEs41CQCWhlULK2dYnLqoJyynN FxBsRNHqrXuTMZZ8pk+P8jmn0ReB3sUiTAlr9evaSZ0owBfY3iSMMwpqIhui7OeAhNgi sw2IuSg+C1/Ic2r8exY45ZqpKhe8tlTxskVTQV01Xz1LJm4rLVIifMsuDt2KDR2khIKo ENNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Sv9HN4vKWGD1ZfyRjsoBbbaBQL2xBTWbIjqYngT3SJw=; b=YaHbeChkEEMEvbq2ictAyttt57SNCYlWEOpe2g57Png26DR60opbBjz7BrGW9vvna2 1B4dnIcTe2ygPtr8bXjicrzU3f3IuFKdyCRmsKspsagCWXAwi8QiING28lne4bFbZzWb fFwtrzYsILVXv29eQGXBk4IblhCvOAgnImBPM9fTMvgTNU3H9ay5laR2nB9ah7hAcvVO b1Ot2cenPC+1Q/SfwG7rUJ2ybRRFfhReaPg1RmXA368Hskk74FtbMgTJHUT5179a84pA AA8JZMm92vsbyXkrktLgP6a9olQNRGnwBEc4jdp2fsAVIAaiNMVVMroLhqdjp7k/Qukg sBNg== X-Gm-Message-State: AOAM530zZmslGOnB+bKI10E+55G5jU+AMlWJWMOiaPNR07ED2SrlG25N XjpL43GU4o/ygNWrChBJwEpUT/f4Rd9sTsY= X-Google-Smtp-Source: ABdhPJw1TFfHj1/aFdgQZPBS9YyGHh68dHmeMD5Hj83mSz/F4SKDPFsAxgmpjpacftrWARuP1ZTjgg== X-Received: by 2002:ac8:1910:: with SMTP id t16mr1693352qtj.351.1602053842168; Tue, 06 Oct 2020 23:57:22 -0700 (PDT) Received: from [192.168.1.3] ([122.179.31.199]) by smtp.gmail.com with ESMTPSA id h199sm755079qke.112.2020.10.06.23.57.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Oct 2020 23:57:21 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: generic q on freebsd From: Kamal Prasad In-Reply-To: Date: Wed, 7 Oct 2020 12:40:19 +0530 Cc: "freebsd-arm@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Warner Losh X-Mailer: Apple Mail (2.3273) X-Rspamd-Queue-Id: 4C5lWl1zprz4R7w X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Lawj1Kog; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of kamalpr@gmail.com designates 2607:f8b0:4864:20::844 as permitted sender) smtp.mailfrom=kamalpr@gmail.com X-Spamd-Result: default: False [-3.57 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.001]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.03)[-1.030]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RECEIVED_SPAMHAUS_PBL(0.00)[122.179.31.199:received]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.04)[-1.037]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::844:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-arm] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Oct 2020 06:57:24 -0000 Thanks. Why is it difficult to port the C++ runtime to the kernel? I = mean what is the technological hurdle? thanks -kamal On Oct 6, 2020, at 10:53 PM, Warner Losh wrote: >=20 > On Tue, Oct 6, 2020, 11:03 AM Kamal R. Prasad = wrote: >=20 >> hello, >>=20 >> i am curious if it is possible to compile c++ code inside the freebsd >> kernel. >>=20 >=20 >=20 > Possible? Yes, with restrictions. Easy? No. >=20 > There are a number of restrictions on doing this. There is no C++ = runtime > support provided in stock FreeBSD. You have to write your own, or find > someone else that has published theirs. And the code is likely to be > compiler dependent. People have done it and talked or blogged about = it. >=20 > Generally, if you don't use exceptions, templates, RTTI, expressions = that > result in the automatic allocation of objects, have large objects (> = 1k) on > the stack, etc, it may be possible. I tried it in the 90s and had to = write > just a few routines to make simple classes work, but there's a lot of > dragons here and very little C++ code is written these days w/o = reference > to the standard libraries, which aren't present in the kernel. >=20 > Some googling turns up: > https://github.com/adamlsd/libcpp.ko from 6 years ago > https://lists.freebsd.org/pipermail/freebsd-arch/2018-June/019069.html = has > some details from 2 years ago about command line args you might need. >=20 > Many have tried. Few have succeeded. Those that have write all their = code > to conform to a subset of the language. Few have had success moving = C++ > code for other purposes into the kernel, though if it was written = using the > proposed (but never ratified) eC++ (embedded subset), then chances are > greater. >=20 > Good luck >=20 > Warner > _______________________________________________ > freebsd-arm@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"