Bug 97622 - [EFL] Fix build error : Link webkit2 library to ewk2UnitTestInjectedBundleSample.
Summary: [EFL] Fix build error : Link webkit2 library to ewk2UnitTestInjectedBundleSam...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Byungwoo Lee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-25 18:39 PDT by Byungwoo Lee
Modified: 2012-09-29 05:51 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.54 KB, patch)
2012-09-25 19:00 PDT, Byungwoo Lee
no flags Details | Formatted Diff | Diff
Simple test code for dlopen and static library problem. (832 bytes, application/x-gzip)
2012-09-26 08:24 PDT, Byungwoo Lee
no flags Details
Patch (1.70 KB, patch)
2012-09-28 18:23 PDT, Byungwoo Lee
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Byungwoo Lee 2012-09-25 18:39:53 PDT
When building efl for the first time, there is a build error as below.

In file included from WebKitBuild/Debug/DerivedSources/WebKit2/include/WebKit2/WKBase.h:1:0,
                 from Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleInitialize.h:29,
                 from WebKitBuild/Debug/DerivedSources/WebKit2/include/WebKit2/WKBundleInitialize.h:1,
                 from Source/WebKit2/UIProcess/API/efl/tests/InjectedBundle/injected_bundle_sample.cpp:26:
Source/WebKit2/Shared/API/c/WKBase.h:41:32: fatal error: WebKit2/WKBaseSoup.h: No such file or directory
Comment 1 Byungwoo Lee 2012-09-25 19:00:10 PDT
Created attachment 165716 [details]
Patch
Comment 2 Raphael Kubo da Costa (:rakuco) 2012-09-25 23:51:30 PDT
Comment on attachment 165716 [details]
Patch

Doesn't it make sense to link this library against ${EWK2UnitTests_LIBRARIES} instead? Right now the file only includes a few headers and does nothing, but in the future not only will it need these created headers, but also actual function calls, I guess.
Comment 3 Byungwoo Lee 2012-09-26 03:18:50 PDT
(In reply to comment #2)
> (From update of attachment 165716 [details])
> Doesn't it make sense to link this library against ${EWK2UnitTests_LIBRARIES} instead? Right now the file only includes a few headers and does nothing, but in the future not only will it need these created headers, but also actual function calls, I guess.

I understand your point.

Actually, I have one doubt for linking EWK2UnitTests_LIBRARIES to injected bundle libraries. (about static library conflict issue)

As you already know,
EWK2UnitTests_LIBRARIES has wtf, javascriptcore and webcore library.
And if SHARED_CORE is not ON, wtf, javascript, webcore will be a static library, and linked both WebProcess and injected bundle library.

Isn't there any problem when WebProcess load the injected bundle library?

I'm not sure but I simply understood that the EFL's build guide about SHARED_CORE=ON for the layout test is related with this issue.
Comment 4 Gyuyoung Kim 2012-09-26 05:01:20 PDT
(In reply to comment #3)
 
> I'm not sure but I simply understood that the EFL's build guide about SHARED_CORE=ON for the layout test is related with this issue.

We should support to enable | disable SHARED_CORE both.
Comment 5 Raphael Kubo da Costa (:rakuco) 2012-09-26 05:08:12 PDT
(In reply to comment #3)
> As you already know,
> EWK2UnitTests_LIBRARIES has wtf, javascriptcore and webcore library.
> And if SHARED_CORE is not ON, wtf, javascript, webcore will be a static library, and linked both WebProcess and injected bundle library.
> 
> Isn't there any problem when WebProcess load the injected bundle library?

I don't think there should be an issue, but you can try it locally first and see if you experience any sort of weird issues.
Comment 6 Byungwoo Lee 2012-09-26 08:24:31 PDT
Created attachment 165807 [details]
Simple test code for dlopen and static library problem.
Comment 7 Byungwoo Lee 2012-09-26 08:25:27 PDT
(In reply to comment #5)
> (In reply to comment #3)
> > As you already know,
> > EWK2UnitTests_LIBRARIES has wtf, javascriptcore and webcore library.
> > And if SHARED_CORE is not ON, wtf, javascript, webcore will be a static library, and linked both WebProcess and injected bundle library.
> > 
> > Isn't there any problem when WebProcess load the injected bundle library?
> 
> I don't think there should be an issue, but you can try it locally first and see if you experience any sort of weird issues.


I'm telling the general case about singleton instance or static/global variable in static library.
I attached the simple example about this.

A singleton is created in TestClass static library.
WebProcess and libInjectedBundle.so link the static library and both uses the singleton.
The address of the singleton instance is different as below.

WebProcess instance: 0x0896a008
InjectedBundle instance: 0x0896a410
InjectedBundle instance: 0x0896a410
InjectedBundle instance: 0x0896a410
WebProcess instance: 0x0896a008
WebProcess instance: 0x0896a008

WebProcess and InjectedBundle has different singleton instance because the static library is linked WebProcess and InjectedBundle statically.
Comment 8 Raphael Kubo da Costa (:rakuco) 2012-09-27 07:31:14 PDT
Right. I was talking to Kenneth about this; I guess you can simply link against the webkit2 library itself to avoid this sort of problem -- injected bundles are not really supposed to call WebCore/WTF/whatever.
Comment 9 Byungwoo Lee 2012-09-27 19:23:20 PDT
(In reply to comment #8)
> Right. I was talking to Kenneth about this; I guess you can simply link against the webkit2 library itself to avoid this sort of problem -- injected bundles are not really supposed to call WebCore/WTF/whatever.

Ok. That makes sense. Thanks :)
Comment 10 Byungwoo Lee 2012-09-28 18:23:23 PDT
Created attachment 166342 [details]
Patch
Comment 11 Raphael Kubo da Costa (:rakuco) 2012-09-29 05:02:03 PDT
Comment on attachment 166342 [details]
Patch

Looks good, thanks!
Comment 12 WebKit Review Bot 2012-09-29 05:51:16 PDT
Comment on attachment 166342 [details]
Patch

Clearing flags on attachment: 166342

Committed r129976: <http://trac.webkit.org/changeset/129976>
Comment 13 WebKit Review Bot 2012-09-29 05:51:20 PDT
All reviewed patches have been landed.  Closing bug.