hoodlum1980 / npapi-sdk

Automatically exported from code.google.com/p/npapi-sdk
0 stars 0 forks source link

GCC 3 ABI mask breaks Flash 10.3 compatibility on Solaris for Chromium compiled with gcc 4 #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install Flash 10.3 NPAPI plugin for Solaris
2. Install Chromium for Solaris, which I've ported
3. Load site with Flash video

What is the expected output? What do you see instead?
Flash video plays.  Instead, the Flash plugin doesn't work and the following 
error message is seen on the console:

Not GTK2 toolkit (got 0).

What operating system are you compiling on?
Solaris Express 2010.11 i86pc

Please provide any additional information below.
It appears that starting with Flash 10.2 for Solaris (as Flash 10.1 works fine 
with Chromium), Adobe checks NPNVToolkit to make sure it's Gtk2.  Chromium 
tries to set this flag in plugin_host.cc (lines 758-762: 
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/plugins/npapi/plugin_host
.cc?view=annotate) but apparently it still comes out zero.  I logged the code 
and found that Flash looks for NPNVToolkit with the identifier 13, while 
Chromium uses the number 268435469 as the identifier for NPNVToolkit, so it 
never reports back with the right toolkit.  Looking further into npapi.h, I 
found that this is because the NP_ABI_GCC3_MASK is applied to NPNVToolkit, when 
it's defined.  My attached patch modifies npapi.h to only apply the ABI mask 
for gcc 3, not for gcc 4 also, and Flash 10.3 starts working with Chromium 
again.

Looking into why this ABI mask was applied in the first place, apparently it 
was to account for an ABI change from gcc 2 to gcc 3 
(https://bugzilla.mozilla.org/show_bug.cgi?id=182117#c18).  However, I guess it 
was simply assumed back then that gcc 4 would have the same ABI as gcc 3 (that 
patch was applied a couple years before gcc 4 came out), which may not be the 
case.  I find it crazy that all these compiler-specific modifications snuck 
into NPAPI, as noted in comment 15 on that mozilla bug.  This bug is not 
reproducible with Firefox 3.6 for Solaris as Oracle compiles Firefox with the 
Oracle Studio Compiler, not with gcc.

It's also possible that the NPAPI Flash plugin for Solaris is compiled with 
Oracle Studio and not with gcc, so the real issue is that only one compiler 
should be used with NPAPI on Solaris.  I don't know if this is the case or if 
the gcc ABI changed again.

Original issue reported on code.google.com by joa...@yepmail.net on 16 Jun 2011 at 8:54

Attachments:

GoogleCodeExporter commented 9 years ago
After looking into this further, I think Flash for Solaris is indeed compiled 
with the Oracle Studio compiler, because of some C runtime libraries that it 
links against.  As a result, I have modified this patch to reflect the fact 
that it's only a Solaris compiler issue.  I don't know if it's something that 
can be applied to the NPAPI SDK, but perhaps to the NPAPI in Chromium.

Original comment by joa...@yepmail.net on 16 Jun 2011 at 9:26

Attachments: