Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Complicated usage with static libv8

Received: by 10.224.216.200 with SMTP id hj8mr814521qab.2.1317932614224;
        Thu, 06 Oct 2011 13:23:34 -0700 (PDT)
X-BeenThere: v8-users@googlegroups.com
Received: by 10.224.207.1 with SMTP id fw1ls4620084qab.4.gmail; Thu, 06 Oct
 2011 13:23:32 -0700 (PDT)
Received: by 10.224.183.69 with SMTP id cf5mr793658qab.34.1317932612505;
        Thu, 06 Oct 2011 13:23:32 -0700 (PDT)
Received: by 10.224.183.69 with SMTP id cf5mr793657qab.34.1317932612488;
        Thu, 06 Oct 2011 13:23:32 -0700 (PDT)
Return-Path: <ondrej.z...@gmail.com>
Received: from mail-vx0-f180.google.com (mail-vx0-f180.google.com [209.85.220.180])
        by gmr-mx.google.com with ESMTPS id e7si3253533qcu.3.2011.10.06.13.23.32
        (version=TLSv1/SSLv3 cipher=OTHER);
        Thu, 06 Oct 2011 13:23:32 -0700 (PDT)
Received-SPF: pass (google.com: domain of ondrej.z...@gmail.com designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ondrej.z...@gmail.com designates 209.85.220.180 as permitted sender) smtp.mail=ondrej.z...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by mail-vx0-f180.google.com with SMTP id f11so4059826vcb.25
        for <v8-users@googlegroups.com>; Thu, 06 Oct 2011 13:23:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type;
        bh=aF9z99ULMW9nKgvjVcy+FyZFiYj15rzTbr240I30qxc=;
        b=i3RzmHuyotefR5QvPNwC/HH4nGkZrKUy1nvHKSLzbSxiD5337NjO+Vzos75NBH3+PG
         VowyEGBbJnbthhA3TryiJ4coPTWO5BepFPDamqinqVbPBUUZc5UBGr80vCa8HhAb2xh2
         lpIk8nej5rCyic/JymwwV7ZIoDD+fi5hxcyXs=
MIME-Version: 1.0
Received: by 10.52.27.207 with SMTP id v15mr1190763vdg.326.1317932612259; Thu,
 06 Oct 2011 13:23:32 -0700 (PDT)
Received: by 10.220.188.65 with HTTP; Thu, 6 Oct 2011 13:23:31 -0700 (PDT)
In-Reply-To: <03ED9FE9-AFEE-46C5-9514-B21ECEDFECC5@gmail.com>
References: <11614729.167.1317793880842.JavaMail.geo-discussion-forums@yqnk41>
	<0AFD9DD6-DBBA-42D7-9415-C553AC7BF...@gmail.com>
	<CAAgCJPZeCtdOopntJsCwWRqA9L4yM03V18GeH6K5Ss2M=oL...@mail.gmail.com>
	<5379A149-5AC8-4978-94ED-D23AE4FFB...@gmail.com>
	<CAAgCJPaZmZSSiHejpFeWm5LRf65YWve+q7w+_Y2ZMfHuJE-...@mail.gmail.com>
	<CAKd4nAhgY4tQoLwvBG5ufK8KeY9J80h1aW46mVHq=6zJ+Sq...@mail.gmail.com>
	<03ED9FE9-AFEE-46C5-9514-B21ECEDFE...@gmail.com>
Date: Thu, 6 Oct 2011 22:23:31 +0200
Message-ID: <CAAgCJPZcuznjPTKOd6zGK5k0jJSOj-RSg2hyB4cxoF297wm...@mail.gmail.com>
Subject: Re: [v8-users] Complicated usage with static libv8
From: =?ISO-8859-2?B?T25k+GVqIK7hcmE=?= <ondrej.z...@gmail.com>
To: v8-users@googlegroups.com
Content-Type: multipart/alternative; boundary=20cf307c9d78310fd804aea719aa

--20cf307c9d78310fd804aea719aa
Content-Type: text/plain; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable

2011/10/6 Michael Schwartz <myk...@gmail.com>

> Try linking everything against libv8.so.  Your main program should be abl=
e
> to load v8 as a .so, and all your other .so should be able to find the
> symbols.  I think there's a special command line switch to gcc/ld that wi=
ll
> export all the symbols in your main program (and libv8.so) to the elf fil=
e.
>
>
If I link everything to libv8.so, the whole project works without the need
to hack (or explicitly export) anything :)

The original intention, lost in discussion, was to actually *evade* shared
V8 completely. However, my recent experiments and googling lead me to
conclusion that using a static V8 does not seem to be possible.


O.



> On Oct 6, 2011, at 9:29 AM, Stephan Beal wrote:
>
> On Thu, Oct 6, 2011 at 5:18 PM, Ond=F8ej =AE=E1ra <ondrej.z...@gmail.com>=
 wrote:
