From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 8 20:04:43 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9D5CF16A4BF for ; Mon, 8 Sep 2003 20:04:43 -0700 (PDT) Received: from tomts5-srv.bellnexxia.net (tomts5.bellnexxia.net [209.226.175.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8BAF143FBF for ; Mon, 8 Sep 2003 20:04:42 -0700 (PDT) (envelope-from matt@compar.com) Received: from hermes ([65.95.185.143]) by tomts5-srv.bellnexxia.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with SMTP id <20030909030441.RBUV11976.tomts5-srv.bellnexxia.net@hermes>; Mon, 8 Sep 2003 23:04:41 -0400 Message-ID: <006101c3767e$d0f48af0$1200a8c0@gsicomp.on.ca> From: "Matthew Emmerton" To: "Alexander Kabaev" , "John Giacomoni" References: <20030908224611.06027082.kabaev@mail.ru> Date: Mon, 8 Sep 2003 23:02:33 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: freebsd-hackers@freebsd.org Subject: Re: C++ code in a kernel module? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Sep 2003 03:04:43 -0000 > On Mon, 8 Sep 2003 11:35:37 -0600 > John Giacomoni wrote: > > > I was planning on using the macro __cplusplus to toggle using > > extern "C" { }, however the bsd.kmod.mk style Makefiles seem to > > force the language to -std=c99 even when compiling with c++ . > > > > my initial steps have been as follows: > > take a functioning C based kernel module and rename to .cc > > added extern "C" around the includes. > > #defined key words such as new to xxx_new > > recompiled the new .cc file by hand without -std=c99, but > > keeping all the flags as the Makefile set them. > > then linked using the Makefile and finally loaded the module. > > -fno-rtti -fno-exceptions is probably a must unless you want to bring a > whole libsupc++ library into the kernel. I've been silently following this thread, and unless I missed something, has anyone asked John why he wants/needs to use C++ in the kernel? -- Matt Emmerton