From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 8 10:35:42 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 8947216A4BF for ; Mon, 8 Sep 2003 10:35:42 -0700 (PDT) Received: from serl.cs.colorado.edu (serl-fs.cs.colorado.edu [128.138.242.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id 719B044001 for ; Mon, 8 Sep 2003 10:35:39 -0700 (PDT) (envelope-from John.Giacomoni@colorado.edu) Received: from colorado.edu (serl.cs.colorado.edu [128.138.243.145]) by serl.cs.colorado.edu (8.12.9/8.12.6) with ESMTP id h88HZciQ017679 for ; Mon, 8 Sep 2003 11:35:38 -0600 (MDT) Date: Mon, 8 Sep 2003 11:35:37 -0600 Mime-Version: 1.0 (Apple Message framework v552) Content-Type: text/plain; charset=US-ASCII; format=flowed From: John Giacomoni To: freebsd-hackers@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: X-Mailer: Apple Mail (2.552) Subject: 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: Mon, 08 Sep 2003 17:35:42 -0000 How would one go about creating a kernel module which utilizes C++ code? 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. as long as I do not make any calls into kernel functions things seem to work (load), however when I make a call to mtx_init then on load i get the following error: __gxx_personality_v0 undefined. thoughts/ideas/suggestions? thanks John G