From owner-freebsd-emulation@FreeBSD.ORG Sun Jun 26 18:25:06 2005 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D4AF116A425 for ; Sun, 26 Jun 2005 18:25:05 +0000 (GMT) (envelope-from vova@vbook.fbsd.ru) Received: from vbook.fbsd.ru (swsoft-mipt-nat.sw.ru [195.214.233.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 608A343D4C for ; Sun, 26 Jun 2005 18:25:05 +0000 (GMT) (envelope-from vova@vbook.fbsd.ru) Received: from vova by vbook.fbsd.ru with local (Exim 4.51 (FreeBSD)) id 1DmboU-0000c9-A6; Sun, 26 Jun 2005 22:25:02 +0400 From: Vladimir Grebenschikov To: jaco@coocoo.za.net In-Reply-To: <2943.196.37.144.98.1119808764.squirrel@webmail.premsoft.co.za> References: <2943.196.37.144.98.1119808764.squirrel@webmail.premsoft.co.za> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Organization: SWsoft Date: Sun, 26 Jun 2005 22:25:01 +0400 Message-Id: <1119810301.1100.5.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 FreeBSD GNOME Team Port Sender: Vladimir Grebenschikov Cc: freebsd-emulation@freebsd.org Subject: Re: [Linux] Loading Linux modules in Apache? X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vova@fbsd.ru List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2005 18:25:06 -0000 =F7 =D7=D3, 26/06/2005 =D7 19:59 +0200, jaco@coocoo.za.net =D0=C9=DB=C5=D4: > Hello All, >=20 > I am trying to load a Linux module in Apache 2.0.53, but I am running int= o > some problems. >=20 > I am not sure if this is even possible, but I sure hope so. ;) I guess you have some choices: - (easyest) Install linux apache and run whole beast under linux emulation - (much harder) You can try to mix ABI in single binary (just like win or mplayer does with windows DLLs) but, it is not easy task - write module wrapper for apache, it will consist of two parts - one FreeBSD binary (loaded into bsd apache), another - linux (it part will load your linux apache module). Parts should be connected by some IPC and apache module interface should be exported via this IPC. > This is the scenario: > I have a precompiled linux DSO module for Apache 2. This module loads fin= e > on Linux, but pukes when I try to load it on FreeBSD. >=20 > First of all a question: Is there any special setting that I must change > in order for apache to use be able to see the shared libraries that is in > the linux directectory? This directory is located in /usr/compat/linux/. >=20 > The module is branded as Linux. >=20 > When I try to load the module in Apache it complains about shared > libraries not being found. These libraries exist in /usr/compat/linux/lib > and /usr/compat/linux/usr/lib. They also work for the other linux > applications that I run, ie, they are found. >=20 > I also tried to link the libs in /usr/compat/linux/lib to /usr/lib. I KNO= W > that this can not be the right way to do it, but this sort of worked (no > more shared library not found), but then the module groaned about some > undefined symbols. I think this is because it finds some OTHER module wit= h > the same name as the one it's linked against in linux and then cannot fin= d > the stuff it is looking for. Here is the exact error message: > Syntax error on line 1108 of /usr/local/etc/apache2/httpd.conf: > Cannot load /usr/local/libexec/apache2/mod_V2_mgrequest94.so into server: > /usr/local/libexec/apache2/mod_V2_mgrequest94.so: Undefined symbol > "__gxx_personality_v0" >=20 > Here is the output of ldd: > root@disco-bear# ldd /usr/local/libexec/apache2/mod_V2_mgrequest94.so > /usr/local/libexec/apache2/mod_V2_mgrequest94.so: > libpthread.so.0 =3D> /usr/local/lib/libpthread.so.0 (0x281b3000) > libstdc++.so.3 =3D> /usr/lib/compat/libstdc++.so.3 (0x28204000) > libm.so.6 =3D> /usr/local/lib/libm.so.6 (0x28249000) > libgcc_s.so.1 =3D> /usr/local/lib/libgcc_s.so.1 (0x2826a000) > libc.so.6 =3D> /usr/local/lib/libc.so.6 (0x28272000) > ld-linux.so.2 (0x2839d000) > libm.so.2 =3D> /usr/lib/compat/libm.so.2 (0x283b0000) >=20 > (some of these are symlinked to /usr/compat/linux/lib) >=20 > Is there anything special that I must do to be able to load this module i= n > Apache? >=20 > OS: FreeBSD 5.4-RELEASE > Apache: 2.0.53 > Linux Base: Redhat 7.2 >=20 > Thank you in advance for your help. > ---Jaco > _______________________________________________ > freebsd-emulation@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-emulation > To unsubscribe, send any mail to "freebsd-emulation-unsubscribe@freebsd.o= rg" --=20 Vladimir B. Grebenschikov vova@fbsd.ru