>
>> Okay, will try this: link v8cgi with libv8.a; link my modules with
>> libv8.so. V8 symbols will be available at runtime so the modules will be
>> happy; libv8.a will be linked just to main binary. Sounds reasonable; wi=
ll
>> let you know about the outcome.
>>
>
> i _think_ that runs the risk of the problem you and i discussed a few day=
s
> ago - a "split brain" (as it's known in clustering jargon). Some of v8's
> file-local static (not exported) internals might be in the static bits an=
d
> some might be allocated again in the DLL. Might. Maybe.
>
>
>>
>>> Ideally you shouldn't have to static link with libv8.a at all.  I bet
>>> there are gcc/ld flags that would allow all to be .so.
>>>
>>>
>> Yes, the shared solution works flawlessly. I am just trying an
>> alternative, suggested by one of my users...
>>
>
> But of course i've been known to be wrong ;).
>
> --
> ----- stephan beal
> http://wanderinghorse.net/home/stephan/
>
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users
>
>
>  --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users
>

--20cf307c9d78310fd804aea719aa
Content-Type: text/html; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">2011/10/6 Michael Schwartz <span dir=3D"=
ltr">&lt;<a href=3D"mailto:myk...@gmail.com">myk...@gmail.com</a>&gt;</span=
><br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-le=
ft:1px #ccc solid;padding-left:1ex;">
<div style=3D"word-wrap:break-word">Try linking everything against libv8.so=
. =A0Your main program should be able to load v8 as a .so, and all your oth=
er .so should be able to find the symbols. =A0I think there&#39;s a special=
 command line switch to gcc/ld that will export all the symbols in your mai=
n program (and libv8.so) to the elf file.<div>
<div></div><div class=3D"h5"><div><br></div></div></div></div></blockquote>=
<div><br>If I link everything to libv8.so, the whole project works without =
the need to hack (or explicitly export) anything :)<br><br>The original int=
ention, lost in discussion, was to actually *evade* shared V8 completely. H=
owever, my recent experiments and googling lead me to conclusion that using=
 a static V8 does not seem to be possible.<br>
<br><br>O.<br><br>=A0</div><blockquote class=3D"gmail_quote" style=3D"margi=
n: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-le=
ft: 1ex;"><div style=3D"word-wrap: break-word;"><div><div class=3D"h5"><div=
><div>
<div>On Oct 6, 2011, at 9:29 AM, Stephan Beal wrote:</div><br><blockquote t=
ype=3D"cite"><div class=3D"gmail_quote">On Thu, Oct 6, 2011 at 5:18 PM, Ond=
=F8ej =AE=E1ra <span dir=3D"ltr">&lt;<a href=3D"mailto:ondrej.z...@gmail.co=
m" target=3D"_blank">ondrej.z...@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
<div class=3D"gmail_quote"><div>Okay, will try this: link v8cgi with libv8.=
a; link my modules with libv8.so. V8 symbols will be available at runtime s=
o the modules will be happy; libv8.a will be linked just to main binary. So=
unds reasonable; will let you know about the outcome.<br>

</div></div></blockquote><div><br></div><div>i _think_ that runs the risk o=
f the problem you and i discussed a few days ago - a &quot;split brain&quot=
; (as it&#39;s known in clustering jargon). Some of v8&#39;s file-local sta=
tic (not exported) internals might be in the static bits and some might be =
allocated again in the DLL. Might. Maybe.</div>

<div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex=
;border-left:1px #ccc solid;padding-left:1ex"><div class=3D"gmail_quote"><d=
iv>
=A0</div><div><blockquote class=3D"gmail_quote" style=3D"margin:0pt 0pt 0pt=
 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div styl=
e=3D"word-wrap:break-word"><div></div><div>Ideally you shouldn&#39;t have t=
o static link with libv8.a at all. =A0I bet there are gcc/ld flags that wou=
ld allow all to be .so.</div>


<div><div></div><div><div><br></div></div></div></div></blockquote></div><d=
iv><br>Yes, the shared solution works flawlessly. I am just trying an alter=
native, suggested by one of my users...<br></div></div></blockquote><div>

<br></div><div>But of course i&#39;ve been known to be wrong ;).</div><div>=
<br></div></div>-- <br>----- stephan beal<br><a href=3D"http://wanderinghor=
se.net/home/stephan/" target=3D"_blank">http://wanderinghorse.net/home/step=
han/</a><br>
<div><br></div>

-- <br>
v8-users mailing list<br>
<a href=3D"mailto:v8-users@googlegroups.com" target=3D"_blank">v8-users@goo=
glegroups.com</a><br>
<a href=3D"http://groups.google.com/group/v8-users" target=3D"_blank">http:=
//groups.google.com/group/v8-users</a></blockquote></div><br></div></div></=
div></div><div><div></div><div class=3D"h5">

<p></p>

-- <br>
v8-users mailing list<br>
<a href=3D"mailto:v8-users@googlegroups.com" target=3D"_blank">v8-users@goo=
glegroups.com</a><br>
<a href=3D"http://groups.google.com/group/v8-users" target=3D"_blank">http:=
//groups.google.com/group/v8-users</a></div></div></blockquote></div><br>

--20cf307c9d78310fd804aea719aa--